Stream: git-wasmtime

Topic: wasmtime / issue #6030 Add support for generating perf ma...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 12:52):

github-actions[bot] commented on issue #6030:

Subscribe to Label Action

cc @peterhuene

<details>
This issue or pull request has been labeled: "wasmtime:api", "wasmtime:c-api", "wasmtime:config", "wasmtime:docs"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 12:53):

github-actions[bot] commented on issue #6030:

Label Messager: wasmtime:config

It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:

[fuzzing-config]: https://github.com/bytecodealliance/wasmtime/blob/ca0e8d0a1d8cefc0496dba2f77a670571d8fdcab/crates/fuzzing/src/generators.rs#L182-L194
[fuzzing-docs]: https://docs.wasmtime.dev/contributing-fuzzing.html


<details>

To modify this label's message, edit the <code>.github/label-messager/wasmtime-config.md</code> file.

To add new label messages or remove existing label messages, edit the
<code>.github/label-messager.json</code> configuration file.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 13:15):

bnjbvr edited a comment on issue #6030:

Label Messager: wasmtime:config

It looks like you are changing Wasmtime's configuration options. Make sure to
complete this check list:

[fuzzing-config]: https://github.com/bytecodealliance/wasmtime/blob/ca0e8d0a1d8cefc0496dba2f77a670571d8fdcab/crates/fuzzing/src/generators.rs#L182-L194
[fuzzing-docs]: https://docs.wasmtime.dev/contributing-fuzzing.html


<details>

To modify this label's message, edit the <code>.github/label-messager/wasmtime-config.md</code> file.

To add new label messages or remove existing label messages, edit the
<code>.github/label-messager.json</code> configuration file.

Learn more.

</details>

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 14:59):

bjorn3 commented on issue #6030:

Or is there a reason to use jitdump over this?

Jitdump can handle code memory being reused by multiple functions at different times. In addition it allows perf to show the actual instructions that executed rather than just the function names. It also supports recording unwind tables as opposed to requiring frame pointers for unwinding. And finally it allows recording line tables.

Is there some online documentation for this?

https://github.com/torvalds/linux/blob/master/tools/perf/Documentation/jit-interface.txt

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 15:02):

bjorn3 commented on issue #6030:

I think the performance issues of the jitdump support are because we emit a record for each individual function at https://github.com/bytecodealliance/wasmtime/blob/76116fc925067338d57b81e30a5fa2d4b5016d0f/crates/jit/src/profiling/jitdump_linux.rs#L67 instead of emitting a single record covering the entire text section of the module as intended.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 17:49):

bnjbvr commented on issue #6030:

I think the performance issues of the jitdump support are because we emit a record for each individual function at

Nice find @bjorn3! Although I'm not deep enough into the jitdump support to know how to fix this properly and quickly, and perfmap support is a great start for our use case.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 18:33):

bjorn3 commented on issue #6030:

Oh I didn't realize that it was possible to do this, but reading over the documentation it looks like JIT_CODE_LOAD only supports one symbol? Do you know off the top of your head how the whole text section would be loaded? I'd love to fix this myself to avoid generating thousands of tiny *.so files on all perf inject calls.

Right, I should have read the docs more carefully. My bad. All we can do I guess is to make perf inject not produce a .so for each individual function or write some rust code that has the same functionality as perf inject but is faster.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 18:44):

bjorn3 commented on issue #6030:

Wow, perf inject is dumb. It is not even that we do something wrong causing each function to be a separate elf file. Instead it really produces a elf file for each function unconditionally: https://github.com/torvalds/linux/blob/9c1bec9c0b08abeac72ed6214b723adc224013bf/tools/perf/util/jitdump.c#L466

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 21:30):

bjorn3 edited a comment on issue #6030:

Wow, perf inject has a pretty naive implementation. It is not even that we do something wrong causing each function to be a separate elf file. Instead it really produces a elf file for each function unconditionally: https://github.com/torvalds/linux/blob/9c1bec9c0b08abeac72ed6214b723adc224013bf/tools/perf/util/jitdump.c#L466

view this post on Zulip Wasmtime GitHub notifications bot (Mar 16 2023 at 21:56):

bnjbvr commented on issue #6030:

or write some rust code that has the same functionality as perf inject but is faster.

:eyes: https://github.com/mstange/samply/issues/33

view this post on Zulip Wasmtime GitHub notifications bot (Mar 20 2023 at 14:17):

bnjbvr commented on issue #6030:

I should have addressed all the feedback, thanks for the review!


Last updated: Oct 23 2024 at 20:03 UTC