Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I see the full cost-centre stack in GHC?

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?

like image 660
dsign Avatar asked Aug 27 '15 04:08

dsign


1 Answers

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”.

like image 174
Joachim Breitner Avatar answered Nov 05 '22 16:11

Joachim Breitner