This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Odd profiler behaviour (gcc -pg/gprof)
- From: Nikhil Nair <nnair at pobox dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 23 Jan 2013 23:56:28 +0000 (GMT)
- Subject: Odd profiler behaviour (gcc -pg/gprof)
HI there,
I'm using a current version of Ubuntu server, with gcc 4.6.3 and gprof
2.22. I've been getting decidedly odd results in profiling a program; I'm
new to profiling, but I've looked at the info documentation, and this
doesn't seem to be mentioned.
The issue is that most of the execution time seems to be missing. I've
installed the libc-prof package to give me profiling libraries; I've used
-pg for both compiling and linking, and tried leaving out optimizations.
No change.
The program runs for over a minute, and (according to /usr/bin/time) is
roughly divided 50/50 between user and system, and running at 99% CPU.
However, the total CPU time reported in the flat profile is less than 10
seconds. Also, there's no mention of system calls (I use fread() quite a
bit, and would have thought that, or one of the related primitives, would
be mentioned somewhere...).
Am I missing something blindingly obvious, here? Any hints much
appreciated!
Thanks, and best wishes,
Nikhil.