@@ -67,28 +67,28 @@ impl BuildKind {
6767}
6868
6969#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
70- pub enum RunKind {
70+ pub enum ScenarioKind {
7171 Full ,
7272 IncrFull ,
7373 IncrUnchanged ,
7474 IncrPatched ,
7575}
7676
77- impl RunKind {
78- fn all ( ) -> Vec < RunKind > {
77+ impl ScenarioKind {
78+ fn all ( ) -> Vec < ScenarioKind > {
7979 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 ,
8484 ]
8585 }
8686
87- fn all_non_incr ( ) -> Vec < RunKind > {
88- vec ! [ RunKind :: Full ]
87+ fn all_non_incr ( ) -> Vec < ScenarioKind > {
88+ vec ! [ ScenarioKind :: Full ]
8989 }
9090
91- fn default ( ) -> Vec < RunKind > {
91+ fn default ( ) -> Vec < ScenarioKind > {
9292 Self :: all ( )
9393 }
9494}
@@ -101,12 +101,12 @@ const STRINGS_AND_BUILD_KINDS: &[(&str, BuildKind)] = &[
101101 ( "Opt" , BuildKind :: Opt ) ,
102102] ;
103103
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 ) ,
110110] ;
111111
112112fn 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>> {
117117 }
118118}
119119
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 > > {
121121 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)
123123 } else {
124- Ok ( RunKind :: default ( ) )
124+ Ok ( ScenarioKind :: default ( ) )
125125 }
126126}
127127
@@ -203,7 +203,7 @@ fn bench(
203203 pool : database:: Pool ,
204204 artifact_id : & ArtifactId ,
205205 build_kinds : & [ BuildKind ] ,
206- run_kinds : & [ RunKind ] ,
206+ scenario_kinds : & [ ScenarioKind ] ,
207207 compiler : Compiler < ' _ > ,
208208 benchmarks : & [ Benchmark ] ,
209209 iterations : Option < usize > ,
@@ -269,8 +269,13 @@ fn bench(
269269 artifact_row_id,
270270 is_self_profile,
271271 ) ;
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+ ) ;
274279 if let Err ( s) = result {
275280 eprintln ! (
276281 "collector error: Failed to benchmark '{}', recorded: {:#}" ,
@@ -592,7 +597,7 @@ fn main_result() -> anyhow::Result<i32> {
592597 let db = sub_m. value_of ( "DB" ) . unwrap_or ( default_db) ;
593598 let exclude = sub_m. value_of ( "EXCLUDE" ) ;
594599 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" ) ) ?;
596601 let iterations = iterations_from_arg ( sub_m. value_of ( "ITERATIONS" ) ) ?;
597602 let rustdoc = sub_m. value_of ( "RUSTDOC" ) ;
598603 let is_self_profile = sub_m. is_present ( "SELF_PROFILE" ) ;
@@ -606,9 +611,9 @@ fn main_result() -> anyhow::Result<i32> {
606611 let res = bench (
607612 & mut rt,
608613 pool,
609- & ArtifactId :: Artifact ( id. to_string ( ) ) ,
614+ & ArtifactId :: Tag ( id. to_string ( ) ) ,
610615 & build_kinds,
611- & run_kinds ,
616+ & scenario_kinds ,
612617 Compiler {
613618 rustc : & rustc,
614619 rustdoc : rustdoc. as_deref ( ) ,
@@ -663,7 +668,7 @@ fn main_result() -> anyhow::Result<i32> {
663668 pool,
664669 & ArtifactId :: Commit ( commit) ,
665670 & BuildKind :: all ( ) ,
666- & RunKind :: all ( ) ,
671+ & ScenarioKind :: all ( ) ,
667672 Compiler :: from_sysroot ( & sysroot) ,
668673 & benchmarks,
669674 next. runs . map ( |v| v as usize ) ,
@@ -693,10 +698,10 @@ fn main_result() -> anyhow::Result<i32> {
693698
694699 let pool = database:: Pool :: open ( db) ;
695700
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 ( )
698703 } else {
699- RunKind :: all_non_incr ( )
704+ ScenarioKind :: all_non_incr ( )
700705 } ;
701706 let build_kinds = if collector:: version_supports_doc ( toolchain) {
702707 BuildKind :: all ( )
@@ -731,9 +736,9 @@ fn main_result() -> anyhow::Result<i32> {
731736 let res = bench (
732737 & mut rt,
733738 pool,
734- & ArtifactId :: Artifact ( toolchain. to_string ( ) ) ,
739+ & ArtifactId :: Tag ( toolchain. to_string ( ) ) ,
735740 & build_kinds,
736- & run_kinds ,
741+ & scenario_kinds ,
737742 Compiler {
738743 rustc : Path :: new ( rustc. trim ( ) ) ,
739744 rustdoc : Some ( Path :: new ( rustdoc. trim ( ) ) ) ,
@@ -761,7 +766,7 @@ fn main_result() -> anyhow::Result<i32> {
761766 let exclude = sub_m. value_of ( "EXCLUDE" ) ;
762767 let include = sub_m. value_of ( "INCLUDE" ) ;
763768 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" ) ) ?;
765770 let rustdoc = sub_m. value_of ( "RUSTDOC" ) ;
766771
767772 let ( rustc, rustdoc, cargo) = get_local_toolchain ( & build_kinds, rustc, rustdoc, cargo) ?;
@@ -782,8 +787,13 @@ fn main_result() -> anyhow::Result<i32> {
782787 for ( i, benchmark) in benchmarks. iter ( ) . enumerate ( ) {
783788 eprintln ! ( "{}" , n_benchmarks_remaining( benchmarks. len( ) - i) ) ;
784789 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+ ) ;
787797 if let Err ( ref s) = result {
788798 errors. incr ( ) ;
789799 eprintln ! (
0 commit comments