Skip to content

Commit cde26de

Browse files
Add escape hatch to skip collecting self profile data
We don't ever enable self profile even by default with artifacts (vs. commits).
1 parent 7791f6d commit cde26de

File tree

1 file changed

+16
-2
lines changed
  • collector/src/bin/rustc-perf-collector

1 file changed

+16
-2
lines changed

collector/src/bin/rustc-perf-collector/main.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ fn bench_commit(
158158
benchmarks: &[Benchmark],
159159
iterations: usize,
160160
call_home: bool,
161+
collect_self_profile: bool,
161162
) -> CommitData {
162163
info!(
163164
"benchmarking commit {} ({}) for triple {}",
@@ -188,15 +189,21 @@ fn bench_commit(
188189
}
189190

190191
let has_measureme = Command::new("summarize").output().is_ok();
191-
debug!("attempting self profile data: {}", has_measureme);
192+
if collect_self_profile {
193+
assert!(
194+
has_measureme,
195+
"needs `summarize` in PATH for self profile.\n\
196+
Pass --skip-self-profile` to opt out"
197+
);
198+
}
192199

193200
for benchmark in benchmarks {
194201
if results.contains_key(&benchmark.name) {
195202
continue;
196203
}
197204

198205
// Only collect self-profile if we have summarize in the path
199-
let mut processor = execute::MeasureProcessor::new(has_measureme);
206+
let mut processor = execute::MeasureProcessor::new(collect_self_profile);
200207
let result =
201208
benchmark.measure(&mut processor, build_kinds, run_kinds, compiler, iterations);
202209
let result = match result {
@@ -295,6 +302,7 @@ fn main_result() -> Result<i32, Error> {
295302
(@arg exclude: --exclude +takes_value "Ignore all benchmarks that contain this")
296303
(@arg sync_git: --("sync-git") "Synchronize repository with remote")
297304
(@arg output_repo: --("output-repo") +required +takes_value "Output repository/directory")
305+
(@arg skip_self_profile: --("skip-self-profile") "Skip self-profile")
298306

299307
(@subcommand bench_commit =>
300308
(about: "benchmark a bors merge from AWS")
@@ -352,6 +360,7 @@ fn main_result() -> Result<i32, Error> {
352360
let exclude = matches.value_of("exclude");
353361
let mut benchmarks = get_benchmarks(&benchmark_dir, filter, exclude)?;
354362
let use_remote = matches.is_present("sync_git");
363+
let collect_self_profile = matches.is_present("skip_self_profile");
355364

356365
let get_out_dir = || {
357366
let path = PathBuf::from(matches.value_of_os("output_repo").unwrap());
@@ -379,6 +388,7 @@ fn main_result() -> Result<i32, Error> {
379388
&benchmarks,
380389
3,
381390
false,
391+
collect_self_profile,
382392
))?;
383393
Ok(0)
384394
}
@@ -418,6 +428,7 @@ fn main_result() -> Result<i32, Error> {
418428
&benchmarks,
419429
1,
420430
false,
431+
collect_self_profile,
421432
);
422433
get_out_repo(true)?.add_commit_data(&result)?;
423434
Ok(0)
@@ -463,6 +474,7 @@ fn main_result() -> Result<i32, Error> {
463474
&benchmarks,
464475
3,
465476
false,
477+
false,
466478
);
467479
repo.success_artifact(&ArtifactData {
468480
id: id.to_string(),
@@ -501,6 +513,7 @@ fn main_result() -> Result<i32, Error> {
501513
&benchmarks,
502514
3,
503515
true,
516+
collect_self_profile,
504517
));
505518
if let Err(err) = result {
506519
panic!("failed to record success: {:?}", err);
@@ -594,6 +607,7 @@ fn main_result() -> Result<i32, Error> {
594607
&benchmarks,
595608
1,
596609
false,
610+
collect_self_profile,
597611
);
598612
} else {
599613
panic!("no commits");

0 commit comments

Comments
 (0)