Skip to content
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

DWARF symbols not captured for Rust library #883

Closed
burgerindividual opened this issue Feb 1, 2024 · 3 comments
Closed

DWARF symbols not captured for Rust library #883

burgerindividual opened this issue Feb 1, 2024 · 3 comments
Labels

Comments

@burgerindividual
Copy link

I have a rust library compiled with dwarf symbols included, but asprof doesn't seem to be able to read them. On the other hand, perf seems to be able to read them just fine.

perf record -a -F 997 -p $(pgrep -n -x java) --call-graph dwarf -- sleep 5 output rendered in speedscope
image
asprof -e cpu --cstack dwarf -i 997 -d 5 -o collapsed -t -s $(pgrep -n -x java) output rendered in speedscope
image

Here is the library .so for further inspection: link

Here is the collapsed stack output for further inspection: link

@apangin
Copy link
Collaborator

apangin commented Feb 1, 2024

Async-profiler gets symbols from .symtab section, whether embedded in a shared library or located in a separate debuginfo file. Async-profiler does not parse .debug_* sections.

In your case, libsodium_core.so has a trimmed symbol table: check

nm libsodium_core.so

Therefore, async-profiler shows only limited symbolic information.

@apangin
Copy link
Collaborator

apangin commented Feb 7, 2024

Please check your compilation options to make sure binaries include a meaningful symbol table (.symtab section).
Parsing extended debug information is out of project scope at this point (unless someone wants to contribute that to async-profiler).

@apangin apangin closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2024
@burgerindividual
Copy link
Author

I don't think using .symtab in this case can work ever, as all of the methods seen in the prof screenshot that aren't in the asprof screenshot are inlined. I think this is probably a reasonable restriction, as it looks like it would be very difficult to obtain the inline method information without effectively using a full DWARF parser, or somehow obtaining that information though a tool that can parse them, like prof. It may make sense to document this behavior in the wiki, though.

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

No branches or pull requests

2 participants