Stream: git-wasmtime

Topic: wasmtime / issue #8773 Support guest profiling for compon...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 11 2024 at 11:38):

yoshuawuyts opened issue #8773:

Feature

Enable the following to work:

wasmtime serve ./my-component.wasm --profile=guest

Benefit

In general: profiling is useful and it's neat to be able to profile wasm components.

For me specifically though: I'm on MacOS and setting up native trace tools requires turning off security features in the kernel. I've not been able to do so successfully, so as a result I (somewhat embarrassingly) don't currently have a working perf command on my machine. Because wasmtime's guest profiler doesn't interact with the kernel at all, this seems like the ideal way to resolve it, basically by providing a portable, OS-agnostic profiling suite.

Implementation

There is a working guest profiler available already, but trying to run it on components gives the following error message:

Error: Cannot use the guest profiler with components

I don't really have insight in what it would take to implement support for components. But I figured it would be desirable - and I didn't see it being tracked already, so I figured we should. Folks with more knowledge about the challenges here should probably chime in though.

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

posborne commented on issue #8773:

I'm starting to look at this now; in my brief test I'm not seeing the same error related to components but I'm also not seeing results that look correct which seems to be backed up by the code only registering directly present core modules rather than those used as part of components.

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

posborne edited a comment on issue #8773:

I'm starting to look at this now; in my brief test I'm not seeing the same error related to components but I'm also not seeing results that look correct which seems to be backed up by the code only registering directly present core modules rather than those used as part of components.

EDIT: I do see that bail! on the serve branch; run behaves differently (but probably should have an explicit error like serve given its seeming non-function).

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

sunfishcode closed issue #8773:

Feature

Enable the following to work:

wasmtime serve ./my-component.wasm --profile=guest

Benefit

In general: profiling is useful and it's neat to be able to profile wasm components.

For me specifically though: I'm on MacOS and setting up native trace tools requires turning off security features in the kernel. I've not been able to do so successfully, so as a result I (somewhat embarrassingly) don't currently have a working perf command on my machine. Because wasmtime's guest profiler doesn't interact with the kernel at all, this seems like the ideal way to resolve it, basically by providing a portable, OS-agnostic profiling suite.

Implementation

There is a working guest profiler available already, but trying to run it on components gives the following error message:

Error: Cannot use the guest profiler with components

I don't really have insight in what it would take to implement support for components. But I figured it would be desirable - and I didn't see it being tracked already, so I figured we should. Folks with more knowledge about the challenges here should probably chime in though.

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

sunfishcode commented on issue #8773:

This is implemented in #10507.


Last updated: Apr 17 2025 at 09:03 UTC