-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Support DWARF for uprobes. #1803
Comments
Currently bcc does not read dwarf data, hence it not able to match local variables vs. registers.
If you can look at dwarf itself to figure out the register <-> local_variable relation, you can use this feature. |
The same for uprobe, bcc does not read dwarf data.... |
Although BCC does not read DWARF data:
Neither of them are ideal, but should unblock you for now |
Thanks for hints - what I'm after is traversing a pretty big structure - http://lxr.nginx.org/source/src/http/ngx_http_request.h#0371 , which consists of other big structs, which are made of other structs and typedefs etc... (so few hundred lines + dependency hell to get it right by hand) - for now I'm trying to extract this using gdb and include in by bcc tool - but it seems very counter productive. |
Do we have any external tool to give such information (at a particular insn, the register corresponding to which variable)? |
Perf is able to do this with uprobes when binary has dwarf, for example :
|
Are the output from this command enough?
|
iovisor/bcc#1803 Signed-off-by: Marek Kroemeke <mkroemeke@cloudflare.com>
I've made a PoC that uses pyelftools library to parse the DWARF data, then it patches the probe C code offsets using jinja2 templating in python (only struct members for now as this is PoC only). This is very slow, first iteration ugly code - just to see if this is feasable - seems to work. https://github.com/kroemeke/bcc_dwarf_poc |
@kroemeke Thanks! This is a very useful demonstration. I guess more complex use cases, e.g., print out local variable at a particular line, may need more human intervention. |
Hello,
Is there a way to read the type definition / structs etc from DWARF data of the binary itself ? This is how it works with perf probe - where it seems to transparently have all required definitions.
Thanks,
Marek
The text was updated successfully, but these errors were encountered: