Skip to content

Commit 7d18652

Browse files
feat: remove existing pipedata file if there are any
1 parent cdfb56a commit 7d18652

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • src/run/runner/wall_time/perf

src/run/runner/wall_time/perf/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ impl PerfRunner {
9090
bench_cmd: &str,
9191
config: &Config,
9292
) -> anyhow::Result<ExitStatus> {
93+
if Path::new(PERF_DATA_PATH).exists() {
94+
std::fs::rename(PERF_DATA_PATH, format!("{PERF_DATA_PATH}.old")).with_context(
95+
|| format!("Failed to move existing perf data file at {PERF_DATA_PATH}",),
96+
)?;
97+
}
98+
9399
let perf_fifo = PerfFifo::new()?;
94100
let runner_fifo = RunnerFifo::new()?;
95101

0 commit comments

Comments
 (0)