@@ -30,9 +30,10 @@ use tokio::runtime::Runtime;
30
30
31
31
use collector:: compile:: execute:: bencher:: BenchProcessor ;
32
32
use collector:: compile:: execute:: profiler:: { ProfileProcessor , Profiler } ;
33
+ use collector:: runtime:: profile_runtime;
33
34
use collector:: runtime:: {
34
- bench_runtime, prepare_runtime_benchmark_suite, profile_runtime , runtime_benchmark_dir ,
35
- BenchmarkFilter , BenchmarkSuite , BenchmarkSuiteCompilation , CargoIsolationMode ,
35
+ bench_runtime, prepare_runtime_benchmark_suite, runtime_benchmark_dir , BenchmarkFilter ,
36
+ BenchmarkSuite , BenchmarkSuiteCompilation , CargoIsolationMode , RuntimeProfiler ,
36
37
DEFAULT_RUNTIME_ITERATIONS ,
37
38
} ;
38
39
use collector:: toolchain:: {
@@ -496,8 +497,11 @@ enum Commands {
496
497
497
498
/// Profiles a runtime benchmark.
498
499
ProfileRuntime {
499
- #[ command( flatten) ]
500
- local : LocalOptions ,
500
+ /// Profiler to use
501
+ profiler : RuntimeProfiler ,
502
+
503
+ /// The path to the local rustc used to compile the runtime benchmark
504
+ rustc : String ,
501
505
502
506
/// Name of the benchmark that should be profiled
503
507
benchmark : String ,
@@ -682,15 +686,20 @@ fn main_result() -> anyhow::Result<i32> {
682
686
run_benchmarks ( & mut rt, conn, shared, None , Some ( config) ) ?;
683
687
Ok ( 0 )
684
688
}
685
- Commands :: ProfileRuntime { local, benchmark } => {
686
- let toolchain = get_local_toolchain_for_runtime_benchmarks ( & local, & target_triple) ?;
689
+ Commands :: ProfileRuntime {
690
+ profiler,
691
+ rustc,
692
+ benchmark,
693
+ } => {
694
+ let toolchain =
695
+ get_local_toolchain ( & [ Profile :: Opt ] , & rustc, None , None , None , "" , target_triple) ?;
687
696
let suite = prepare_runtime_benchmark_suite (
688
697
& toolchain,
689
698
& runtime_benchmark_dir,
690
699
CargoIsolationMode :: Cached ,
691
700
) ?
692
701
. suite ;
693
- profile_runtime ( suite, & benchmark) ?;
702
+ profile_runtime ( profiler , suite, & benchmark) ?;
694
703
Ok ( 0 )
695
704
}
696
705
Commands :: BenchLocal {
0 commit comments