Add the initial implementation of javy-profiler#1213
Conversation
This patch is a follow-up to bytecodealliance#1208. It marks the initial work to introduce the profiling functionality as described in bytecodealliance#1206. Concretely, this patch focuses on the Whamm integration: * Making the necessary changes to the build system to enable building the profiler library that will be consumed by Whamm. * Adding a new `profile` command and `profile inject` subcommad to the CLI * Gating this functionality under a feature flag. Structure wise I tried to make this change as self-contained as possible (see the changes the makefile, and the introduction of the `profiler` feature flag), allowing for an straightforward removal from tree if we ever decide that this feture should not stabilized.
|
Investigating the failures, unsure if they are fully related to the changes here, I am seeing: https://github.com/bytecodealliance/javy/actions/runs/26829367024/job/79106160369?pr=1213 |
There was a problem hiding this comment.
Note that I could move all this to the CLI, but in the spirit of having this feature self-contained, I decided to put it here, at the cost of some code duplication.
| # | ||
| # it will retrive `cargo build -p javy-profiler-lib | ||
| # --target=wasm32-wasip1 --release` as defined the CLI's Cargo.toml | ||
| define feature_asset_cmds |
There was a problem hiding this comment.
An alternative to this would be to define a new target e.g., make cli-profiler. I didn't go with that approach since this one seems to be more extensible for other optional upcoming features, e.g., the compiler.
| license.workspace = true | ||
|
|
||
| [dependencies] | ||
| whamm = { git = "https://github.com/saulecabrera/whamm", branch = "binary-entrypoints" } |
There was a problem hiding this comment.
This is temporary until ejrgilbert/whamm#326, is merged. I think this is acceptable, given the experimental nature of this feature. I'm planning to update once the PR is merged.
The error here is that Whamm is pulling in wasmtime v38, but Javy depends on v45. I think that the real fix is to update Whamm to use v45. I'll do that in my branch. |
This avoid pulling in multiple versions, introduce by transitive dependencies (e.g., whamm)
I ended up fixing the cargo metadata invocation to only account for the wasmtime version of the direct dependencies. Given that this feature is currently experimental, I think this is the right path forward, also, this approach will allow updating wasmtime for the default features while not being blocked by the version used in Whamm |
This patch is a follow-up to
#1208.
It marks the initial work to introduce the profiling functionality as described in #1206.
Concretely, this patch focuses on the Whamm integration:
profilecommand andprofile injectsubcommad to the CLIStructure wise I tried to make this change as self-contained as possible (see the changes the makefile, and the introduction of the
profilerfeature flag), allowing for an straightforward removal from tree if we ever decide that this feture should not stabilized.javy-plugin-apiif the QuickJS bytecode has changed.javy-cli,javy-plugin, andjavy-plugin-processingdo not require updating CHANGELOG files.