Profiling w/ -pg and gprof

Jeff Warner jeff.warner@trw.com
Fri Oct 1 00:00:00 GMT 1999


I have compiled a program with -pg, run the program and successfully
collected information (gmon.out) and ran gprof. 

The program ran for about 518 CPU seconds, .5 system seconds and yet
the profiler shows: 

-----------------------------
-----------------------------
-----------------------------
granularity: each sample hit covers 4 byte(s) for 0.00% of 202.24 seconds

                                  called/total       parents 
index  %time    self descendents  called+self    name           index
                                  called/total       children

                0.00      201.74       1/1           _start [2]
[1]     99.8    0.00      201.74       1         main [1]
                0.00      201.74       1/1           drtests(void) [3]
                                                     [drtests__Fv]
                0.00        0.00       1/925546      _._24variables_scope_helper_t [141]
                0.00        0.00       1/1           exitM(void) [432]
                                                     [exitM__Fv]
                0.00        0.00       1/116152866     _._t1M1Zd [15]
                0.00        0.00       1/925546      variables_scope_helper_t [203]
                                                     [__24variables_scope_helper_t]
                0.00        0.00       1/1           initM(int) [489]
                                                     [initM__Fi]

-----------------------------
-----------------------------
-----------------------------


Only 202 seconds?  Any ideas why?  

Also, is the 0.00% a problem in the granularity field?  Could someone
explain this line to me, I've searched though all the docs I can find
and still haven't found a good explaination.

I have used the -pg on the compile line and the g++ link line.  My
libraries are compiled with the -pg option.  I'm using the gcc2.8.1
and the gprof that comes with SunOS 5.5.1.  I've also looked for
profiling libraries with the gcc2.8.1 and couldn't find any libraries
with different/similar names to the standard ones.  Is that why I'm
missing time?

Thanks for the help

Jeff Warner
mailto:jeff.warner@trw.com

-- 
Jeff Warner
----------------------------------------------
These are ideas of my OWN, not TRW's


More information about the Gcc-help mailing list