@@ -158,6 +158,7 @@ fn bench_commit(
158
158
benchmarks : & [ Benchmark ] ,
159
159
iterations : usize ,
160
160
call_home : bool ,
161
+ collect_self_profile : bool ,
161
162
) -> CommitData {
162
163
info ! (
163
164
"benchmarking commit {} ({}) for triple {}" ,
@@ -188,15 +189,21 @@ fn bench_commit(
188
189
}
189
190
190
191
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
+ }
192
199
193
200
for benchmark in benchmarks {
194
201
if results. contains_key ( & benchmark. name ) {
195
202
continue ;
196
203
}
197
204
198
205
// 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 ) ;
200
207
let result =
201
208
benchmark. measure ( & mut processor, build_kinds, run_kinds, compiler, iterations) ;
202
209
let result = match result {
@@ -295,6 +302,7 @@ fn main_result() -> Result<i32, Error> {
295
302
( @arg exclude: --exclude +takes_value "Ignore all benchmarks that contain this" )
296
303
( @arg sync_git: --( "sync-git" ) "Synchronize repository with remote" )
297
304
( @arg output_repo: --( "output-repo" ) +required +takes_value "Output repository/directory" )
305
+ ( @arg skip_self_profile: --( "skip-self-profile" ) "Skip self-profile" )
298
306
299
307
( @subcommand bench_commit =>
300
308
( about: "benchmark a bors merge from AWS" )
@@ -352,6 +360,7 @@ fn main_result() -> Result<i32, Error> {
352
360
let exclude = matches. value_of ( "exclude" ) ;
353
361
let mut benchmarks = get_benchmarks ( & benchmark_dir, filter, exclude) ?;
354
362
let use_remote = matches. is_present ( "sync_git" ) ;
363
+ let collect_self_profile = matches. is_present ( "skip_self_profile" ) ;
355
364
356
365
let get_out_dir = || {
357
366
let path = PathBuf :: from ( matches. value_of_os ( "output_repo" ) . unwrap ( ) ) ;
@@ -379,6 +388,7 @@ fn main_result() -> Result<i32, Error> {
379
388
& benchmarks,
380
389
3 ,
381
390
false ,
391
+ collect_self_profile,
382
392
) ) ?;
383
393
Ok ( 0 )
384
394
}
@@ -418,6 +428,7 @@ fn main_result() -> Result<i32, Error> {
418
428
& benchmarks,
419
429
1 ,
420
430
false ,
431
+ collect_self_profile,
421
432
) ;
422
433
get_out_repo ( true ) ?. add_commit_data ( & result) ?;
423
434
Ok ( 0 )
@@ -463,6 +474,7 @@ fn main_result() -> Result<i32, Error> {
463
474
& benchmarks,
464
475
3 ,
465
476
false ,
477
+ false ,
466
478
) ;
467
479
repo. success_artifact ( & ArtifactData {
468
480
id : id. to_string ( ) ,
@@ -501,6 +513,7 @@ fn main_result() -> Result<i32, Error> {
501
513
& benchmarks,
502
514
3 ,
503
515
true ,
516
+ collect_self_profile,
504
517
) ) ;
505
518
if let Err ( err) = result {
506
519
panic ! ( "failed to record success: {:?}" , err) ;
@@ -594,6 +607,7 @@ fn main_result() -> Result<i32, Error> {
594
607
& benchmarks,
595
608
1 ,
596
609
false ,
610
+ collect_self_profile,
597
611
) ;
598
612
} else {
599
613
panic ! ( "no commits" ) ;
0 commit comments