gprof question

Frank Ch. Eigler fche@redhat.com
Mon Apr 5 17:50:00 GMT 2004


Dave Cottingham <dcottingham00@comcast.net> writes:

> 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.

This is an ironic place where this historical kernel system call can
come up short compared to an unconstrained implementation.  In
simulators (e.g. sid) it is not a problem to widen the counters.
Because the gmon.out format permits this, they can write out as many
consecutive histogram tables as needed to represent larger values.
gprof itself can correctly digest larger values when stored this way.


- FChE



More information about the Binutils mailing list