This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gprof question
- From: Dave Cottingham <dcottingham00 at comcast dot net>
- To: binutils at sources dot redhat dot com
- Date: 04 Apr 2004 23:33:56 -0400
- Subject: Re: gprof question
- References: <1080489269.11227.641.camel@dcottingham.erols.com> <1E08D5F4-8158-11D8-BC8C-000A95A4DC02@kernel.crashing.org> <1080701576.1344.22.camel@dcottingham.erols.com>
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
>
>