Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Make it possible to use colon ":" in Event names with cppbindings #581

Open
vertexodessa opened this issue Feb 12, 2017 · 2 comments
Open

Comments

@vertexodessa
Copy link
Contributor

I'm trying to implement a method to automatically instrument and trace C++ programs.
For this, I'm using -finstrument-functions GCC flag which generates additional function calls during every function entry or exit.
Also libunwind is used to automatically resolve function pointers to function names and use them to create scoped events.
For details please see https://github.com/vertexodessa/iitracer.

The problem is, that libunwind resolves C++ class methods naturally (after demangling), thus they may contain "::" as a class/method separator.

In Web Tracing Framework cppbindings, colon is used as internal separator for name and arguments:
https://github.com/google/tracing-framework/blob/master/bindings/cpp/event.cc#L54
However full names of C++ class functions are using colon as a natural C++ separator, thus creating scoped event WTF_SCOPE0("A::A()") will emit event named "A", which is not intended.

I could work it around by replacing ":" to "#" in demangled functions' names, however fixing this on cppbindings' level feels like a more natural solution.

@stellaraccident
Copy link

stellaraccident commented Feb 13, 2017 via email

@baxissimo
Copy link
Contributor

This is also an issue if you just want to use the built-in macro PRETTY_FUNCTION. :-(
It gives you the name with :: separators too.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants