Skip to content

Commit 1c5ceaf

Browse files
jbachorikclaude
andcommitted
Add detailed diagnostics for process crashes
- Monitor process during warmup with 5s checks - Show last 50 lines of log on crash - Check for JVM crash logs (hs_err) - Remove JFR options that may cause issues - Add bash -x for debugging - Verify profiler library exists before starting Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ed49d74 commit 1c5ceaf

1 file changed

Lines changed: 25 additions & 8 deletions

File tree

ddprof-lib/benchmarks/branch-prediction/test_branch_prediction_perf.sh

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,20 @@ start_benchmark() {
9191
# Disable DD Java agent injection to avoid conflicts
9292
# Run in infinite loop to ensure process stays alive during all perf measurements
9393
# The benchmark will be killed by cleanup when tests complete
94+
log_info "Using profiler library: ${PROFILER_LIB}"
95+
96+
if [ ! -f "${PROFILER_LIB}" ]; then
97+
log_error "Profiler library does not exist: ${PROFILER_LIB}"
98+
exit 1
99+
fi
100+
94101
env -u JAVA_TOOL_OPTIONS \
95-
bash -c "while true; do java -agentpath:\"${PROFILER_LIB}=start,cpu,file=/tmp/test.jfr\" \
102+
bash -c "set -x; while true; do java -agentpath:\"${PROFILER_LIB}\" \
96103
-Xmx2g \
97104
-Xms2g \
98105
-jar \"${RENAISSANCE_JAR}\" \
99106
\"${benchmark}\" \
100-
-r 100; done" \
107+
-r 100 || { echo 'Java exited with status:' \$?; sleep 1; }; done" \
101108
&> /tmp/renaissance_${benchmark}.log &
102109

103110
local WRAPPER_PID=$!
@@ -119,13 +126,23 @@ start_benchmark() {
119126
log_info "Java process PID: ${JAVA_PID}"
120127

121128
log_info "Warming up for ${WARMUP} seconds..."
122-
sleep ${WARMUP}
123129

124-
# Verify still running after warmup
125-
if ! kill -0 ${JAVA_PID} 2>/dev/null; then
126-
log_error "Java process ${JAVA_PID} died during warmup. Check /tmp/renaissance_${benchmark}.log"
127-
exit 1
128-
fi
130+
# Monitor process during warmup
131+
local elapsed=0
132+
while [ $elapsed -lt ${WARMUP} ]; do
133+
if ! kill -0 ${JAVA_PID} 2>/dev/null; then
134+
log_error "Java process ${JAVA_PID} died after ${elapsed}s of warmup"
135+
log_error "Last 50 lines of /tmp/renaissance_${benchmark}.log:"
136+
tail -50 /tmp/renaissance_${benchmark}.log 2>/dev/null || echo "No log available"
137+
log_error "Checking for core dumps or crash logs..."
138+
ls -lth /tmp/hs_err_pid*.log 2>/dev/null | head -3 || echo "No hs_err logs found"
139+
exit 1
140+
fi
141+
sleep 5
142+
elapsed=$((elapsed + 5))
143+
done
144+
145+
log_info "Warmup complete, process still running"
129146
}
130147

131148
# Run perf stat to collect branch prediction statistics

0 commit comments

Comments
 (0)