Re: Questio on Gprof

From: Peter Jeremy <peterjeremy_at_optushome.com.au>
Date: Mon, 19 Feb 2007 19:17:35 +1100
[Please wrap your lines before 80 columns]

On 2007-Feb-18 22:08:17 +0800, Mayank Kumar <mayank_at_microsoft.com> wrote:
>I want to know if gprof's profling is solely dependent on the system
>call profil() or are there other implementations of gprof which do
>not depend on this system call.

gprof has two sources of data: Firstly sampling information giving
number of hits by text address.  This information is collected by the
kernel - profil() just tells the kernel where to store the profiling
samples.  The second source is caller/callee counts collected by
.mcount in userland.

I am unaware of any alternative to profil() - in theory, it could
be implemented in userland but the overheads would be extremely high.

>Also is there a profiler available for freebsd or any unix system
>which is based on instrumentation rather then sampling.

gprof relies on both instrumentatin and sampling.  An alternative
would be gcov - though it reports line counts rather than execution
time statistics.

-- 
Peter Jeremy

Received on Mon Feb 19 2007 - 07:17:37 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:05 UTC