Yeeyooo opened issue #10362:
Hello, I'm profiling the execution of WebAssembly program in wasmtime by using
perf
tool, which is supported by wasmtime. By following the chapter "Using perf on Linux" in official documentation, I can get perf output as expected. However, the amount of information generated is staggering, which not only has function overhead in the given wasm program, but also has many other function symbols, which is not what I want. Below is an example:
Aftering reading source code of wasmtime, I find that the actual call into wasm program happens in the functioncall_impl_do_call
. I wonder if it is possible to limit the sample scope to the execution of this function, so I can get information about the overhead of each function called during this process, ruling out many other unnecessary functions? If it is possible, how can I do that? Thank you very much for your help!
bjorn3 commented on issue #10362:
I see wasmtime, node and a gpu driver component (kms_swrast_dri.so) in your profile. I think you are profiling not just wasmtime but the entire system. You need to run wasmtime directly from perf through
perf record wasmtime ...
to only include wasmtime in your profile.
Yeeyooo commented on issue #10362:
Thank you for your reply! That's just an example. Can I further limit the sample scope to the function
call_impl_do_call
and find what happens during this call?
bjorn3 commented on issue #10362:
If you select call_impl_do_call and then press e, you can expand it to show the functions this function called. I don't think perf report has an option to filter to just the functions called by a specific function.
cfallin closed issue #10362:
Hello, I'm profiling the execution of WebAssembly program in wasmtime by using
perf
tool, which is supported by wasmtime. By following the chapter "Using perf on Linux" in official documentation, I can get perf output as expected. However, the amount of information generated is staggering, which not only has function overhead in the given wasm program, but also has many other function symbols, which is not what I want. Below is an example:
Aftering reading source code of wasmtime, I find that the actual call into wasm program happens in the functioncall_impl_do_call
. I wonder if it is possible to limit the sample scope to the execution of this function, so I can get information about the overhead of each function called during this process, ruling out many other unnecessary functions? If it is possible, how can I do that? Thank you very much for your help!
cfallin commented on issue #10362:
perf
is fundamentally a tool that is meant to profile whole processes (or the whole system), and I'm not aware of a way to tell it to stop profiling to "hide" the runtime (any such interface would also likely have high overhead on every Wasm call). As @bjorn3 notes, this is more properly a UI concern -- the functionality to scope down to a subtree of the results is the way to do this.I believe the question has been answered so I'll go ahead and close the issue; if you have further questions please don't hesitate to ask though!
Last updated: Apr 17 2025 at 14:03 UTC