This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: GProf's sampling inaccuracies
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Angus <angus at uducat dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 20 Jun 2007 17:54:13 +0200
- Subject: Re: GProf's sampling inaccuracies
- References: <200706191114.47328.angus@uducat.com>
I'm profiling my C++ program and there are results that don't make a
lot of
sense to me. It seems that some functions are taking much more time
than they
look like they should. The best example is this one that does only one
thing,
and that thing is an integer compare. Using different data, I can get
the
flat profile to consistently report an average of about 275 self
nanoseconds
per call. All that time just to compare two integers?
Use -pg only in the final link, so you don't get mcount()
implanted into every function. You won't have a call count
or a call graph, but you do get a much more accurate time
profile in return.
Segher