Add a consistency check between the generated arm64 unistd_64.h header
and the one stored under tools. This helps ensure that the syscall
definitions remain aligned with the kernel.
The new check reports mismatch such as:
diff -u tools/arch/arm64/include/uapi/asm/unistd_64.h /tmp/tmp.BYFZqJfzCC/generated/unistd_64.h
Signed-off-by: Leo Yan <leo.yan@arm.com>
---
tools/perf/check-headers.sh | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/perf/check-headers.sh b/tools/perf/check-headers.sh
index e0537f275da2f79ea9e05b91300aa1e2f996e9f1..ebc09db1c6055bd29a7d8a4d7aba29e76a19cf5d 100755
--- a/tools/perf/check-headers.sh
+++ b/tools/perf/check-headers.sh
@@ -211,6 +211,15 @@ check_2 tools/perf/arch/parisc/entry/syscalls/syscall.tbl arch/parisc/entry/sysc
check_2 tools/perf/arch/arm64/entry/syscalls/syscall_32.tbl arch/arm64/entry/syscalls/syscall_32.tbl
check_2 tools/perf/arch/arm64/entry/syscalls/syscall_64.tbl arch/arm64/entry/syscalls/syscall_64.tbl
+# Generate Arm64's unistd_64.h dynamically and compare it with the one in tools.
+if tmpdir=$(mktemp -d); then
+ make -f scripts/Makefile.asm-headers srctree=$PWD SRCARCH=arm64 \
+ obj=$tmpdir/generated generic=include/uapi/asm-generic \
+ $tmpdir/generated/unistd_64.h > /dev/null
+ check_2 tools/arch/arm64/include/uapi/asm/unistd_64.h $tmpdir/generated/unistd_64.h
+ rm -rf $tmpdir
+fi
+
for i in "${BEAUTY_FILES[@]}"
do
beauty_check "$i" -B
--
2.34.1