Skip to content

Commit cf6217a

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 b51c7d8 commit cf6217a

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
@@ -219,6 +219,16 @@ impl PerfRunner {
219219
let on_cmd = async |cmd: &FifoCommand| {
220220
#[allow(deprecated)]
221221
match cmd {
222+
// Print /proc/{pid}/maps for the benchmark process. This helps with debugging missing symbols, as
223+
// it allows finding the module in which an address is located.
224+
FifoCommand::CurrentBenchmark { pid, .. } if is_codspeed_debug_enabled() => {
225+
let maps_path = format!("/proc/{pid}/maps");
226+
match std::fs::read_to_string(&maps_path) {
227+
Ok(maps) => debug!("/proc/{pid}/maps:\n{maps}"),
228+
Err(e) => debug!("Failed to read {maps_path}: {e}"),
229+
}
230+
return Ok(None);
231+
}
222232
FifoCommand::StartBenchmark => {
223233
perf_fifo.start_events().await?;
224234
}

0 commit comments

Comments
 (0)