-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Try to demangle C++ symbols #638
Conversation
def _demangle(name): | ||
if name not in BPF._demangle_caches: | ||
try: | ||
pipe = subprocess.Popen( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice and useful, but can we do it on c++ side just calling a function instead of a process from python?
Do the demangling in C++ side instead. |
bool res = mod.find_addr(addr, sym); | ||
if (sym->name) { | ||
sym->demangle_name = abi::__cxa_demangle( | ||
sym->name, nullptr, nullptr, nullptr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the coding style looks a bit odd... why not in the same line? other than that it looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have hard 80-char limit marker on my editor :P
LGTM |
@@ -101,6 +101,7 @@ void perf_reader_set_fd(struct perf_reader *reader, int fd); | |||
ffi.cdef[[ | |||
struct bcc_symbol { | |||
const char *name; | |||
const char *demangle_name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indentation :)
As far as I can tell you also need to change Line 28 in d516406
|
Also thanks for doings this :) |
Thanks @markdrayton! Changed according to comment. Didn't locally verify Lua builds though, hoping the tests would cover:) |
can you please squash all of the commits into one? |
Added a field `demangle_name` in the `bcc_symbol` struct. Calculate its value whenever possible. For C++ programs, this would make outputted stack traces look nicer. Example: http:https://pastebin.com/LqT0nP67
Done:) |
Thanks! |
Added a field `demangle_name` in the `bcc_symbol` struct. Calculate its value whenever possible. For C++ programs, this would make outputted stack traces look nicer. Example: http:https://pastebin.com/LqT0nP67
For C++ programs, this would make outputted stack traces look nicer.
Example: http:https://pastebin.com/LqT0nP67