Skip to content

Commit 7deb5dc

Browse files
jbachorikclaude
andcommitted
Fix benchmark duration and add process health checks
- Increase iterations from 10 to 9999 to keep benchmark running - Add checks to detect early process termination - Provide helpful error messages pointing to log files Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent ca3b296 commit 7deb5dc

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,21 +88,36 @@ start_benchmark() {
8888
log_info "Starting Renaissance benchmark: ${benchmark}"
8989

9090
# Disable DD Java agent injection to avoid conflicts
91+
# Run many iterations to keep benchmark running during perf measurement
9192
env -u JAVA_TOOL_OPTIONS \
9293
java -agentpath:"${PROFILER_LIB}=start,cpu,file=/tmp/test.jfr" \
9394
-Xmx2g \
9495
-Xms2g \
9596
-jar "${RENAISSANCE_JAR}" \
9697
"${benchmark}" \
97-
-r 10 \
98+
-r 9999 \
9899
&> /tmp/renaissance_${benchmark}.log &
99100

100101
JAVA_PID=$!
101102
echo ${JAVA_PID} > /tmp/java_perf_test.pid
102103

103104
log_info "Java process started with PID: ${JAVA_PID}"
105+
106+
# Verify process started successfully
107+
sleep 2
108+
if ! kill -0 ${JAVA_PID} 2>/dev/null; then
109+
log_error "Java process ${JAVA_PID} died immediately. Check /tmp/renaissance_${benchmark}.log"
110+
exit 1
111+
fi
112+
104113
log_info "Warming up for ${WARMUP} seconds..."
105114
sleep ${WARMUP}
115+
116+
# Verify still running after warmup
117+
if ! kill -0 ${JAVA_PID} 2>/dev/null; then
118+
log_error "Java process ${JAVA_PID} died during warmup. Check /tmp/renaissance_${benchmark}.log"
119+
exit 1
120+
fi
106121
}
107122

108123
# Run perf stat to collect branch prediction statistics

0 commit comments

Comments
 (0)