I wonder if there's any API within gprof
to enable and disable profiling at runtime by the monitored application. I'm interested on disabling the profiling of certain parts of the code and enabling it to focus on those that are interesting to me. I mean, is there a way to avoid do this?
int main (void)
{
// disable gprof ?
uninteresting_routine();
// enable gprof ?
interesting_routine();
}
This link from the GCC website referring the instrumentation options does not seem to include any reference to this functionality.