Skip to content

Commit 6b3ac11

Browse files
jbachorikclaude
andcommitted
Make perf report generation non-fatal
perf report may fail if no samples match the filter. Don't fail the entire test if report generation fails. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 7103e13 commit 6b3ac11

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,16 @@ run_perf_record() {
173173

174174
log_info "perf record data saved to ${output_file}"
175175

176-
# Generate report focused on our library
176+
# Generate report focused on our library (non-fatal if it fails)
177177
log_info "Generating perf report for libjavaProfiler.so..."
178-
perf report -i "${output_file}" \
178+
if perf report -i "${output_file}" \
179179
--dsos=libjavaProfiler.so \
180180
--stdio \
181-
> "${output_file%.data}_report.txt"
182-
183-
log_info "Report saved to ${output_file%.data}_report.txt"
181+
> "${output_file%.data}_report.txt" 2>&1; then
182+
log_info "Report saved to ${output_file%.data}_report.txt"
183+
else
184+
log_warn "perf report failed or found no samples for libjavaProfiler.so"
185+
fi
184186
}
185187

186188
# Stop the benchmark

0 commit comments

Comments
 (0)