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 - output


Does gprof list the time taken by the std::string functions?. I have
profiled another program which also lists "basic_string::replace"
"basic_string::compare" "stringbuf::overflow" which I assume are the
basic string functions. If testStr does most of the work by calling
std::string functions the above functions should have been listed?.
Infact I have profiles of other programs which list the basic string
functions accounting for more than 40% of the execution time. Why does
this profile not list any such std:string functions?. Here is the
complete profile of all the functions listed. If I am not wrong,
_GLOBAL_I_ti and _static_initialization_and_destruction_0 are standard
functions called for every program.

Each sample counts as 0.01 seconds.
   %   cumulative   self              self     total
  time   seconds   seconds    calls  ms/call  ms/call  name
77.04      6.04     6.04      100    60.40    60.40  testChar() 
22.96      7.84     1.80      100    18.00    18.00  testStr()
 0.00     3.15    0.00       1     0.00    0.00  _GLOBAL__I_ti
 0.00     3.15    0.00       1     0.00    0.00 
__static_initialization_and_destruction_0(int, int)


regards,

Rajesh
On Tue, 2004-03-30 at 04:42, Segher Boessenkool wrote:
> > You are reading the results incorrectly.  Your use of clock is
> > measuring what the gprof output describes as "cumulative seconds".
> 
> Actually, "cumulative seconds" is just the time taken by a function
> (without its kids!) and all functions that took longer (are above it
> in the table), added together.
> 
> Pretty useless, unless you want to see something like "what is the
> minimum number of functions that together make up for 50% of
> execution time".  If it's a lot of-em, you'll have a hard time
> getting the program to run significantly faster ;-)
> 
> 
> Segher
-- 
Rajesh V Munavalli
Computer Science and Mathematics Division
Oak Ridge National Laboratory
P.O.Box 2008 - 1 Bethel Valley Road
Bldg. 5700 - Room R-G216
Oak Ridge TN 37831-6414 USA
Phone: 865-576-6205
Email: munavallirv@ornl.gov

"There are only 10 kinds of people in this world. Those who understand
binary, and those who dont !"


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