Stream: git-wasmtime

Topic: wasmtime / PR #11865 Make profiling more amenable to othe...


view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 16:55):

alexcrichton requested pchickey for a review on PR #11865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 16:55):

alexcrichton opened PR #11865 from alexcrichton:multi-engine-profiling to bytecodealliance:main:

Both the perfmap and jitdump protocols for profiling JITs require that there's a single file with metadata per-process. This has the unfortunate side effect of if there are multiple engines in the same process there's no real way for them to coordinate when writing out records to this file. In an attempt to at least try to synchronize this commit updates these two implementations to issue a single write syscall with the full contents of the record to a file opened in O_APPEND mode.

If all the stars align and a partial write doesn't happen then that means we're doing our best effort to cooperate with other engines in the same process. If a partial write happens the decision in this PR is to go ahead and retry the rest of the write (using the write_all helper). This is a tradeoff where it makes the single-engine use case more robust (partial writes are handled correctly) but the multi-engine use case will produce corrupt files. It doesn't feel like a great tradeoff to say that profiling can't be done in Wasmtime when a partial write would happen for this niche use case of multiple engines, hence the direction of this tradeoff.

Closes #11862

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 16:55):

alexcrichton requested wasmtime-core-reviewers for a review on PR #11865.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 16:55):

alexcrichton submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 16:55):

alexcrichton created PR review comment:

I ended up deleting this method since it's not used in Wasmtime at all and opted to expose a file and file_mut accessor in case anyone externally is using this and still wants to be able to write.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 21:51):

pchickey submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Oct 15 2025 at 22:20):

alexcrichton merged PR #11865.


Last updated: Dec 06 2025 at 06:05 UTC