-
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
Demangle symbol names in guest-profiler output #7665
Comments
Hi @jameysharp, I'd like to pick this up. |
Awesome! After I wrote this I've noticed that some people are already getting demangled names in guest-profiler output, which is confusing me. That makes me think that there may have been a Rust toolchain change to how symbol names are emitted in WebAssembly target builds. So it might not be necessary to do this if toolchain developers are doing it for us. But I haven't looked into that yet to find out if this is a trend or something. So there are two ways you could help here:
I'd appreciate your help with either or both of these things! |
Hi @jameysharp , I have finished the first thing you memtioned. Can you help review the pr? |
Hi, I'm seeing an unexpected behaviour that seems related to this issue. After upgrading from
Before the upgrade
Should I open a new issue for this case? |
Addresses a [comment brought up][1] about how the support regressed when it was moved behind a Cargo feature a bit ago. [1]: bytecodealliance#7665 (comment)
@casimiro yes if you can open a new issue for that, that'd be appreciated! (this one's about the guest profiler not the C API). That being said around that time we moved the demangling bits behind a Cargo feature and I suspect we forgot to turn that on for the C API, so I proposed #7962 to enable it by default again. |
Addresses a [comment brought up][1] about how the support regressed when it was moved behind a Cargo feature a bit ago. [1]: #7665 (comment)
Hi, i am currently reviewing easy issues and found this one. Seems like, that this issue is already implemented? Should it be closed in that case? |
I believe so yeah, thanks for the ping! |
Feature
The
GuestProfiler
, as invoked by its Rust API or with the Wasmtime CLI's--profile=guest
flag, should try to demangle C++ and Rust function names before emitting them in the generated profile.Benefit
It'd be nicer to see names like
std::rt::lang_start::{{closure}}::ha2ad3bd729827662
than like_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17ha2ad3bd729827662E.llvm.16041094552022133104
.Implementation
There's existing code in Wasmtime for demangling names in stack traces, in
crates/wasmtime/src/trap.rs
. But that's bypassed by the low-level way that the guest profiler collects stack traces. Instead, the guest profiler gets all the function names up front, in themodule_symbols
function incrates/wasmtime/src/profiling.rs
, and it should demangle the names there.Alternatives
There might be support in the https://profiler.firefox.com/ frontend for demangling names.
The text was updated successfully, but these errors were encountered: