Hi Peter, Thnks for all the info. I have the following questions:- 1:Are both the sources of data viz profil and .mcount absolutely necessary for gprof to work properly or it can do with only mcount data. From code it looks like both are necessary and complement each other in producing data required by Gprof. Just want to double check with you. 2: I understand that gprof relies on instrumentation by way of inserting Mcount calls and sampling by way of profil call. What I want to know is that, is there an implementation of gprof or any other profiler for bsd or any unixes which relies on instrumentation only by inserting probes at the header and footer of the function ? Thanks Mayank -----Original Message----- From: Peter Jeremy [mailto:peterjeremy_at_optushome.com.au] Sent: Monday, February 19, 2007 1:48 PM To: Mayank Kumar Cc: freebsd-current_at_freebsd.org Subject: Re: Questio on Gprof [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 JeremyReceived on Mon Feb 19 2007 - 17:07:01 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:05 UTC