@@ -30,9 +30,10 @@ use tokio::runtime::Runtime;
3030
3131use collector:: compile:: execute:: bencher:: BenchProcessor ;
3232use collector:: compile:: execute:: profiler:: { ProfileProcessor , Profiler } ;
33+ use collector:: runtime:: profile_runtime;
3334use 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 ,
3637 DEFAULT_RUNTIME_ITERATIONS ,
3738} ;
3839use collector:: toolchain:: {
@@ -496,8 +497,11 @@ enum Commands {
496497
497498 /// Profiles a runtime benchmark.
498499 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 ,
501505
502506 /// Name of the benchmark that should be profiled
503507 benchmark : String ,
@@ -682,15 +686,20 @@ fn main_result() -> anyhow::Result<i32> {
682686 run_benchmarks ( & mut rt, conn, shared, None , Some ( config) ) ?;
683687 Ok ( 0 )
684688 }
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) ?;
687696 let suite = prepare_runtime_benchmark_suite (
688697 & toolchain,
689698 & runtime_benchmark_dir,
690699 CargoIsolationMode :: Cached ,
691700 ) ?
692701 . suite ;
693- profile_runtime ( suite, & benchmark) ?;
702+ profile_runtime ( profiler , suite, & benchmark) ?;
694703 Ok ( 0 )
695704 }
696705 Commands :: BenchLocal {
0 commit comments