Skip to content

Commit 203609b

Browse files
committed
Pass cargo from CLI args to runtime benchmarks
1 parent 44acae3 commit 203609b

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

collector/src/bin/collector.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,16 @@ fn main_result() -> anyhow::Result<i32> {
704704

705705
match args.command {
706706
Commands::BenchRuntimeLocal { local, iterations } => {
707-
bench_runtime(
707+
let toolchain = get_local_toolchain(
708+
&[Profile::Opt],
708709
&local.rustc,
710+
None,
711+
local.cargo.as_deref(),
709712
local.id.as_deref(),
713+
"",
714+
)?;
715+
bench_runtime(
716+
toolchain,
710717
BenchmarkFilter::new(local.exclude, local.include),
711718
runtime_benchmark_dir,
712719
iterations,

collector/src/runtime/mod.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
mod benchmark;
22

3-
use crate::benchmark::profile::Profile;
4-
use crate::toolchain::get_local_toolchain;
3+
use crate::toolchain::LocalToolchain;
54
use benchlib::comm::messages::{BenchmarkMessage, BenchmarkResult, BenchmarkStats};
65
use std::io::{BufRead, BufReader};
76
use std::path::{Path, PathBuf};
@@ -14,13 +13,11 @@ pub use benchmark::BenchmarkFilter;
1413
/// to a Cargo crate. All binaries built by that crate will are expected to be runtime benchmark
1514
/// groups that leverage `benchlib`.
1615
pub fn bench_runtime(
17-
rustc: &str,
18-
id: Option<&str>,
16+
toolchain: LocalToolchain,
1917
filter: BenchmarkFilter,
2018
benchmark_dir: PathBuf,
2119
iterations: u32,
2220
) -> anyhow::Result<()> {
23-
let toolchain = get_local_toolchain(&[Profile::Opt], rustc, None, None, id, "")?;
2421
let suite = benchmark::discover_benchmarks(&toolchain, &benchmark_dir)?;
2522

2623
let total_benchmark_count = suite.total_benchmark_count();

0 commit comments

Comments
 (0)