profiling API?

Frank Ch. Eigler fche@redhat.com
Thu Mar 13 20:28:00 GMT 2003
nickc wrote:

> > I'd like to profile small(ish) portions of the execution of a
> > program rather than the whole thing as it has a few behaviour phase
> > changes and I want to profile one mode.
> > 
> > Is there any way to get multiple gmon.out files for a given
> > execution?
> 
> No. :-(
> [...]

Depending on the details of your particular gprof runtime, a program
might be able to call a sequence like the following to get multiple
cumulative profile snapshots:

     _mcleanup ();  /* suspend profiling, write gmon.out */
     rename ("gmon.out", "gmon.out.NNN" );
     moncontrol (1); /* resume profiling */

- FChE



More information about the Binutils mailing list