gcc source to instruct gprof to report block times?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Is there a # or other directive in gcc that signals
gprof to sum and report the times for a block of lines
within a function?

That is, put something like this in the source code:

#define gprof_block block1
/* many many lines of C code */
#undef  gprof_block

#define gprof_block block2
/* many many lines of C code */
#undef  gprof_block

compile with -pg, run gprof, and then output of gprof
would then have entries for block1 and block2,
showing how much time was spent in each block of lines?

When there are a couple of hundred lines per block
it can be difficult to figure out how much total time is spent
in logical block 1 vs. logical block 2, since the only method
provided seems to be to add up the times for all the lines
in each block.  Doing that seems a sure way to end up with
unreliable numbers due to rounding and truncation errors.

Thanks,

David Mathog
mathog@xxxxxxxxxxx
Manager, Sequence Analysis Facility, Biology Division, Caltech

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux