Skip to content

Commit 278314f

Browse files
committed
feat: pass java options benchmark
1 parent 231eb88 commit 278314f

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/executor/helpers/env.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ pub fn get_base_injected_env(
4242
),
4343
]);
4444

45+
// Java: Enable frame pointers and perf map generation for flamegraph profiling.
46+
// - UnlockDiagnosticVMOptions must come before DumpPerfMapAtExit (diagnostic option).
47+
// - PreserveFramePointer: Preserves frame pointers for profiling.
48+
// - DumpPerfMapAtExit: Writes /tmp/perf-<pid>.map on JVM exit for symbol resolution.
49+
// - DebugNonSafepoints: Enables debug info for JIT-compiled non-safepoint code.
50+
if mode == RunnerMode::Walltime {
51+
env.insert(
52+
"JAVA_TOOL_OPTIONS".into(),
53+
"-XX:+PreserveFramePointer -XX:+UnlockDiagnosticVMOptions -XX:+DumpPerfMapAtExit -XX:+DebugNonSafepoints".into(),
54+
);
55+
}
56+
4557
if let Some(version) = &config.go_runner_version {
4658
env.insert("CODSPEED_GO_RUNNER_VERSION".into(), version.to_string());
4759
}

0 commit comments

Comments
 (0)