profiling API?

Nick Clifton nickc@redhat.com
Thu Mar 13 17:49:00 GMT 2003


Hi William,

> 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. :-(

> Being able to get the output at arbitrary times (eg on
> receipt of a signal) would be sufficient, but it would be even
> better if the program could control its own profiling.

You can compile only certain files with profiling enabled.  That way
you will only generate profile information for the functions in those
files, (plus any functions that they call...)

You might also consider using the -finstrument-functions command line
switch and writing your own profiling tools.

Cheers
        Nick



More information about the Binutils mailing list