summaryrefslogtreecommitdiffstats
path: root/tools/objtool/sync-check.sh
diff options
context:
space:
mode:
authorJosh Poimboeuf2017-11-06 14:21:51 +0100
committerIngo Molnar2017-11-07 10:48:34 +0100
commit3bd51c5a371de917e4e7401c9df006b5998579df (patch)
tree03b8997b2fce9066a159a56c069596cd5bb14b82 /tools/objtool/sync-check.sh
parentobjtool: Move synced files to their original relative locations (diff)
downloadkernel-qcow2-linux-3bd51c5a371de917e4e7401c9df006b5998579df.tar.gz
kernel-qcow2-linux-3bd51c5a371de917e4e7401c9df006b5998579df.tar.xz
kernel-qcow2-linux-3bd51c5a371de917e4e7401c9df006b5998579df.zip
objtool: Move kernel headers/code sync check to a script
Replace the nasty diff checks in the objtool Makefile with a clean bash script, and make the warnings more specific. Heavily inspired by tools/perf/check-headers.sh. Suggested-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Link: http://lkml.kernel.org/r/ab015f15ccd8c0c6008493c3c6ee3d495eaf2927.1509974346.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/objtool/sync-check.sh')
-rwxr-xr-xtools/objtool/sync-check.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/objtool/sync-check.sh b/tools/objtool/sync-check.sh
new file mode 100755
index 000000000000..1470e74e9d66
--- /dev/null
+++ b/tools/objtool/sync-check.sh
@@ -0,0 +1,29 @@
+#!/bin/sh
+# SPDX-License-Identifier: GPL-2.0
+
+FILES='
+arch/x86/lib/insn.c
+arch/x86/lib/inat.c
+arch/x86/lib/x86-opcode-map.txt
+arch/x86/tools/gen-insn-attr-x86.awk
+arch/x86/include/asm/insn.h
+arch/x86/include/asm/inat.h
+arch/x86/include/asm/inat_types.h
+arch/x86/include/asm/orc_types.h
+'
+
+check()
+{
+ local file=$1
+
+ diff $file ../../$file > /dev/null ||
+ echo "Warning: synced file at 'tools/objtool/$file' differs from latest kernel version at '$file'"
+}
+
+if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
+ exit 0
+fi
+
+for i in $FILES; do
+ check $i
+done