@@ -18,6 +18,7 @@ pub fn bench_runtime(
1818 id : Option < & str > ,
1919 filter : BenchmarkFilter ,
2020 benchmark_dir : PathBuf ,
21+ iterations : u32 ,
2122) -> anyhow:: Result < ( ) > {
2223 let toolchain = get_local_toolchain ( & [ Profile :: Opt ] , rustc, None , None , id, "" ) ?;
2324 let suite = benchmark:: discover_benchmarks ( & toolchain, & benchmark_dir) ?;
@@ -32,7 +33,7 @@ pub fn bench_runtime(
3233
3334 let mut benchmark_index = 0 ;
3435 for binary in suite. groups {
35- for message in execute_runtime_benchmark_binary ( & binary. binary , & filter) ? {
36+ for message in execute_runtime_benchmark_binary ( & binary. binary , & filter, iterations ) ? {
3637 let message = message. map_err ( |err| {
3738 anyhow:: anyhow!(
3839 "Cannot parse BenchmarkMessage from benchmark {}: {err:?}" ,
@@ -64,13 +65,16 @@ pub fn bench_runtime(
6465fn execute_runtime_benchmark_binary (
6566 binary : & Path ,
6667 filter : & BenchmarkFilter ,
68+ iterations : u32 ,
6769) -> anyhow:: Result < impl Iterator < Item = anyhow:: Result < BenchmarkMessage > > > {
6870 // Turn off ASLR
6971 let mut command = Command :: new ( "setarch" ) ;
7072 command. arg ( std:: env:: consts:: ARCH ) ;
7173 command. arg ( "-R" ) ;
7274 command. arg ( binary) ;
7375 command. arg ( "run" ) ;
76+ command. arg ( "--iterations" ) ;
77+ command. arg ( & iterations. to_string ( ) ) ;
7478
7579 if let Some ( ref exclude) = filter. exclude {
7680 command. args ( & [ "--exclude" , exclude] ) ;
0 commit comments