Hi,

Sharing this just in case it can help someone!

gcc only lets you disable instrumentation, using the `no_instrument_function` attribute, or by matching file names. It does not let you explicitly choose the individual functions you want to instrument.

I've searched many times for a way to do it, but never found anything for some reason, so I wrote this plugin: https://github.com/christophebedard/instrument-attribute-gcc-plugin

It simply enables instrumentation for functions with the `instrument_function` attribute, and disables instrumentation for all other functions.


Christophe