Compiler-generated static symbols, such as the global initializers, can shared the same name and can coexist in the binary. As a result, their pseudo probes are all kept in the binary too. This could cause multiple call probes decoded against one callsite, as probes are decoded against there owning functions by name. I'm temporarily disabling an assert to keep the debug build green until we have a better fix.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Due to the the way .pseudo_probe section is decoded, probes of the same-named independent static functions are merged
Is this because dwarf based name (the container for probes) doesn't have the concept of static function and all functions are keyed on names (TopLevelProbeFrameMap), so we can't differentiate static functions of the same name?
I might misunderstand it initially, but this seems like a flaw we should try to fix? Two static functions can be completely different, and we need to have the capability to differentiate them..
In this case the linkage names are also the same. Those functions are global ctors which bypass the unique linkage phase and end up same-named.
I might misunderstand it initially, but this seems like a flaw we should try to fix? Two static functions can be completely different, and we need to have the capability to differentiate them..
User static functions has no such problem since they have unique linkage names for both elf and dwarf. It only happens to compiler-generated functions such as global ctors. Those functions are usually not hot functions. I'm not sure they are worth being fixed.
Ok, can you update the comment to explicit mention compiler generated static functions? also mention that user defined static functions are fine. Otherwise LGTM.