Skip to content

Commit 65667b5

Browse files
jbachorikclaude
andcommitted
Ignore non-zero exit from perf record due to kernel warnings
Kernel symbol warnings cause perf record to exit non-zero even when data is collected successfully. Check for output file instead. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 6b3ac11 commit 65667b5

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

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

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,20 @@ run_perf_record() {
165165

166166
log_info "Running perf record for ${DURATION} seconds..."
167167

168+
# perf record may return non-zero due to kernel symbol warnings, which are harmless
168169
perf record -e L1-icache-load-misses,branch-misses \
169170
-g -F 999 \
170171
-p ${pid} \
171172
-o "${output_file}" \
172-
-- sleep ${DURATION}
173+
-- sleep ${DURATION} || {
174+
log_warn "perf record exited with status $?, but may have collected data"
175+
}
176+
177+
# Verify we got some data
178+
if [ ! -f "${output_file}" ] || [ ! -s "${output_file}" ]; then
179+
log_error "perf record did not produce data file ${output_file}"
180+
return 1
181+
fi
173182

174183
log_info "perf record data saved to ${output_file}"
175184

0 commit comments

Comments
 (0)