Skip to content

Commit 194d890

Browse files
committed
chore: add sample freq modifier
1 parent 4f087d8 commit 194d890

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • src/run/runner/wall_time/perf

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,14 @@ impl PerfRunner {
155155
}
156156
};
157157

158+
let sample_freq = std::env::var("CODSPEED_PERF_SAMPLE_FREQ")
159+
.ok()
160+
.and_then(|freq| freq.parse::<u32>().ok())
161+
.unwrap_or(999);
158162
cmd.args([
159163
"-c",
160164
&format!(
161-
"sudo perf record {quiet_flag} --user-callchains --freq=999 --switch-output --control=fifo:{},{} --delay=-1 -g --call-graph={cg_mode} --output={} -- {bench_cmd}",
165+
"sudo perf record {quiet_flag} --user-callchains --freq={sample_freq} --switch-output --control=fifo:{},{} --delay=-1 -g --call-graph={cg_mode} --output={} -- {bench_cmd}",
162166
perf_fifo.ctl_fifo_path.to_string_lossy(),
163167
perf_fifo.ack_fifo_path.to_string_lossy(),
164168
perf_file.path().to_string_lossy(),

0 commit comments

Comments
 (0)