Skip to content

Commit 56be8b1

Browse files
committed
chore: add debug output for /proc/maps in walltime
Print the benchmark process memory map when CODSPEED_DEBUG is enabled. This helps with debugging missing symbols by showing which modules are loaded at which addresses.
1 parent a40b751 commit 56be8b1

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

  • src/executor/wall_time/perf

src/executor/wall_time/perf/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,16 @@ impl PerfRunner {
222222
let on_cmd = async |cmd: &FifoCommand| {
223223
#[allow(deprecated)]
224224
match cmd {
225+
// Print /proc/{pid}/maps for the benchmark process. This helps with debugging missing symbols, as
226+
// it allows finding the module in which an address is located.
227+
FifoCommand::CurrentBenchmark { pid, .. } if is_codspeed_debug_enabled() => {
228+
let maps_path = format!("/proc/{pid}/maps");
229+
match std::fs::read_to_string(&maps_path) {
230+
Ok(maps) => debug!("/proc/{pid}/maps:\n{maps}"),
231+
Err(e) => debug!("Failed to read {maps_path}: {e}"),
232+
}
233+
return Ok(None);
234+
}
225235
FifoCommand::StartBenchmark => {
226236
perf_fifo.start_events().await?;
227237
}

0 commit comments

Comments
 (0)