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:
- peterhuene: wasmtime:api, wasmtime:c-api
To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.
Learn more.
</details>
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:
[ ] If you added a new
Config
method, you wrote extensive documentation for
it.<details>
Our documentation should be of the following form:
```text
Short, simple summary sentence.More details. These details can be multiple paragraphs. There should be
information about not just the method, but its parameters and results as
well.Is this method fallible? If so, when can it return an error?
Can this method panic? If so, when does it panic?
Example
Optional example here.
```</details>
[ ] If you added a new
Config
method, or modified an existing one, you
ensured that this configuration is exercised by the fuzz targets.<details>
For example, if you expose a new strategy for allocating the next instance
slot inside the pooling allocator, you should ensure that at least one of our
fuzz targets exercises that new strategy.Often, all that is required of you is to ensure that there is a knob for this
configuration option in [wasmtime_fuzzing::Config
][fuzzing-config] (or one
of its nestedstruct
s).Rarely, this may require authoring a new fuzz target to specifically test this
configuration. See [our docs on fuzzing][fuzzing-docs] for more details.</details>
[ ] If you are enabling a configuration option by default, make sure that it
has been fuzzed for at least two weeks before turning it on by default.[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.</details>
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:
[x] If you added a new
Config
method, you wrote extensive documentation for
it.<details>
Our documentation should be of the following form:
```text
Short, simple summary sentence.More details. These details can be multiple paragraphs. There should be
information about not just the method, but its parameters and results as
well.Is this method fallible? If so, when can it return an error?
Can this method panic? If so, when does it panic?
Example
Optional example here.
```</details>
[ ] If you added a new
Config
method, or modified an existing one, you
ensured that this configuration is exercised by the fuzz targets.<details>
For example, if you expose a new strategy for allocating the next instance
slot inside the pooling allocator, you should ensure that at least one of our
fuzz targets exercises that new strategy.Often, all that is required of you is to ensure that there is a knob for this
configuration option in [wasmtime_fuzzing::Config
][fuzzing-config] (or one
of its nestedstruct
s).Rarely, this may require authoring a new fuzz target to specifically test this
configuration. See [our docs on fuzzing][fuzzing-docs] for more details.</details>
[ ] If you are enabling a configuration option by default, make sure that it
has been fuzzed for at least two weeks before turning it on by default.[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.</details>
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
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.
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.
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 asperf inject
but is faster.
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
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
bnjbvr commented on issue #6030:
or write some rust code that has the same functionality as perf inject but is faster.
bnjbvr commented on issue #6030:
I should have addressed all the feedback, thanks for the review!
Last updated: Nov 22 2024 at 17:03 UTC