This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gprof Observations


On Thu, Jul 03, 2003 at 06:03:21PM +0530, Bhattacharya, Soubhik wrote:

> 1. if a function `foo()' is not compiled with -pg then gprof fails to 
> determine the callers of and no. of calls to `foo()'. however, if 
> `foo()' runs long enuff then it reliably estimates its self-time.
> 
> 2. using -pg during linking ensures that the program is linked with a 
> special gprof specific start file. this is the minimum requirement for 
> gprof to be able to generate some useful information (a flat profile).

These are both clearly documented AFAIK.

> 3. gprof fails to gather profiling info (self-time, no. of calls, 
> calling functions) of a function residing in a shared object. any 
> suggestion? i searched the net to find a couple of mails on a similar 
> topic (http://mail.gnu.org/archive/html/bug-gnu-utils/2001-07/msg00284.html
> http://sources.redhat.com/ml/binutils/2003-03/msg00208.html), which, 
> sadly, went unanswered.

Use GNU libc's "sprof" (documented well enough if you google) or a more
complete solution like OProfile on Linux etc.

regards,
john


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]