Skip to content

Add the initial implementation of javy-profiler#1213

Open
saulecabrera wants to merge 3 commits into
bytecodealliance:mainfrom
saulecabrera:add-javy-prof-shell
Open

Add the initial implementation of javy-profiler#1213
saulecabrera wants to merge 3 commits into
bytecodealliance:mainfrom
saulecabrera:add-javy-prof-shell

Conversation

@saulecabrera
Copy link
Copy Markdown
Member

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:

  • 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.

  • I've updated the default plugin import namespace and incremented the major version of javy-plugin-api if the QuickJS bytecode has changed.
  • I've updated the relevant CHANGELOG files if necessary. Changes to javy-cli, javy-plugin, and javy-plugin-processing do not require updating CHANGELOG files.
  • I've updated the relevant crate versions if necessary. Versioning policy for library crates
  • I've updated documentation including crate documentation if necessary.

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.
@saulecabrera saulecabrera requested a review from jeffcharles June 2, 2026 15:20
@saulecabrera
Copy link
Copy Markdown
Member Author

Investigating the failures, unsure if they are fully related to the changes here, I am seeing:

Error: Unable to process file command 'output' successfully.
Error: Invalid format '45.0.0'

https://github.com/bytecodealliance/javy/actions/runs/26829367024/job/79106160369?pr=1213

Comment thread crates/profiler/build.rs
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Makefile
#
# it will retrive `cargo build -p javy-profiler-lib
# --target=wasm32-wasip1 --release` as defined the CLI's Cargo.toml
define feature_asset_cmds
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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" }
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@saulecabrera
Copy link
Copy Markdown
Member Author

Investigating the failures, unsure if they are fully related to the changes here, I am seeing:

Error: Unable to process file command 'output' successfully.
Error: Invalid format '45.0.0'

https://github.com/bytecodealliance/javy/actions/runs/26829367024/job/79106160369?pr=1213

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)
@saulecabrera
Copy link
Copy Markdown
Member Author

Investigating the failures, unsure if they are fully related to the changes here, I am seeing:

Error: Unable to process file command 'output' successfully.
Error: Invalid format '45.0.0'

https://github.com/bytecodealliance/javy/actions/runs/26829367024/job/79106160369?pr=1213

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.

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

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.

1 participant