Skip to content

Commit 7b65909

Browse files
moha-bekhclaude
authored andcommitted
fix(memory): install the memtrack copy before any run under sudo
Walltime runs samply under sudo with the user's HOME, so it creates `~/.cache` as root when it does not exist yet. A later memory run then fails to create `~/.cache/codspeed/memtrack/<hash>` and cannot grant the eBPF capabilities. Install the copy upfront, as the current user, when the memory mode is requested. Refs COD-3440 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 644ce62 commit 7b65909

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎src/executor/orchestrator.rs‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ impl Orchestrator {
125125
let mut all_completed_runs = vec![];
126126

127127
if !self.config.skip_run {
128+
// Install memtrack's copy before any run under sudo, which may create
129+
// a root-owned `~/.cache` (e.g. samply's symbol cache in walltime).
130+
#[cfg(target_os = "linux")]
131+
if modes.contains(&RunnerMode::Memory) {
132+
if let Err(e) = super::memtrack_path() {
133+
debug!("Failed to install memtrack: {e:#}");
134+
}
135+
}
136+
128137
start_opened_group!("Running the benchmarks");
129138
}
130139

0 commit comments

Comments
 (0)