@@ -18,6 +18,7 @@ pub fn bench_runtime(
18
18
id : Option < & str > ,
19
19
filter : BenchmarkFilter ,
20
20
benchmark_dir : PathBuf ,
21
+ iterations : u32 ,
21
22
) -> anyhow:: Result < ( ) > {
22
23
let toolchain = get_local_toolchain ( & [ Profile :: Opt ] , rustc, None , None , id, "" ) ?;
23
24
let suite = benchmark:: discover_benchmarks ( & toolchain, & benchmark_dir) ?;
@@ -32,7 +33,7 @@ pub fn bench_runtime(
32
33
33
34
let mut benchmark_index = 0 ;
34
35
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 ) ? {
36
37
let message = message. map_err ( |err| {
37
38
anyhow:: anyhow!(
38
39
"Cannot parse BenchmarkMessage from benchmark {}: {err:?}" ,
@@ -64,13 +65,16 @@ pub fn bench_runtime(
64
65
fn execute_runtime_benchmark_binary (
65
66
binary : & Path ,
66
67
filter : & BenchmarkFilter ,
68
+ iterations : u32 ,
67
69
) -> anyhow:: Result < impl Iterator < Item = anyhow:: Result < BenchmarkMessage > > > {
68
70
// Turn off ASLR
69
71
let mut command = Command :: new ( "setarch" ) ;
70
72
command. arg ( std:: env:: consts:: ARCH ) ;
71
73
command. arg ( "-R" ) ;
72
74
command. arg ( binary) ;
73
75
command. arg ( "run" ) ;
76
+ command. arg ( "--iterations" ) ;
77
+ command. arg ( & iterations. to_string ( ) ) ;
74
78
75
79
if let Some ( ref exclude) = filter. exclude {
76
80
command. args ( & [ "--exclude" , exclude] ) ;
0 commit comments