lind-perf: automated microbenchmarking library#812
Open
stupendoussuperpowers wants to merge 14 commits intomainfrom
Open
lind-perf: automated microbenchmarking library#812stupendoussuperpowers wants to merge 14 commits intomainfrom
stupendoussuperpowers wants to merge 14 commits intomainfrom
Conversation
Yaxuan-w
reviewed
Feb 23, 2026
| // --------------------------------------------------------------------------------------------------------------------- | ||
|
|
||
| // Wrapper for LIBC_SYSCALL which is used to benchmark calls that end up calling the Linux kernel. | ||
| int libc_syscall() { |
Member
There was a problem hiding this comment.
Could you also mention in comment about scenarios it might be used?
Comment on lines
+29
to
71
| // Entry point for a lind_perf enabled build. | ||
| // | ||
| // When run with --perf flags, it performs the required setup and teardown, along with running | ||
| // the inputted wasm benchmark multiple times (once per counter). | ||
| #[cfg(feature = "lind_perf")] | ||
| { | ||
| // Determine which timer to use. --perftsc => Rdtsc, --perf => Clock | ||
| let kind = if lindboot_cli.perftsc { | ||
| Some(TimerKind::Rdtsc) | ||
| } else if lindboot_cli.perf { | ||
| Some(TimerKind::Clock) | ||
| } else { | ||
| None | ||
| }; | ||
|
|
||
| match kind { | ||
| Some(k) => { | ||
| // Initiate all counters | ||
| perf::enabled::init(k); | ||
|
|
||
| // Iterate over all counters, enable one at a time, run the wasm module. | ||
| for name in perf::enabled::all_counter_names() { | ||
| perf::enabled::enable_one(name); | ||
|
|
||
| rawposix_start(0); | ||
|
|
||
| let _ = execute_wasmtime(lindboot_cli.clone()); | ||
|
|
||
| rawposix_shutdown(); | ||
| } | ||
|
|
||
| // Print the final report. | ||
| perf::enabled::report(); | ||
|
|
||
| return Ok(()); | ||
| } | ||
| // In case neither --perf flag is set, fall back to default lind-boot behaviour. | ||
| None => {} | ||
| }; | ||
| } | ||
|
|
||
| // AOT-compile only �~@~T no runtime needed | ||
| if lindboot_cli.precompile { |
Member
There was a problem hiding this comment.
Correct me if I'm wrong. My understanding is that performance execution will be different from normal execution in order to enable benchmarking. Is this what those code wants to achieve?
| int geteuid_grate(uint64_t); | ||
|
|
||
| int geteuid_grate(uint64_t cageid) { | ||
| return 10; |
Member
There was a problem hiding this comment.
Can you explain this constant? Is it just an arbitrary value?
Contributor
Author
|
After the discussion in the meeting today, want to ask about whether I should break this into the following PRs so that this is easier to review:
|
Contributor
|
A few things
|
Contributor
|
Also imports should be feature gated so they dont give more warnings at least |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes on how to review this PR:
lind-perfrelated changes andREADME. These contain the core logic of how we ensure low-overhead timers.lind-boot/src/perf.rsandlind-boot/src/main.rssince these contain the plumbing required to run and report the benchmarks.tests/,run_micorbenchmarks.shadded to scripts,make lind-boot-perfadded toMakefileBEFORE MERGE:
lind_perffeature does not break existing things.Build:
make lind-boot-perfRun microbenchmarks:
./scripts/run_microbench.shSample output: