Skip to content

Commit 861e02c

Browse files
chore: log valgrind logs on process error
1 parent d6b498f commit 861e02c

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/run/runner/valgrind/measure.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn measure(
8383
.map(|x| format!("--obj-skip={}", x)),
8484
)
8585
.arg(format!("--callgrind-out-file={}", profile_path.to_str().unwrap()).as_str())
86-
.arg(format!("--log-file={}", log_path.to_str().unwrap()).as_str());
86+
.arg(format!("--log-file={}", log_path.as_path().to_str().unwrap()).as_str());
8787

8888
// Set the command to execute
8989
cmd.args(["sh", "-c", get_bench_command(config)?.as_str()]);
@@ -97,6 +97,9 @@ pub fn measure(
9797
let status = run_command_with_log_pipe(cmd)
9898
.map_err(|e| anyhow!("failed to execute the benchmark process. {}", e))?;
9999
if !status.success() {
100+
let log_content = std::fs::read_to_string(&log_path)
101+
.unwrap_or_else(|_| "failed to read the valgrind log".to_string());
102+
warn!("Valgrind logs:\n{}", log_content);
100103
bail!("failed to execute the benchmark process");
101104
}
102105

0 commit comments

Comments
 (0)