-
Notifications
You must be signed in to change notification settings - Fork 6
Manage valgrind instrumentation with profiling cli #209
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: main
Are you sure you want to change the base?
Manage valgrind instrumentation with profiling cli #209
Conversation
084f925 to
c58ae98
Compare
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 support for managing Valgrind instrumentation in exec-harness by introducing a C preload library that enables/disables callgrind instrumentation. The library is compiled during build, embedded into the binary, and loaded via LD_PRELOAD when running benchmarks in simulation mode.
Changes:
- Added C preload library for Valgrind instrumentation control
- Implemented build script to compile and embed the preload library
- Added simulation/instrumentation mode support with valgrind-based execution
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/exec-harness/build.rs | New build script that compiles the C preload library and exports constants |
| crates/exec-harness/preload/codspeed_preload.c | New C library that manages Valgrind instrumentation via constructor/destructor |
| crates/exec-harness/src/constants.rs | New module defining shared constants between Rust and C code |
| crates/exec-harness/src/analysis.rs | Added perform_with_valgrind function that extracts and uses the preload library |
| crates/exec-harness/src/lib.rs | Enabled simulation mode with "instrumentation" alias |
| crates/exec-harness/src/uri.rs | Added command field and print_executing helper method |
| crates/exec-harness/src/walltime/mod.rs | Added logging for benchmark execution |
| crates/exec-harness/Cargo.toml | Updated codspeed to 4.2.0, added build dependencies |
| .gitignore | Added compile_commands.json and .cache |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…umentation For now, the library is just generated and its path is passed to the binary through env file. In the next commit, this will change to embed the binary in the final exec-harness executable to make the built artifact self-sufficient.
0559320 to
617472b
Compare
Also switch to tempfile
617472b to
4bee3df
Compare
44d172f to
e29c367
Compare
constructoranddestructorattributes (which are supported by bothgccandclang)LD_PRELOAD, after writing it to disk at runtime