@@ -459,6 +459,14 @@ struct CompileTimeOptions {
459
459
rustdoc : Option < PathBuf > ,
460
460
}
461
461
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
+
462
470
#[ derive( Debug , clap:: Args ) ]
463
471
struct SelfProfileOption {
464
472
/// Collect self-profile data
@@ -492,6 +500,9 @@ enum Commands {
492
500
#[ command( flatten) ]
493
501
local : LocalOptions ,
494
502
503
+ #[ command( flatten) ]
504
+ runtime : RuntimeOptions ,
505
+
495
506
/// How many iterations of each benchmark should be executed.
496
507
#[ arg( long, default_value_t = DEFAULT_RUNTIME_ITERATIONS ) ]
497
508
iterations : u32 ,
@@ -507,6 +518,9 @@ enum Commands {
507
518
508
519
/// Profiles a runtime benchmark.
509
520
ProfileRuntime {
521
+ #[ command( flatten) ]
522
+ runtime : RuntimeOptions ,
523
+
510
524
/// Profiler to use
511
525
profiler : RuntimeProfiler ,
512
526
@@ -660,6 +674,7 @@ fn main_result() -> anyhow::Result<i32> {
660
674
match args. command {
661
675
Commands :: BenchRuntimeLocal {
662
676
local,
677
+ runtime,
663
678
iterations,
664
679
db,
665
680
no_isolate,
@@ -680,6 +695,7 @@ fn main_result() -> anyhow::Result<i32> {
680
695
conn. as_mut ( ) ,
681
696
& runtime_benchmark_dir,
682
697
isolation_mode,
698
+ runtime. group ,
683
699
& toolchain,
684
700
& artifact_id,
685
701
) ) ?;
@@ -697,6 +713,7 @@ fn main_result() -> anyhow::Result<i32> {
697
713
Ok ( 0 )
698
714
}
699
715
Commands :: ProfileRuntime {
716
+ runtime,
700
717
profiler,
701
718
rustc,
702
719
benchmark,
@@ -707,6 +724,7 @@ fn main_result() -> anyhow::Result<i32> {
707
724
& toolchain,
708
725
& runtime_benchmark_dir,
709
726
CargoIsolationMode :: Cached ,
727
+ runtime. group ,
710
728
// Compile with debuginfo to have filenames and line numbers available in the
711
729
// generated profiles.
712
730
RuntimeCompilationOpts :: default ( ) . debug_info ( "1" ) ,
@@ -843,6 +861,7 @@ fn main_result() -> anyhow::Result<i32> {
843
861
conn. as_mut ( ) ,
844
862
& runtime_benchmark_dir,
845
863
CargoIsolationMode :: Isolated ,
864
+ None ,
846
865
& toolchain,
847
866
& artifact_id,
848
867
) ) ?;
@@ -1050,6 +1069,7 @@ async fn load_runtime_benchmarks(
1050
1069
conn : & mut dyn Connection ,
1051
1070
benchmark_dir : & Path ,
1052
1071
isolation_mode : CargoIsolationMode ,
1072
+ group : Option < String > ,
1053
1073
toolchain : & Toolchain ,
1054
1074
artifact_id : & ArtifactId ,
1055
1075
) -> anyhow:: Result < BenchmarkSuite > {
@@ -1060,6 +1080,7 @@ async fn load_runtime_benchmarks(
1060
1080
toolchain,
1061
1081
benchmark_dir,
1062
1082
isolation_mode,
1083
+ group,
1063
1084
RuntimeCompilationOpts :: default ( ) ,
1064
1085
) ?;
1065
1086
@@ -1185,6 +1206,7 @@ fn bench_published_artifact(
1185
1206
connection. as_mut ( ) ,
1186
1207
dirs. runtime ,
1187
1208
CargoIsolationMode :: Isolated ,
1209
+ None ,
1188
1210
& toolchain,
1189
1211
& artifact_id,
1190
1212
) ) ?;
0 commit comments