@@ -459,6 +459,14 @@ struct CompileTimeOptions {
459459 rustdoc : Option < PathBuf > ,
460460}
461461
462+ #[ derive( Debug , clap:: Args ) ]
463+ struct RuntimeOptions {
464+ /// Select a runtime benchmark group that should be compiled and used. If not specified, all
465+ /// found groups will be compiled.
466+ #[ arg( long) ]
467+ group : Option < String > ,
468+ }
469+
462470#[ derive( Debug , clap:: Args ) ]
463471struct SelfProfileOption {
464472 /// Collect self-profile data
@@ -492,6 +500,9 @@ enum Commands {
492500 #[ command( flatten) ]
493501 local : LocalOptions ,
494502
503+ #[ command( flatten) ]
504+ runtime : RuntimeOptions ,
505+
495506 /// How many iterations of each benchmark should be executed.
496507 #[ arg( long, default_value_t = DEFAULT_RUNTIME_ITERATIONS ) ]
497508 iterations : u32 ,
@@ -507,6 +518,9 @@ enum Commands {
507518
508519 /// Profiles a runtime benchmark.
509520 ProfileRuntime {
521+ #[ command( flatten) ]
522+ runtime : RuntimeOptions ,
523+
510524 /// Profiler to use
511525 profiler : RuntimeProfiler ,
512526
@@ -660,6 +674,7 @@ fn main_result() -> anyhow::Result<i32> {
660674 match args. command {
661675 Commands :: BenchRuntimeLocal {
662676 local,
677+ runtime,
663678 iterations,
664679 db,
665680 no_isolate,
@@ -680,6 +695,7 @@ fn main_result() -> anyhow::Result<i32> {
680695 conn. as_mut ( ) ,
681696 & runtime_benchmark_dir,
682697 isolation_mode,
698+ runtime. group ,
683699 & toolchain,
684700 & artifact_id,
685701 ) ) ?;
@@ -697,6 +713,7 @@ fn main_result() -> anyhow::Result<i32> {
697713 Ok ( 0 )
698714 }
699715 Commands :: ProfileRuntime {
716+ runtime,
700717 profiler,
701718 rustc,
702719 benchmark,
@@ -707,6 +724,7 @@ fn main_result() -> anyhow::Result<i32> {
707724 & toolchain,
708725 & runtime_benchmark_dir,
709726 CargoIsolationMode :: Cached ,
727+ runtime. group ,
710728 // Compile with debuginfo to have filenames and line numbers available in the
711729 // generated profiles.
712730 RuntimeCompilationOpts :: default ( ) . debug_info ( "1" ) ,
@@ -843,6 +861,7 @@ fn main_result() -> anyhow::Result<i32> {
843861 conn. as_mut ( ) ,
844862 & runtime_benchmark_dir,
845863 CargoIsolationMode :: Isolated ,
864+ None ,
846865 & toolchain,
847866 & artifact_id,
848867 ) ) ?;
@@ -1050,6 +1069,7 @@ async fn load_runtime_benchmarks(
10501069 conn : & mut dyn Connection ,
10511070 benchmark_dir : & Path ,
10521071 isolation_mode : CargoIsolationMode ,
1072+ group : Option < String > ,
10531073 toolchain : & Toolchain ,
10541074 artifact_id : & ArtifactId ,
10551075) -> anyhow:: Result < BenchmarkSuite > {
@@ -1060,6 +1080,7 @@ async fn load_runtime_benchmarks(
10601080 toolchain,
10611081 benchmark_dir,
10621082 isolation_mode,
1083+ group,
10631084 RuntimeCompilationOpts :: default ( ) ,
10641085 ) ?;
10651086
@@ -1185,6 +1206,7 @@ fn bench_published_artifact(
11851206 connection. as_mut ( ) ,
11861207 dirs. runtime ,
11871208 CargoIsolationMode :: Isolated ,
1209+ None ,
11881210 & toolchain,
11891211 & artifact_id,
11901212 ) ) ?;
0 commit comments