-
Notifications
You must be signed in to change notification settings - Fork 7
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
Functions with same name in multiple compilation targets do not increase counters #28
Comments
Looks like stoat has no concept of multiple definitions of the same symbol in different RTLD_LOCAL contexts, and considers them to be the same function. And in my opinion, this is a good thing, and should stay that way. |
Stoat generally assumes that one function symbol name is associated with a single underlying C/C++ implementation. This approach is fairly useful in the case where a function may receive multiple definitions (e.g. static/local functions or template code definitions). As you can see the drawback exists when you have a variety of translation units (C/C++ source files) which build into multiple different libraries or executables. It is possible to get stoat to automatically recognize which LLVM bitcode files are associated with which binaries eventually, but for the moment the recommended course of action would be specifying the bitcode files yourself (e.g. stoat -r common-build-dir/ specific-plugin-file.bc ). (Notes for feature implementation)
|
I had a bit of a play with this from the perspective of compilation units (as opposed to targets): Building main with different sub implementations yields different results:
Don't know if my experimenting here is useful or annoying, but I thought the false positive might be of interest. |
I have some functions with the same name in multiple plugin-like .so files.
I annotated the first and it picked it up and reported a number of realtime functions, when the second was annotated that number did not change. Renaming the function caused the count to increase.
This may well be intentional (and my own fault for running across multiple targets), but I thought it might be worth asking about.
The text was updated successfully, but these errors were encountered: