From 7e87e3c5d93390fb28e4fbd5f3859f3b20d8fc6a Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Fri, 20 Jun 2025 11:51:48 +0800 Subject: [PATCH] feat: support pass valgrind args --- src/run/runner/valgrind/measure.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/run/runner/valgrind/measure.rs b/src/run/runner/valgrind/measure.rs index 8a7b85a4..f70ecfc1 100644 --- a/src/run/runner/valgrind/measure.rs +++ b/src/run/runner/valgrind/measure.rs @@ -104,6 +104,7 @@ pub async fn measure( cmd.current_dir(abs_cwd); } // Configure valgrind + let valgrind_flags = env::var("VALGRIND_FLAGS").unwrap_or_default(); let profile_path = profile_folder.join("%p.out"); let log_path = profile_folder.join("valgrind.log"); cmd.arg("valgrind") @@ -114,7 +115,8 @@ pub async fn measure( .map(|x| format!("--obj-skip={}", x)), ) .arg(format!("--callgrind-out-file={}", profile_path.to_str().unwrap()).as_str()) - .arg(format!("--log-file={}", log_path.to_str().unwrap()).as_str()); + .arg(format!("--log-file={}", log_path.to_str().unwrap()).as_str()) + .args(valgrind_flags.split_whitespace()); // Set the command to execute: let script_path = create_run_script()?;