Stream: git-wasmtime

Topic: wasmtime / PR #7873 Add function accepting explicit CPU d...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 05 2024 at 19:53):

Milek7 opened PR #7873 from Milek7:guestprofiler-delta to bytecodealliance:main:

Currently GuestProfiler::sample always records zero CPU time delta. This makes resulting profiles hard to interpret, especially because sampling is usually performed from epoch callback, which necessarily means that no samples at all are captured when guest is not running, thus there is no distinguishable "idle" stacktrace of any sort.

While it is possible to read OS thread time counters for that, GuestProfiler is not aware whether current thread is used exclusively for running that guest. For example, I'm running multiple guests on single-threaded event loop and that would partially misattribute CPU time to neighboring guests on first/last sample. Thus I think that the embedder is better suited to measure and provide time delta to sampling function.

I left old signature intact not to break any existing users. For symmetry C bindings also got new signature, though maybe old one should be removed as it doesn't have any users yet?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 05 2024 at 19:53):

Milek7 requested fitzgen for a review on PR #7873.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 05 2024 at 19:53):

Milek7 requested wasmtime-core-reviewers for a review on PR #7873.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 05 2024 at 20:01):

Milek7 updated PR #7873.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 05 2024 at 21:44):

github-actions[bot] commented on PR #7873:

Subscribe to Label Action

cc @peterhuene

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

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 (Feb 06 2024 at 15:49):

alexcrichton commented on PR #7873:

Thanks for the PR! It's ok to break the current signature and change it, so I think I would agree with you that it seems like it might be best to unconditionally take a Duration argument. Could you update the documentation to indicate that passing Duration::ZERO is ok but might have some consequences when viewing the results?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 06 2024 at 16:12):

Milek7 updated PR #7873.


Last updated: Nov 22 2024 at 17:03 UTC