Skip to content

Commit dc7be71

Browse files
committed
feat: pass java options benchmark
1 parent 106e731 commit dc7be71

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
@@ -41,6 +41,18 @@ pub fn get_base_injected_env(
4141
),
4242
]);
4343

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

0 commit comments

Comments
 (0)