gprof question

Dave Cottingham dcottingham00@comcast.net
Mon Apr 5 03:33:00 GMT 2004


In case anyone was wondering, I have figured out what causes gprof to
report a total cumulative time substantially shorter than the actual
total CPU time.  The histogram counters are unsigned shorts, so if you
get more than 2^16 hits in one or more counters, they wrap, and hence
the total cumulative time reported by gprof comes up short.

 - Dave Cottingham

On Tue, 2004-03-30 at 21:52, Dave Cottingham wrote:
> On Mon, 2004-03-29 at 03:07, Segher Boessenkool wrote:
> > > [Actually, I wrote this first part:]
> > > What does it mean when the total CPU time reported by gprof is quite
> > > different from the total CPU time measured by the operating system?
> > >
> > > Or does this just tell us that 90% of the time was spend in library
> > > routines and is therefore off the books?
> > 
> > Most likely, yes.
> > 
> > Link your program statically to get better results.
> 
> Thanks, this made a big improvement.  But there's still a lot of time
> not accounted for.  Now I get 1825 seconds as the total cumulative time
> in the gprof report (in the flat profile), but using "set time=1" tells
> me that the program used 6647 seconds of user time.  So 73% of the time
> is still missing somewhere.  Any ideas how I can figure out where that
> time is going?
> 
> Again, this is binutils 2.13.90.0.2, gcc 3.2, Redhat 8.0.  Any hints
> will be gratefully received.
> 
>  - Dave Cottingham
> 
> 




More information about the Binutils mailing list