blob: 68039a96c1dcaa7a2b9c5f54882ce39b98c71b0e [file] [log] [blame]
Jiri Olsaaeafd622016-12-06 14:18:51 +01001#!/bin/sh
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01002# SPDX-License-Identifier: GPL-2.0
Jiri Olsaaeafd622016-12-06 14:18:51 +01003
Josh Poimboeuf00a26392019-08-29 17:41:21 -05004FILES='
Arnaldo Carvalho de Meloaaa6ef82019-08-19 11:00:54 -03005include/uapi/linux/const.h
Arnaldo Carvalho de Meloc1737f22017-07-31 16:45:32 -03006include/uapi/drm/drm.h
7include/uapi/drm/i915_drm.h
Arnaldo Carvalho de Melof9cdd632018-12-18 16:15:53 -03008include/uapi/linux/fadvise.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -03009include/uapi/linux/fcntl.h
Arnaldo Carvalho de Melof443f382018-10-24 14:31:12 -030010include/uapi/linux/fs.h
Arnaldo Carvalho de Melo0ae40612019-09-27 12:01:26 -030011include/uapi/linux/fscrypt.h
Arnaldo Carvalho de Melo735e2152017-10-31 10:04:11 -030012include/uapi/linux/kcmp.h
Arnaldo Carvalho de Melo3ce97512017-07-31 16:45:32 -030013include/uapi/linux/kvm.h
Arnaldo Carvalho de Meloa4b20612018-07-26 09:26:13 -030014include/uapi/linux/in.h
Arnaldo Carvalho de Melo250bfc82019-01-08 13:42:37 -030015include/uapi/linux/mount.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010016include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43372792017-10-26 14:41:01 -030017include/uapi/linux/prctl.h
Arnaldo Carvalho de Melo450c86c2017-07-20 10:46:34 -030018include/uapi/linux/sched.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -030019include/uapi/linux/stat.h
Arnaldo Carvalho de Melo2bd71d12018-12-27 14:18:13 -030020include/uapi/linux/usbdevice_fs.h
Arnaldo Carvalho de Melod02b3952017-07-31 16:45:32 -030021include/uapi/linux/vhost.h
Arnaldo Carvalho de Meloa215684e2017-07-31 16:45:32 -030022include/uapi/sound/asound.h
Arnaldo Carvalho de Meloba4aa022018-09-25 10:55:59 -030023include/linux/bits.h
Arnaldo Carvalho de Meloaaa6ef82019-08-19 11:00:54 -030024include/linux/const.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010025include/linux/hash.h
26include/uapi/linux/hw_breakpoint.h
27arch/x86/include/asm/disabled-features.h
28arch/x86/include/asm/required-features.h
29arch/x86/include/asm/cpufeatures.h
Josh Poimboeuf00a26392019-08-29 17:41:21 -050030arch/x86/include/asm/inat_types.h
Masami Hiramatsu4d65adf2019-09-06 22:14:10 +090031arch/x86/include/asm/emulate_prefix.h
Arnaldo Carvalho de Melod2b72b72019-10-15 15:40:23 -030032arch/x86/include/asm/irq_vectors.h
Arnaldo Carvalho de Melo444e2ff2019-09-26 15:26:39 -030033arch/x86/include/asm/msr-index.h
Arnaldo Carvalho de Meloc22e2682018-12-17 16:15:27 -030034arch/x86/include/uapi/asm/prctl.h
Josh Poimboeuf00a26392019-08-29 17:41:21 -050035arch/x86/lib/x86-opcode-map.txt
36arch/x86/tools/gen-insn-attr-x86.awk
Jiri Olsaaeafd622016-12-06 14:18:51 +010037arch/arm/include/uapi/asm/perf_regs.h
38arch/arm64/include/uapi/asm/perf_regs.h
39arch/powerpc/include/uapi/asm/perf_regs.h
Arnaldo Carvalho de Melo10b9baa2017-11-28 11:08:41 -030040arch/s390/include/uapi/asm/perf_regs.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010041arch/x86/include/uapi/asm/perf_regs.h
42arch/x86/include/uapi/asm/kvm.h
43arch/x86/include/uapi/asm/kvm_perf.h
44arch/x86/include/uapi/asm/svm.h
Arnaldo Carvalho de Melo047726d2017-07-18 17:09:21 -030045arch/x86/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010046arch/x86/include/uapi/asm/vmx.h
47arch/powerpc/include/uapi/asm/kvm.h
48arch/s390/include/uapi/asm/kvm.h
49arch/s390/include/uapi/asm/kvm_perf.h
Hendrik Bruecknera81c4212017-12-04 10:56:49 +010050arch/s390/include/uapi/asm/ptrace.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010051arch/s390/include/uapi/asm/sie.h
52arch/arm/include/uapi/asm/kvm.h
53arch/arm64/include/uapi/asm/kvm.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050054arch/arm64/include/uapi/asm/unistd.h
Hendrik Brueckner95f28192018-01-19 09:56:13 +010055arch/alpha/include/uapi/asm/errno.h
56arch/mips/include/asm/errno.h
57arch/mips/include/uapi/asm/errno.h
58arch/parisc/include/uapi/asm/errno.h
59arch/powerpc/include/uapi/asm/errno.h
60arch/sparc/include/uapi/asm/errno.h
61arch/x86/include/uapi/asm/errno.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010062include/asm-generic/bitops/arch_hweight.h
63include/asm-generic/bitops/const_hweight.h
64include/asm-generic/bitops/__fls.h
65include/asm-generic/bitops/fls.h
66include/asm-generic/bitops/fls64.h
67include/linux/coresight-pmu.h
Hendrik Brueckner28b8f952018-01-19 09:56:14 +010068include/uapi/asm-generic/errno.h
69include/uapi/asm-generic/errno-base.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030070include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010071include/uapi/asm-generic/mman-common.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050072include/uapi/asm-generic/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010073'
74
Jiri Olsa582472972018-04-23 11:08:16 +020075check_2 () {
76 file1=$1
77 file2=$2
78
79 shift
80 shift
81
82 cmd="diff $* $file1 $file2 > /dev/null"
83
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030084 test -f $file2 && {
85 eval $cmd || {
Jiri Olsa7ea6e982018-08-13 13:15:03 +020086 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
87 echo diff -u $file1 $file2
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030088 }
89 }
Jiri Olsa582472972018-04-23 11:08:16 +020090}
91
Jiri Olsaaeafd622016-12-06 14:18:51 +010092check () {
93 file=$1
Jiri Olsaaeafd622016-12-06 14:18:51 +010094
95 shift
Jiri Olsaaeafd622016-12-06 14:18:51 +010096
Jiri Olsa7ea6e982018-08-13 13:15:03 +020097 check_2 tools/$file $file $*
Jiri Olsaaeafd622016-12-06 14:18:51 +010098}
99
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -0300100# Check if we have the kernel headers (tools/perf/../../include), else
101# we're probably on a detached tarball, so no point in trying to check
102# differences.
103test -d ../../include || exit 0
104
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200105cd ../..
106
Jiri Olsaaeafd622016-12-06 14:18:51 +0100107# simple diff check
Josh Poimboeuf00a26392019-08-29 17:41:21 -0500108for i in $FILES; do
Jiri Olsaaeafd622016-12-06 14:18:51 +0100109 check $i -B
110done
111
112# diff with extra ignore lines
Arnaldo Carvalho de Melobd5c6b82019-12-02 11:40:57 -0300113check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"'
114check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"'
Arnaldo Carvalho de Melobe709d42019-03-25 14:06:07 -0300115check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
Jiri Olsa15019e92018-04-23 11:08:15 +0200116check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"'
Arnaldo Carvalho de Melo3052ba52019-06-25 17:27:31 -0300117check include/linux/ctype.h '-I "isdigit("'
118check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B'
Arnaldo Carvalho de Melo87a682a2019-08-31 17:14:19 -0300119check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
120check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
121check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
Masami Hiramatsu4d65adf2019-09-06 22:14:10 +0900122check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"'
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200123
Jiri Olsac9b51a02018-08-13 13:15:04 +0200124# diff non-symmetric files
125check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
126
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200127cd tools/perf