[PATCH 2/2] perf build: Make check-headers.sh fail on a difference

From: TAKANO Mitsuhiro

Date: Wed Nov 25 2026 - 13:09:24 EST


The script collects the stale copies in FAILURES, prints them and exits
with the status of the last echo, so `make check-headers` succeeds on a
tree whose copies are out of sync and cannot be used as a gate. This is
what it prints for a stale x86 cpufeatures.h:

Warning: Kernel ABI header differences:
diff -u tools/arch/x86/include/asm/cpufeatures.h \
arch/x86/include/asm/cpufeatures.h

Exit 1 when the array is not empty, so a caller can tell the two apart.

The list that fills the array has a typo: include/linux/list-sort.h does
not exist, the file is list_sort.h. check_2() tests the source file with
-f and skips the pair silently, so that copy was never checked. The two
files are identical today, and the pair is compared now.

Verification: with a difference in either file the script exits 1 and
names the pair; with none it exits 0 and prints nothing. Before the
change it exited 0 in both cases.

Signed-off-by: TAKANO Mitsuhiro <takano32@xxxxxxxxx>
---
tools/perf/check-headers.sh | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index 531c0e0e84df..3211e5f3dd9a 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -28,7 +28,7 @@ declare -a FILES=(
"include/vdso/unaligned.h"
"include/linux/gfp_types.h"
"include/linux/hash.h"
- "include/linux/list-sort.h"
+ "include/linux/list_sort.h"
"include/uapi/linux/hw_breakpoint.h"
"arch/x86/include/asm/cpufeatures.h"
"arch/x86/include/asm/inat_types.h"
@@ -231,4 +231,5 @@ then
do
echo " diff -u $i"
done
+ exit 1
fi
--
2.53.0