Stream: git-wasmtime

Topic: wasmtime / issue #7669 Annotate guest profiler stack fram...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2023 at 01:24):

jameysharp added the wasmtime label to Issue #7669.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2023 at 01:24):

jameysharp added the enhancement label to Issue #7669.

view this post on Zulip Wasmtime GitHub notifications bot (Dec 09 2023 at 01:24):

jameysharp opened issue #7669:

Feature

So far usually a guest has consisted of only one core WebAssembly module, but with the component model on its way, that's changing. For each stack frame in a profile, the guest profiler should indicate which module that frame's function came from. If the same module is instantiated multiple times, ideally the profile would also report which instance was running.

Benefit

In multi-module guests, seeing only a function name is confusing. Including the module identity will help the user understand which part of their code is running.

Implementation

I'm not sure how to identify a module in a human-meaningful way. I'm not sure if modules have useful names inside components, or how to find those names if they exist. Similarly I don't think instances have an identity that we can find while stack-walking or that means anything to the user; I believe this is an open issue for our core-dump support as well.

Alternatives

We could continue to make the user guess which module each frame is from. In many cases probably the important function names are unique across modules anyway. For the moment, while multi-module guests remain unusual, the _status quo_ is probably fine.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 27 2025 at 23:26):

posborne commented on issue #7669:

As part of the work for #8773 I think we'll end up getting this as well; I'll need to go through some refining for how I'm going about this, but it generally seems to work. This is with components and for this first pass I'm looking at each of the modules with text include pc and then finding the first one that has a func including pc which appears to work well but, I think, could be wrong in cases of code sharing.

![Image](https://github.com/user-attachments/assets/69cb7646-a66d-450f-afa1-84256394d4dd)

view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2025 at 23:50):

sunfishcode closed issue #7669:

Feature

So far usually a guest has consisted of only one core WebAssembly module, but with the component model on its way, that's changing. For each stack frame in a profile, the guest profiler should indicate which module that frame's function came from. If the same module is instantiated multiple times, ideally the profile would also report which instance was running.

Benefit

In multi-module guests, seeing only a function name is confusing. Including the module identity will help the user understand which part of their code is running.

Implementation

I'm not sure how to identify a module in a human-meaningful way. I'm not sure if modules have useful names inside components, or how to find those names if they exist. Similarly I don't think instances have an identity that we can find while stack-walking or that means anything to the user; I believe this is an open issue for our core-dump support as well.

Alternatives

We could continue to make the user guess which module each frame is from. In many cases probably the important function names are unique across modules anyway. For the moment, while multi-module guests remain unusual, the _status quo_ is probably fine.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 02 2025 at 23:50):

sunfishcode commented on issue #7669:

This is now implemented in #10507. @posborne mentioned to me that there are ways we could improve it further, but we can file separate issues as needed.


Last updated: Apr 17 2025 at 18:04 UTC