Skip to content

Commit 9c1ca5a

Browse files
committed
feat: support pass valgrind args
1 parent d706f21 commit 9c1ca5a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/executor/valgrind/measure.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ pub async fn measure(
117117
cmd.current_dir(abs_cwd);
118118
}
119119
// Configure valgrind
120+
let valgrind_flags = env::var("VALGRIND_FLAGS").unwrap_or_default();
120121
let profile_path = profile_folder.join("%p.out");
121122
let log_path = profile_folder.join("valgrind.log");
122123
cmd.arg("valgrind")
@@ -127,7 +128,8 @@ pub async fn measure(
127128
.map(|x| format!("--obj-skip={x}")),
128129
)
129130
.arg(format!("--callgrind-out-file={}", profile_path.to_str().unwrap()).as_str())
130-
.arg(format!("--log-file={}", log_path.to_str().unwrap()).as_str());
131+
.arg(format!("--log-file={}", log_path.to_str().unwrap()).as_str())
132+
.args(valgrind_flags.split_whitespace());
131133

132134
// Set the command to execute:
133135
let script_path = create_run_script()?;

0 commit comments

Comments
 (0)