Skip to content

Commit 2ffd84a

Browse files
committed
objtool: Update sync-check.sh from perf's check-headers.sh
To allow using the -I trick that will be needed for checking the x86 insn decoder files. Without the specific -I lines we still get the same warnings as before: $ make -C tools/objtool/ clean ; make -C tools/objtool/ make: Entering directory '/home/acme/git/perf/tools/objtool' CLEAN objtool find -name '*.o' -delete -o -name '\.*.cmd' -delete -o -name '\.*.d' -delete rm -f arch/x86/inat-tables.c fixdep <SNIP> LD objtool-in.o make[1]: Leaving directory '/home/acme/git/perf/tools/objtool' Warning: Kernel ABI header at 'tools/arch/x86/include/asm/inat.h' differs from latest version at 'arch/x86/include/asm/inat.h' diff -u tools/arch/x86/include/asm/inat.h arch/x86/include/asm/inat.h Warning: Kernel ABI header at 'tools/arch/x86/include/asm/insn.h' differs from latest version at 'arch/x86/include/asm/insn.h' diff -u tools/arch/x86/include/asm/insn.h arch/x86/include/asm/insn.h Warning: Kernel ABI header at 'tools/arch/x86/lib/inat.c' differs from latest version at 'arch/x86/lib/inat.c' diff -u tools/arch/x86/lib/inat.c arch/x86/lib/inat.c Warning: Kernel ABI header at 'tools/arch/x86/lib/insn.c' differs from latest version at 'arch/x86/lib/insn.c' diff -u tools/arch/x86/lib/insn.c arch/x86/lib/insn.c /home/acme/git/perf/tools/objtool LINK objtool make: Leaving directory '/home/acme/git/perf/tools/objtool' $ The next patch will add the -I lines for those files. Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> Link: http://lore.kernel.org/lkml/20190830193109.p7jagidsrahoa4pn@treble Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/n/tip-vu3p38mnxlwd80rlsnjkqcf2@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 87a682a commit 2ffd84a

1 file changed

Lines changed: 26 additions & 5 deletions

File tree

‎tools/objtool/sync-check.sh‎

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,39 @@ arch/x86/lib/x86-opcode-map.txt
1212
arch/x86/tools/gen-insn-attr-x86.awk
1313
'
1414

15-
check()
16-
{
17-
local file=$1
15+
check_2 () {
16+
file1=$1
17+
file2=$2
1818

19-
diff ../$file ../../$file > /dev/null ||
20-
echo "Warning: synced file at 'tools/objtool/$file' differs from latest kernel version at '$file'"
19+
shift
20+
shift
21+
22+
cmd="diff $* $file1 $file2 > /dev/null"
23+
24+
test -f $file2 && {
25+
eval $cmd || {
26+
echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
27+
echo diff -u $file1 $file2
28+
}
29+
}
30+
}
31+
32+
check () {
33+
file=$1
34+
35+
shift
36+
37+
check_2 tools/$file $file $*
2138
}
2239

2340
if [ ! -d ../../kernel ] || [ ! -d ../../tools ] || [ ! -d ../objtool ]; then
2441
exit 0
2542
fi
2643

44+
cd ../..
45+
2746
for i in $FILES; do
2847
check $i
2948
done
49+
50+
cd -

0 commit comments

Comments
 (0)