This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: gprof Observations
- From: "Bhattacharya, Soubhik" <soubhik_bhattacharya at mentorg dot com>
- To: John Levon <levon at movementarian dot org>
- Cc: "Bhattacharya, Soubhik" <soubhik_bhattacharya at mentor dot com>, binutils at sources dot redhat dot com
- Date: Fri, 04 Jul 2003 17:51:18 +0530
- Subject: Re: gprof Observations
- Organization: Mentor Graphics
- References: <3F042291.4010403@mentorg.com> <20030703142736.GB92411@compsoc.man.ac.uk>
John Levon 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.
well, these observations are not novel, in the sense that they can be
derived from whatever is written in the `gprof' documentation. but i
still find one-line summaries useful, as they save the time spent
groping around the manual, and using reasoning to draw a conclusion.
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.
thanks for the pointers. i'm reading your "Profiling in Linux HOWTO" and
looking forward to using OProfile soon.
Regards,
Soubhik.
--
-0-1-2-3-4-5-6-7-8-9-0-1-2-3-4-5-6-7
Soubhik Bhattacharya
Member Technical Staff
Mentor Graphics
Hyderabad, India.
-0-1-2-3-4-5-6-7-8-9-0-1-2-3-4-5-6-7