Skip to content
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

Merged
merged 6 commits into from
May 8, 2024

Conversation

elliottt
Copy link
Contributor

@elliottt elliottt commented May 7, 2024

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.

@elliottt elliottt marked this pull request as ready for review May 7, 2024 20:52
@elliottt elliottt force-pushed the trevor/wasmtime-20 branch from 5d80cf4 to 0b9c0c7 Compare May 7, 2024 21:01
@elliottt elliottt requested review from athomason and acw May 7, 2024 21:50
lib/src/logging.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@acw acw left a 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);
Copy link
Contributor

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?

Copy link
Contributor Author

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 :)

@elliottt elliottt merged commit 909315f into main May 8, 2024
7 checks passed
@elliottt elliottt deleted the trevor/wasmtime-20 branch May 8, 2024 16:35
@kpfleming kpfleming mentioned this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants