This is the mail archive of the binutils@sourceware.org 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: Basic block profiling info for gprof


Hi Mohamed,

What information does it produce ?
For gprof -i

File `gmon.out' (version 1) contains:
       1 histogram record
       1 call-graph record
       0 basic-block count records

Hmm, yes it appears the glibc's profiling output no longer includes basic-block counts.


          1 ->          c = crc;
          1 ->          if (n) do {
          1 ->              c = 0xfff + n;
          1 ->          } while (--n);

Quick note - with optimization turned on this do-while loop will disappear, since the computation of the value of "c" can be moved outside of the loop.


It appears that if you want basic-block profiling you now have to use the gcov tool, like this:

  % gcc --coverage 1.c
  % ./a.out
  % gcov 1.c
File 'gprof.c'
Lines executed:93.33% of 15
gprof.c:creating 'gprof.c.gcov'

  % cat 1.c.gcov
  ...
        1:   12:    c = crc;
        1:   13:    if (n) do {
        4:   14:        c = 0xfff + n;
        4:   15:      } while (--n);
  ...

The gprof manual should be updated to reflect this...

Cheers
  Nick


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