@mpickering and David Eichmann have written a post for the Well-Typed group blog on an experimental new profiling mode for GHC, as part of a bunch of improvements to profiling tools:
I tried to use this way to profile my app, but the resulting profile is… uninformative despite the app being compiled with
-fdistinct-constructor-tables compile time flags.
JOB "test-app-please-ignore +RTS -hi" DATE "Tue Sep 12 14:07 2023" SAMPLE_UNIT "seconds" VALUE_UNIT "bytes" BEGIN_SAMPLE 0.000000 END_SAMPLE 0.000000 BEGIN_SAMPLE 0.117509 0x512ee90 80 0x5139ee0 32 0x51294e0 32 0x4febfe0 16 0x4febba8 16 0x3542bb0 24 0x34f3440 16 0x2f8a068 16 0x2f8b2b0 72 0x2f8b380 216 0x34ebdb8 16 0x3287290 40 0x512a128 72 0x4f06ca0 80 0x5138cf0 72 0x5131748 24 ...
eventlog sometimes comes out empty when using
-hc usually works fine.
Which platform / GHC version? Did you recompile all library dependencies with the flags, as well as the app itself?
Even if so, you may still see a few info tables with missing provenance information. Mostly these come from libraries distributed with GHC (e.g.
base) for which there isn’t yet a good story about how to distribute the IPE data (#22972: Providing IPE-enabled bindists in the release pipeline · Issues · Glasgow Haskell Compiler / GHC · GitLab). Or they may come from corner cases where GHC doesn’t emit IPE information yet (#23901: Add infotable location info for thunks introduced by tag inference. · Issues · Glasgow Haskell Compiler / GHC · GitLab). But in my experience these cases usually affect only a small proportion of the data so the Detailed tab generated by
eventlog2html is still useful.
eventlogsometimes comes out empty when using
-hcusually works fine.
I’ve not seen this. Is it possible that the app is being killed rather than shutting down normally? (In that case the eventlog buffer might not be flushed to disk quickly enough.)