-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to wasmtime-20, and switch to wasmtime-wasi #366
Conversation
5d80cf4
to
0b9c0c7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small question, which may be just fine, but otherwise looks good to me.
@@ -102,7 +105,7 @@ pub(crate) fn create_store( | |||
store.set_epoch_deadline(1); | |||
store.epoch_deadline_callback(|mut store| { | |||
if let Some(mut prof) = store.data_mut().guest_profiler.take() { | |||
prof.sample(&store); | |||
prof.sample(&store, std::time::Duration::ZERO); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just going to highlight this, because a sample duration of zero kind of confuses me. I guess it can't be the epoch time because we may have taken other samples during that epoch? Is there a reason ("because it's too slow, Adam") to not keep a time-since-last-sample, or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This delta parameter is the amount of cpu time that was taken since the last sample
call. Passing zero is called out as okay in the docs for cases where cpu usage information isn't needed. We can always start tracking that for more precise profiles in the future, but this seemed like a reasonable first step :)
Update the wasmtime dependency to wasmtime-20, and also remove the dependency on wasi-common in favor of using the preview1-on-preview2 implementation provided by wasmtime-wasi.
There was also a change in wiggle's borrow checker for the 20.0.0 release that affected our host call implementations directly: borrows are no longer to a region, but the whole guest memory. This caused a bit of churn in the wiggle_abi tree, and I'm not completely certain that all issues have been resolved, as the test suite can only test so many paths through the host calls. For reference, here's the wiggle refactoring PR in wasmtime: bytecodealliance/wasmtime#8277.