gprof

gprof

Post by Bob van der Poe » Thu, 19 Mar 1998 04:00:00



Does gprof work? I am trying to optimize a program I wrote and compiled
2 modules with the -pg option and linked that way as well. The program
creates a gmon.out file.

If I try gprof 'program' I get an immediate core dump.

My gprof is version 2.7.1 from the Slackware 3.2 distribution.

--
   __
  /  )      /         Bob van der Poel

/___/_(_) /_)         http://www.kootenay.com/~bvdpoel

 
 
 

1. gprof: what are "mcount" and "init_dummy"?

I'm running gprof on a C++ program of mine that makes extensive use of
the standard template library.  gprof tells me that most of the CPU time
is consumed by routines called "mcount" and "init_dummy", neither of
which is in my program or in libc.a.  In fact, init_dummy is defined in
crtbegin.o, and I haven't yet found where mcount is defined.

What does this mean?  I'm guessing that gprof is simply incorrect in
claiming that the CPU time is consumed by these routines.  But where is
all that CPU time being consumed?  Naturally I'd like to eliminate it....

Here's the first few lines of my gprof output:

Flat profile:

Each sample counts as 0.01 seconds.
  %   cumulative   self              self     total          
 time   seconds   seconds    calls  ms/call  ms/call  name    
 36.74     10.52    10.52                             mcount
 24.76     17.61     7.09 366298173     0.00     0.00  init_dummy
 24.69     24.68     7.07   546480     0.01     0.02  Cov_accumulator::n_els_rec
t(FeatureMap const &, int, int, int, int)
  9.54     27.41     2.73     2484     1.10     1.58  Cov_accumulator::update_Su
m_ab(FeatureMap const &, FeatureMap const &)
        etc.

Thanks for any advice or help.

--
Gary Holt                       (213)-740-3397

2. make config ERROR

3. Problem with gprof

4. Unable to resolve names on dial up ppp

5. a better gprof?

6. cannot install LILO, cannot boot

7. gprof?

8. Printing to Network Printer from COL 1.3

9. gprof: gmon.out has not been created

10. Looking for profiler other than gprof

11. Reg gprof command -c option??

12. HP-UX 10.2 Trying to use gprof with C++ - No Luck!

13. Trying to gprof a slowdown in using matlab API