-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add support for C++ mangled symbols in uprobe names #687 #1116
Conversation
e28ad2c
to
34fad0e
Compare
Haven't looked too closely at the code yet, but I like this feature. One thought: should we make |
I think that's a good idea... Maybe Something like:
Another option would be to use |
721017b
to
47d486e
Compare
I think the default behavior should be that listing uprobes this way should print demangled by default, as we also want to be able to have the list and attach syntax be consistent. (echoing what I said on #687 ) Thanks for doing this @caringi |
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 approach! This will be very useful
Allow to specify uprobe names using demangled C++ format (this is done with the help of abi::__cxa_demangle() function). Example: $ nm -g a.out |grep foo 0000000000401151 T _Z3fooi 0000000000401146 T _Z3foov $ nm -g --demangle a.out |grep foo 0000000000401151 T foo(int) 0000000000401146 T foo() $ bpftrace -e 'uprobe:./a.out:foo {printf("ok\n");}' Attaching 2 probes... ^C $ bpftrace -e 'uprobe:./a.out:"foo()" {printf("ok\n");}' Attaching 1 probe... ^C
47d486e
to
ebc47ac
Compare
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.
Looks good to me. Is it still a RFC or ok to merge?
I've added the RFC prefix to emphasize I needed feedback... I think it's ok to merge it... |
this is awesome @caringi i think this is ok to merge! |
Allow to specify uprobe names using demangled C++ format (this is done
with the help of abi::__cxa_demangle() function).
Example:
$ nm -g a.out |grep foo
0000000000401151 T _Z3fooi
0000000000401146 T _Z3foov
$ nm -g --demangle a.out |grep foo
0000000000401151 T foo(int)
0000000000401146 T foo()
$ bpftrace -e 'uprobe:./a.out:foo {printf("ok\n");}'
Attaching 2 probes...
^C
$ bpftrace -e 'uprobe:./a.out:"foo()" {printf("ok\n");}'
Attaching 1 probe...
^C