@@ -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 output = compile_runtime_benchmark_binaries ( & toolchain, & benchmark_dir) ?;
@@ -33,7 +34,7 @@ pub fn bench_runtime(
33
34
34
35
let mut benchmark_index = 0 ;
35
36
for binary in suite. groups {
36
- for message in execute_runtime_benchmark_binary ( & binary. binary , & filter) ? {
37
+ for message in execute_runtime_benchmark_binary ( & binary. binary , & filter, iterations ) ? {
37
38
let message = message. map_err ( |err| {
38
39
anyhow:: anyhow!(
39
40
"Cannot parse BenchmarkMessage from benchmark {}: {err:?}" ,
@@ -65,13 +66,16 @@ pub fn bench_runtime(
65
66
fn execute_runtime_benchmark_binary (
66
67
binary : & Path ,
67
68
filter : & BenchmarkFilter ,
69
+ iterations : u32 ,
68
70
) -> anyhow:: Result < impl Iterator < Item = anyhow:: Result < BenchmarkMessage > > > {
69
71
// Turn off ASLR
70
72
let mut command = Command :: new ( "setarch" ) ;
71
73
command. arg ( std:: env:: consts:: ARCH ) ;
72
74
command. arg ( "-R" ) ;
73
75
command. arg ( binary) ;
74
76
command. arg ( "run" ) ;
77
+ command. arg ( "--iterations" ) ;
78
+ command. arg ( & iterations. to_string ( ) ) ;
75
79
76
80
if let Some ( ref exclude) = filter. exclude {
77
81
command. args ( & [ "--exclude" , exclude] ) ;
0 commit comments