10
votes

I'm almost getting the handle of GHC cost centres.... it is an awesome idea, and you can actually fix memory leaks with their profiling tools. But my problem is that the information I'm getting in the .hp profiling is too truncated:

(1319)GHC.Conc.Signal.CAF   640
(1300)GHC.Event.Thread.CAF  560
(2679)hGetReplies/connect/c...  112
(2597)insideConfig/CAF:lvl2...  32
(1311)GHC.IO.Handle.FD.CAF  656
(2566)setLoggerLevels/confi...  208
(2571)configureLoggingToCon...  120
(2727)reply/Database.Redis....  32

How do I know for example what is the full cost centre stack in (2566) or (2559)? Is there a tool for that or a command-line option?

1

1 Answers

5
votes

Pass +RTS -L100 to your the program when you run it with profiling, and change 100 to whatever number of characters you want to see of your cost centres.

The documentation can be found in the GHC user guide, section “RTS options for heap profiling”.