This repository has been archived by the owner on Dec 29, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 200
Make it possible to use colon ":" in Event names with cppbindings #581
Comments
Neat!
The hash mark syntax is a silly but from the WTF framework's JavaScript
origins. When I implemented the c++ version I didn't touch it even though
it felt weird.
We could either extend some things in the viewer to better support c++
native syntaxes (those strings just get passed through) and/or fix the
minimal parsing that the bindings do. I'll check when I get to my computer,
but if you want to look, the code that does the current string munging is
in event.cc. It's not sacred and can be changed in whatever way makes sense.
…On Feb 12, 2017 2:36 AM, "Ihor Ivlev" ***@***.***> wrote:
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.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#581>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AAeKgNmMdHXSyzAuph0jOa31qB5JpJo7ks5rbuC5gaJpZM4L-c23>
.
|
This is also an issue if you just want to use the built-in macro PRETTY_FUNCTION. :-( |
baxissimo
added a commit
to baxissimo/tracing-framework
that referenced
this issue
Oct 12, 2017
stellaraccident
pushed a commit
that referenced
this issue
Oct 12, 2017
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The text was updated successfully, but these errors were encountered: