Disable profiling on certain function and all its descendants

Is it possible preferably with a function attribute to disable profiling on a certain function? I want to do this because I need to profile the time spent in multithreaded parts of a program. I do not care about the details of the particular threads, just the amount of time spent in the whole batch.

Timegraph:

                  +--------------------------------+
                  +--------------------------------+
---Main thread----+ Main thread waits for workers  +----Main thread continues-----
                  +--------------------------------+
                  +--------------------------------+
                 t0                                t1

I want the profile output to correctly measure t1-t0, and the number of calls to the batch, but mcount is not threadsafe, so the stuff that runs in parallel must be excluded somehow.

Valgrind is no go since physical bus speed is main concern.


Source: gcc

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.