[Haskell-cafe] Obtain cost-centers stacks from eventlog file

Ruben Astudillo ruben.astud at gmail.com
Tue Sep 27 16:36:36 UTC 2022


Hello -cafe!

I got some experience profiling memory leaks using -prof and the +RTS -hc
-L350 --RTS option. This gives me a .hp file with samples done at regular
intervals. I can feed this file to `hp2pretty`, get some nice graphs and
when I identify a suspicious band, I can grep the .hp file to get the
complete "cost-center stack" responsible for that band. Here is an example
of one:

    (18514)unsafeCreate/take/hexString/withText/parseOptionalFieldWith<...>

I have been trying to replicate this setup using the eventlog logging. I use
+RTS -l-aug -hc --RTS to get the eventlog with user and GC events. I use
`eventlog2html` to get better view of memory allocation per cost-center. The
normalized view presents me with cost-centers at the right side where I can
filter on them[1].

But those labels are just the "top" of the cost-center stack. In fact I
don't think the whole cost-center stack is represented anywhere on the
eventlog file. I can sort of get the structure of the cost-center stack from
the .hp file. The labels identifying the cost-center are different between
the two files.

Is there a way to recover the complete cost-center stack purely from the
eventlog file? Thanks in advance

[1]: https://imgur.com/a/nXyCEpG

-- 
Rubén. (pgp: 1E88 3AC4 89EB FA22)


More information about the Haskell-Cafe mailing list