When I compile with ghc -prof -auto-all, I end up with a .prof file that starts out like this: individual inherited COST CENTRE MODULE no. entries %time %alloc %time %alloc MAIN MAIN 1 0 0.0 0.0 100.0 100.0 main Main 228 92329 0.2 0.9 99.8 99.8 step Main 259 679 38.4 26.6 56.6 39.2 I'm trying to understand the "entries" column. I thought this was the number of times a given function is called. But "main" is nonrecursive, and only calls "step" (also nonrecursive) once. Where are the 92329 and 679 coming from? Am I mistakenly calling the functions more than I think I am? Thanks, Chad
"Scherrer, Chad" <Chad.Scherrer@pnl.gov> writes:
I'm trying to understand the "entries" column. I thought this was the number of times a given function is called. But "main" is nonrecursive,
I thought so, too. My guess would be that your program doesn't do quite what you think it does, or that our interpretation is wrong, or possibly that there is a bug in the profiling code. -k -- If I haven't seen further, it is by standing in the footprints of giants
"Scherrer, Chad" <Chad.Scherrer@pnl.gov> writes:
individual inherited COST CENTRE MODULE no. entries %time %alloc %time %alloc
MAIN MAIN 1 0 0.0 0.0 100.0 100.0 main Main 228 92329 0.2 0.9 99.8 99.8 step Main 259 679 38.4 26.6 56.6 39.2
I'm trying to understand the "entries" column. I thought this was the number of times a given function is called. But "main" is nonrecursive, and only calls "step" (also nonrecursive) once. Where are the 92329 and 679 coming from?
Perhaps these functions are split into smaller chunks by the compiler/optimiser? Then the profiler would aggregate the data for the individual chunks back up into the original cost centre. Regards, Malcolm
participants (3)
-
Ketil Malde -
Malcolm Wallace -
Scherrer, Chad