4

I have compiled a Haskell program with GHC with enabled profiling.

$ ./server +RTS -M6m -p -RTS

I get a profile like:

 individual inherited COST CENTRE MODULE no. entries %time %alloc %time %alloc poke_a4u64 Generator 2859 56436 0.0 0.0 0.4 0.4 storeParameter Generator 2860 0 0.4 0.4 0.4 0.4 ppCurrent Generator 2866 56436 0.0 0.0 0.0 0.0 ppFeedback Generator 2861 56436 0.0 0.0 0.0 0.0 

It looks like storeParameter is never called, but consumes time and memory. Since storeParameter calls ppCurrent, I guess that storeParameter is called 56436 times, like ppCurrent. Why is not shown?

1
  • 1
    It would be very helpful to see the code you are profiling, if possible. Commented Oct 3, 2011 at 7:42

2 Answers 2

5

It's a bug in the ghc profiling. I don't know of a workaround, but Simon M has promised improvements in the next release.

Sign up to request clarification or add additional context in comments.

2 Comments

Do you have a link to the GHC Trac ticket?
I can't remember if there's a Trac ticket, but I've talked to Simon M about it.
0

I've found the entries column to lie in my own code: e.g. main getting called 6 times!

So I wouldn't worry too much about it.

3 Comments

entries is not the number of times a function is called. It's the number of times a call graph node has been entered. The two are not the same.
@JohnL: still, why would main's call graph node be entered more than once? No recursion or anything: just doing a straight "read parameters in from command line, print some stuff to stdout, evaluate a pure function and save results of it to disk".
it's speculation on my part, but maybe returning to main from a system call counts? It would be nice if the documentation were a bit more thorough.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.