@@ -67,28 +67,28 @@ impl BuildKind {
67
67
}
68
68
69
69
#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
70
- pub enum RunKind {
70
+ pub enum ScenarioKind {
71
71
Full ,
72
72
IncrFull ,
73
73
IncrUnchanged ,
74
74
IncrPatched ,
75
75
}
76
76
77
- impl RunKind {
78
- fn all ( ) -> Vec < RunKind > {
77
+ impl ScenarioKind {
78
+ fn all ( ) -> Vec < ScenarioKind > {
79
79
vec ! [
80
- RunKind :: Full ,
81
- RunKind :: IncrFull ,
82
- RunKind :: IncrUnchanged ,
83
- RunKind :: IncrPatched ,
80
+ ScenarioKind :: Full ,
81
+ ScenarioKind :: IncrFull ,
82
+ ScenarioKind :: IncrUnchanged ,
83
+ ScenarioKind :: IncrPatched ,
84
84
]
85
85
}
86
86
87
- fn all_non_incr ( ) -> Vec < RunKind > {
88
- vec ! [ RunKind :: Full ]
87
+ fn all_non_incr ( ) -> Vec < ScenarioKind > {
88
+ vec ! [ ScenarioKind :: Full ]
89
89
}
90
90
91
- fn default ( ) -> Vec < RunKind > {
91
+ fn default ( ) -> Vec < ScenarioKind > {
92
92
Self :: all ( )
93
93
}
94
94
}
@@ -101,12 +101,12 @@ const STRINGS_AND_BUILD_KINDS: &[(&str, BuildKind)] = &[
101
101
( "Opt" , BuildKind :: Opt ) ,
102
102
] ;
103
103
104
- // How the --runs arg maps to RunKinds .
105
- const STRINGS_AND_RUN_KINDS : & [ ( & str , RunKind ) ] = & [
106
- ( "Full" , RunKind :: Full ) ,
107
- ( "IncrFull" , RunKind :: IncrFull ) ,
108
- ( "IncrUnchanged" , RunKind :: IncrUnchanged ) ,
109
- ( "IncrPatched" , RunKind :: IncrPatched ) ,
104
+ // How the --runs arg maps to ScenarioKinds .
105
+ const STRINGS_AND_SCENARIO_KINDS : & [ ( & str , ScenarioKind ) ] = & [
106
+ ( "Full" , ScenarioKind :: Full ) ,
107
+ ( "IncrFull" , ScenarioKind :: IncrFull ) ,
108
+ ( "IncrUnchanged" , ScenarioKind :: IncrUnchanged ) ,
109
+ ( "IncrPatched" , ScenarioKind :: IncrPatched ) ,
110
110
] ;
111
111
112
112
fn build_kinds_from_arg ( arg : & Option < & str > ) -> anyhow:: Result < Vec < BuildKind > > {
@@ -117,11 +117,11 @@ fn build_kinds_from_arg(arg: &Option<&str>) -> anyhow::Result<Vec<BuildKind>> {
117
117
}
118
118
}
119
119
120
- fn run_kinds_from_arg ( arg : Option < & str > ) -> anyhow:: Result < Vec < RunKind > > {
120
+ fn scenario_kinds_from_arg ( arg : Option < & str > ) -> anyhow:: Result < Vec < ScenarioKind > > {
121
121
if let Some ( arg) = arg {
122
- kinds_from_arg ( "run" , STRINGS_AND_RUN_KINDS , arg)
122
+ kinds_from_arg ( "run" , STRINGS_AND_SCENARIO_KINDS , arg)
123
123
} else {
124
- Ok ( RunKind :: default ( ) )
124
+ Ok ( ScenarioKind :: default ( ) )
125
125
}
126
126
}
127
127
@@ -203,7 +203,7 @@ fn bench(
203
203
pool : database:: Pool ,
204
204
artifact_id : & ArtifactId ,
205
205
build_kinds : & [ BuildKind ] ,
206
- run_kinds : & [ RunKind ] ,
206
+ scenario_kinds : & [ ScenarioKind ] ,
207
207
compiler : Compiler < ' _ > ,
208
208
benchmarks : & [ Benchmark ] ,
209
209
iterations : Option < usize > ,
@@ -269,8 +269,13 @@ fn bench(
269
269
artifact_row_id,
270
270
is_self_profile,
271
271
) ;
272
- let result =
273
- benchmark. measure ( & mut processor, build_kinds, run_kinds, compiler, iterations) ;
272
+ let result = benchmark. measure (
273
+ & mut processor,
274
+ build_kinds,
275
+ scenario_kinds,
276
+ compiler,
277
+ iterations,
278
+ ) ;
274
279
if let Err ( s) = result {
275
280
eprintln ! (
276
281
"collector error: Failed to benchmark '{}', recorded: {:#}" ,
@@ -592,7 +597,7 @@ fn main_result() -> anyhow::Result<i32> {
592
597
let db = sub_m. value_of ( "DB" ) . unwrap_or ( default_db) ;
593
598
let exclude = sub_m. value_of ( "EXCLUDE" ) ;
594
599
let include = sub_m. value_of ( "INCLUDE" ) ;
595
- let run_kinds = run_kinds_from_arg ( sub_m. value_of ( "RUNS" ) ) ?;
600
+ let scenario_kinds = scenario_kinds_from_arg ( sub_m. value_of ( "RUNS" ) ) ?;
596
601
let iterations = iterations_from_arg ( sub_m. value_of ( "ITERATIONS" ) ) ?;
597
602
let rustdoc = sub_m. value_of ( "RUSTDOC" ) ;
598
603
let is_self_profile = sub_m. is_present ( "SELF_PROFILE" ) ;
@@ -606,9 +611,9 @@ fn main_result() -> anyhow::Result<i32> {
606
611
let res = bench (
607
612
& mut rt,
608
613
pool,
609
- & ArtifactId :: Artifact ( id. to_string ( ) ) ,
614
+ & ArtifactId :: Tag ( id. to_string ( ) ) ,
610
615
& build_kinds,
611
- & run_kinds ,
616
+ & scenario_kinds ,
612
617
Compiler {
613
618
rustc : & rustc,
614
619
rustdoc : rustdoc. as_deref ( ) ,
@@ -663,7 +668,7 @@ fn main_result() -> anyhow::Result<i32> {
663
668
pool,
664
669
& ArtifactId :: Commit ( commit) ,
665
670
& BuildKind :: all ( ) ,
666
- & RunKind :: all ( ) ,
671
+ & ScenarioKind :: all ( ) ,
667
672
Compiler :: from_sysroot ( & sysroot) ,
668
673
& benchmarks,
669
674
next. runs . map ( |v| v as usize ) ,
@@ -693,10 +698,10 @@ fn main_result() -> anyhow::Result<i32> {
693
698
694
699
let pool = database:: Pool :: open ( db) ;
695
700
696
- let run_kinds = if collector:: version_supports_incremental ( toolchain) {
697
- RunKind :: all ( )
701
+ let scenario_kinds = if collector:: version_supports_incremental ( toolchain) {
702
+ ScenarioKind :: all ( )
698
703
} else {
699
- RunKind :: all_non_incr ( )
704
+ ScenarioKind :: all_non_incr ( )
700
705
} ;
701
706
let build_kinds = if collector:: version_supports_doc ( toolchain) {
702
707
BuildKind :: all ( )
@@ -731,9 +736,9 @@ fn main_result() -> anyhow::Result<i32> {
731
736
let res = bench (
732
737
& mut rt,
733
738
pool,
734
- & ArtifactId :: Artifact ( toolchain. to_string ( ) ) ,
739
+ & ArtifactId :: Tag ( toolchain. to_string ( ) ) ,
735
740
& build_kinds,
736
- & run_kinds ,
741
+ & scenario_kinds ,
737
742
Compiler {
738
743
rustc : Path :: new ( rustc. trim ( ) ) ,
739
744
rustdoc : Some ( Path :: new ( rustdoc. trim ( ) ) ) ,
@@ -761,7 +766,7 @@ fn main_result() -> anyhow::Result<i32> {
761
766
let exclude = sub_m. value_of ( "EXCLUDE" ) ;
762
767
let include = sub_m. value_of ( "INCLUDE" ) ;
763
768
let out_dir = PathBuf :: from ( sub_m. value_of_os ( "OUT_DIR" ) . unwrap_or ( default_out_dir) ) ;
764
- let run_kinds = run_kinds_from_arg ( sub_m. value_of ( "RUNS" ) ) ?;
769
+ let scenario_kinds = scenario_kinds_from_arg ( sub_m. value_of ( "RUNS" ) ) ?;
765
770
let rustdoc = sub_m. value_of ( "RUSTDOC" ) ;
766
771
767
772
let ( rustc, rustdoc, cargo) = get_local_toolchain ( & build_kinds, rustc, rustdoc, cargo) ?;
@@ -782,8 +787,13 @@ fn main_result() -> anyhow::Result<i32> {
782
787
for ( i, benchmark) in benchmarks. iter ( ) . enumerate ( ) {
783
788
eprintln ! ( "{}" , n_benchmarks_remaining( benchmarks. len( ) - i) ) ;
784
789
let mut processor = execute:: ProfileProcessor :: new ( profiler, & out_dir, & id) ;
785
- let result =
786
- benchmark. measure ( & mut processor, & build_kinds, & run_kinds, compiler, Some ( 1 ) ) ;
790
+ let result = benchmark. measure (
791
+ & mut processor,
792
+ & build_kinds,
793
+ & scenario_kinds,
794
+ compiler,
795
+ Some ( 1 ) ,
796
+ ) ;
787
797
if let Err ( ref s) = result {
788
798
errors. incr ( ) ;
789
799
eprintln ! (
0 commit comments