This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Gprof can account for less than 1/3 of execution time?!?!
- From: Jon Turner <jon dot turner at wustl dot edu>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 21 Feb 2010 12:27:04 -0600
- Subject: Gprof can account for less than 1/3 of execution time?!?!
I have recently encountered a gross inaccuracy in gprof that
I can't explain. Yes, I know gprof uses a sampling technique
so I should not expect a high level of precision, but the results
I am getting clearly reflect a more fundamental issue.
The program in question has been compiled with -pg for all
source code files. The time command reports 20 seconds of user
time (which is consistent with personal observation) but
the gprof output accounts for only about 6 seconds of the
execution time. I have eliminated all IO from the program,
and the results remain consistent.
Gprof is sampling the program every 10 ms, so in the observed
20 seconds of execution time, it should be taking 2000 samples,
which should be enough to avoid any grows inconsistencies.
Any ideas would be appreciated.
Jon