Hi Kalle, [I am very sorry about taking so long to reply to your email].
"By contrast, the number-of-calls and basic-block figures are derived by counting, not sampling. They are completely accurate and will not vary from run to run if your program is deterministic." In one series of three 95-minute runs, gprof showed that one function had been called 1858749793, 1858746382, and 1858740724 times. The variation there was 0.0005%; not much, but anyway it made me think there was something unexpectedly random going on with my algorithms.
Therefore, I just ask that you update that gprof documentation to warn about this issue.
How do you feel about the attached patch to update the documentation ? Cheers Nick
Index: gprof/gprof.texi =================================================================== RCS file: /cvs/src/src/gprof/gprof.texi,v retrieving revision 1.30 diff -c -3 -p -r1.30 gprof.texi *** gprof/gprof.texi 12 Jun 2009 15:33:30 -0000 1.30 --- gprof/gprof.texi 26 May 2010 14:56:26 -0000 *************** only a small amount of time, so that on *** 1613,1622 **** ought to catch that function in the act only once, there is a pretty good chance it will actually find that function zero times, or twice. ! By contrast, the number-of-calls and basic-block figures ! are derived by counting, not ! sampling. They are completely accurate and will not vary from run to run ! if your program is deterministic. The @dfn{sampling period} that is printed at the beginning of the flat profile says how often samples are taken. The rule of thumb is that a --- 1613,1624 ---- ought to catch that function in the act only once, there is a pretty good chance it will actually find that function zero times, or twice. ! By contrast, the number-of-calls and basic-block figures are derived ! by counting, not sampling. They are completely accurate and will not ! vary from run to run if your program is deterministic and single ! threaded. In multi-threaded applications the counts are only ! deterministic if the counting function is thread-safe. ! @xref{Implementation, ,Implementation of Profiling}. The @dfn{sampling period} that is printed at the beginning of the flat profile says how often samples are taken. The rule of thumb is that a
_______________________________________________ bug-binutils mailing list bug-binutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-binutils