[lttng-dev] gcc plugin for instrumenting individual functions

Christophe Bédard bedard.christophe at gmail.com
Mon Jul 29 14:56:15 EDT 2019


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.lttng.org/pipermail/lttng-dev/attachments/20190729/b4c158e5/attachment.html>


More information about the lttng-dev mailing list