Skip to content

Conversation

@GuillaumeLagrange
Copy link
Contributor

@GuillaumeLagrange GuillaumeLagrange commented Jan 22, 2026

  • Add a small c library that enables and disables valgrind instrumentation at dynamic link through constructor and destructor attributes (which are supported by both gcc and clang)
  • Embed the library into the exec-harness binary
  • Load this library using LD_PRELOAD, after writing it to disk at runtime

@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-1739-manage-valgrind-instrumentation-with-profiling-cli branch from 084f925 to c58ae98 Compare January 22, 2026 15:13
@codspeed-hq
Copy link

codspeed-hq bot commented Jan 22, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks


Comparing cod-1739-manage-valgrind-instrumentation-with-profiling-cli (532d645) with main (ce63cb0)

Open in CodSpeed

Copy link

Copilot AI left a 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.
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-1739-manage-valgrind-instrumentation-with-profiling-cli branch 2 times, most recently from 0559320 to 617472b Compare January 22, 2026 15:42
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-1739-manage-valgrind-instrumentation-with-profiling-cli branch from 617472b to 4bee3df Compare January 22, 2026 15:44
@GuillaumeLagrange GuillaumeLagrange force-pushed the cod-1739-manage-valgrind-instrumentation-with-profiling-cli branch from 44d172f to e29c367 Compare January 22, 2026 18:00
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.

3 participants