gprof reports wrong execution times

Nick Clifton nickc@redhat.com
Thu Sep 15 10:06:00 GMT 2016


Hi Anton,

> This  is  the correct and expected behavior, because
> the man page says:
> 
>    The granularity of the sampling is  shown,  but  re-
>    mains  statistical at best.  We assume that the time
>    for each execution of a function can be expressed by
>    the  total time for the function divided by the num-
>    ber of times the function is called.  Thus the  time
>    propagated  along  the  call graph arcs to the func-
>    tion's parents is directly proportional to the  num-
>    ber of times that arc is traversed.

Right.  See also the "Inaccuracy of gprof Output" chapter in the gprof documentation.

Cheers
  Nick



More information about the Binutils mailing list