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?
Milek7 requested fitzgen for a review on PR #7873.
Milek7 requested wasmtime-core-reviewers for a review on PR #7873.
Milek7 updated PR #7873.
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:
- 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>
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 passingDuration::ZERO
is ok but might have some consequences when viewing the results?
Milek7 updated PR #7873.
Last updated: Nov 22 2024 at 17:03 UTC