5.4R - gcc/gprof profile not showing %time information

Mark Kirkwood markir at paradise.net.nz
Tue Jun 7 10:23:21 GMT 2005


I profiled a program today, and discovered that the end result seems to 
be missing information in the '%time' column - it is always zero. Has 
something changed with respect to obtaining a profile?

Any suggestions welcome :-)

A simple example follows...

$ gcc -g -pg -o test test.c
$ ./test
$ gprof ./test test.gmon> test.gprof


test.c:

int
main() {

         int     i;
         for (i=0;i<1000000;i++) {
         }
         return 0;
}


test.gprof:


   %   cumulative   self              self     total
  time   seconds   seconds    calls  ms/call  ms/call  name
   0.0       0.00     0.00        1     0.00     0.00  __cxa_finalize [236]
   0.0       0.00     0.00        1     0.00     0.00  __sys___sysctl [237]
   0.0       0.00     0.00        1     0.00     0.00  _mcleanup (238)
   0.0       0.00     0.00        1     0.00     0.00  _profil [239]
   0.0       0.00     0.00        1     0.00     0.00  exit [1]
   0.0       0.00     0.00        1     0.00     0.00  moncontrol [2]
   0.0       0.00     0.00        1     0.00     0.00  sysctl [3]

Index by function name

  [236] __cxa_finalize      [239] _profil               [3] sysctl
  [237] __sys___sysctl        [1] exit
  (238) _mcleanup             [2] moncontrol


regards

Mark


More information about the freebsd-stable mailing list