-
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
⏱️ Add cross-platform ability to profile guest code in run mode #280
Conversation
963c0c6
to
07f9bd4
Compare
07f9bd4
to
ec0714d
Compare
lib/src/execute.rs
Outdated
eprintln!(); | ||
eprintln!("Profile written to: {}", path.display()); | ||
eprintln!("View this profile at https://profiler.firefox.com/."); |
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.
Newbie question: why are we writing what looks to be a success message to stderr?
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.
oops I don't think that was intentional
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 had done it that way in the equivalent code in Wasmtime to reduce the chance that this message might get mixed up with regular output from the wasm guest. I don't feel strongly about whether Viceroy should do the same, where guest output is less likely to be significant.
self, | ||
program_name: &str, | ||
args: &[String], | ||
guest_profile_path: Option<&PathBuf>, |
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.
Question: Does this change, introducing a new parameter to a public function, mean we will need to release this as a new major version of the crate?
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 presuming "no" because it's an additive change to the exposed binary interface (i.e. a new optional flag has been added) but if the user doesn't provide that flag the existing functionality continues to work as expected.
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.
Sorry, I meant for the viceroy-lib crate, not for the cli crate
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.
Yes I think this will probably require a bump to 0.6.0
0bfc584
to
4d77f86
Compare
upgraded to wasmtime 10.0.0
Co-authored-by: Jamey Sharp <jsharp@fastly.com>
Co-authored-by: Jamey Sharp <jsharp@fastly.com>
4d77f86
to
f6075af
Compare
This uses the GuestProfiler that is now available in wasmtime 10.0.0 to create a profile in a location specified by the user. Right now we currently just have it working for run-mode, but are planning on adding similar functionality in serve mode, likely creating one profile per-request.
To use this, run the following:
This will result in a profile being saved to the default location (
guest-profile.json
), which you can upload and view on https://profiler.firefox.com.