-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support targeting function declarations/headers with -fplugin-arg-instrument_attribute-include-file-list #23
Comments
We need to register a callback with However, even if the instrumentation gets enabled following a match with a function declaration in a header file, when the function definition gets processed, instrumentation will be disabled unless there is also a match. For example, this means that we would need to either just use We would need a separate flag or way to know that we have already decided to instrumentation a given function so that we don't disable the instrumentation later on. There might be a way to keep track of this using some sort of hash table, but it starts getting weird a bit and would probably affect performance. |
Until a proper solution is found, this should be properly documented in the README. |
Currently, it seems that providing a (partial) path to header files, i.e. files with function declarations, as opposed to definitions, with
-fplugin-arg-instrument_attribute-include-file-list
doesn't work. We need to point to files with function definitions instead (i.e. source files).This is probably due to these lines:
instrument-attribute-gcc-plugin/src/instrument_attribute.c
Lines 127 to 128 in 546adcd
One would think that
FUNCTION_DECL
refers to the function declaration, but I guess not. I've been looking at the gcc plugin headers, but I don't know most of the terminology.The text was updated successfully, but these errors were encountered: