-
Notifications
You must be signed in to change notification settings - Fork 844
feat(vm_reexecute): add pprof profiling support #4790
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
base: master
Are you sure you want to change the base?
Conversation
…rofile generation
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.
Pull request overview
This PR adds pprof profiling support to the C-chain re-execution benchmark to enable CPU and memory profiling during benchmark runs. This supports cross-stack profiling efforts by providing Go-side performance visibility that complements Rust-side profiling.
Key changes:
- Added
--pprofflag to enable profiling during benchmark execution - Implemented CPU and memory profile file generation in
./pprof/directory - Added logging of pprof enablement status to benchmark output
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ld be replaced with PROFILE flag which will capture the whole profiling stack including pprof
…lexible profiling configuration
RodrigoVillar
left a comment
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.
Currently, the changes this PR introduces are only invokable via go run, which is not the recommended way to running the reexecution test (with preference going to ./scripts/benchmark_cchain_range.sh or using task). Can this PR also include a way to invoke profiling both the preferred options above?
This may require coordination with #4761
See the note in the PR description the |
Ah I now see #4791 |
Why this should be merged
Adds
--pprof-dir <path>flag to C-chain re-execution benchmark for CPU and memory profiling.Part of cross-stack profiling effort: ava-labs/firewood#1582
pprof shows time spent in CGO calls as black boxes we see that
ffi.(*Revision).Gettakes X% of CPU but not what happens inside Firewood it's still valuable because:Combined with Rust-side profiling, we get full visibility across the boundary.
How this works
When
--pprof-dir <path>is passed:<path>directorycpu.profile,mem.profileandlock.profileon exitHow this was tested
nix develop(make sure you have AWS credentials set, c-chain-reexecute requires S3 access)vm_reexecutionand set output dir then run./scripts/run_task.sh c-chain-reexecution-firewood-101-250kgo tool pprof /tmp/pprof/cpu.profiletop 20list Revision.*GetNOTE:
--pprof-diris intentionally not exposed inbenchmark_cchain_range.shyet the profiling API may evolve as other profiling needs arise ava-labs/firewood#1582. The flag is still available when running the test directly via go run.Need to be documented in RELEASES.md?
No