blob: 466540ee8ea79f18743658bd76903531829cfffb [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
4HEADERS='
Arnaldo Carvalho de Meloc1737f22017-07-31 16:45:32 -03005include/uapi/drm/drm.h
6include/uapi/drm/i915_drm.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -03007include/uapi/linux/fcntl.h
Arnaldo Carvalho de Melo735e2152017-10-31 10:04:11 -03008include/uapi/linux/kcmp.h
Arnaldo Carvalho de Melo3ce97512017-07-31 16:45:32 -03009include/uapi/linux/kvm.h
Arnaldo Carvalho de Meloa4b20612018-07-26 09:26:13 -030010include/uapi/linux/in.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010011include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43372792017-10-26 14:41:01 -030012include/uapi/linux/prctl.h
Arnaldo Carvalho de Melo450c86c2017-07-20 10:46:34 -030013include/uapi/linux/sched.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -030014include/uapi/linux/stat.h
Arnaldo Carvalho de Melod02b3952017-07-31 16:45:32 -030015include/uapi/linux/vhost.h
Arnaldo Carvalho de Meloa215684e2017-07-31 16:45:32 -030016include/uapi/sound/asound.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010017include/linux/hash.h
18include/uapi/linux/hw_breakpoint.h
19arch/x86/include/asm/disabled-features.h
20arch/x86/include/asm/required-features.h
21arch/x86/include/asm/cpufeatures.h
22arch/arm/include/uapi/asm/perf_regs.h
23arch/arm64/include/uapi/asm/perf_regs.h
24arch/powerpc/include/uapi/asm/perf_regs.h
Arnaldo Carvalho de Melo10b9baa2017-11-28 11:08:41 -030025arch/s390/include/uapi/asm/perf_regs.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010026arch/x86/include/uapi/asm/perf_regs.h
27arch/x86/include/uapi/asm/kvm.h
28arch/x86/include/uapi/asm/kvm_perf.h
29arch/x86/include/uapi/asm/svm.h
Arnaldo Carvalho de Melo047726d2017-07-18 17:09:21 -030030arch/x86/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010031arch/x86/include/uapi/asm/vmx.h
32arch/powerpc/include/uapi/asm/kvm.h
33arch/s390/include/uapi/asm/kvm.h
34arch/s390/include/uapi/asm/kvm_perf.h
Hendrik Bruecknera81c4212017-12-04 10:56:49 +010035arch/s390/include/uapi/asm/ptrace.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010036arch/s390/include/uapi/asm/sie.h
37arch/arm/include/uapi/asm/kvm.h
38arch/arm64/include/uapi/asm/kvm.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050039arch/arm64/include/uapi/asm/unistd.h
Hendrik Brueckner95f28192018-01-19 09:56:13 +010040arch/alpha/include/uapi/asm/errno.h
41arch/mips/include/asm/errno.h
42arch/mips/include/uapi/asm/errno.h
43arch/parisc/include/uapi/asm/errno.h
44arch/powerpc/include/uapi/asm/errno.h
45arch/sparc/include/uapi/asm/errno.h
46arch/x86/include/uapi/asm/errno.h
Ravi Bangoria1350fb72018-01-29 14:04:15 +053047arch/powerpc/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010048include/asm-generic/bitops/arch_hweight.h
49include/asm-generic/bitops/const_hweight.h
50include/asm-generic/bitops/__fls.h
51include/asm-generic/bitops/fls.h
52include/asm-generic/bitops/fls64.h
53include/linux/coresight-pmu.h
Hendrik Brueckner28b8f952018-01-19 09:56:14 +010054include/uapi/asm-generic/errno.h
55include/uapi/asm-generic/errno-base.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030056include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010057include/uapi/asm-generic/mman-common.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050058include/uapi/asm-generic/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010059'
60
Jiri Olsa582472972018-04-23 11:08:16 +020061check_2 () {
62 file1=$1
63 file2=$2
64
65 shift
66 shift
67
68 cmd="diff $* $file1 $file2 > /dev/null"
69
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030070 test -f $file2 && {
71 eval $cmd || {
Jiri Olsa7ea6e982018-08-13 13:15:03 +020072 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
73 echo diff -u $file1 $file2
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030074 }
75 }
Jiri Olsa582472972018-04-23 11:08:16 +020076}
77
Jiri Olsaaeafd622016-12-06 14:18:51 +010078check () {
79 file=$1
Jiri Olsaaeafd622016-12-06 14:18:51 +010080
81 shift
Jiri Olsaaeafd622016-12-06 14:18:51 +010082
Jiri Olsa7ea6e982018-08-13 13:15:03 +020083 check_2 tools/$file $file $*
Jiri Olsaaeafd622016-12-06 14:18:51 +010084}
85
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -030086# Check if we have the kernel headers (tools/perf/../../include), else
87# we're probably on a detached tarball, so no point in trying to check
88# differences.
89test -d ../../include || exit 0
90
Jiri Olsa7ea6e982018-08-13 13:15:03 +020091cd ../..
92
Jiri Olsaaeafd622016-12-06 14:18:51 +010093# simple diff check
94for i in $HEADERS; do
95 check $i -B
96done
97
98# diff with extra ignore lines
Jiri Olsa15019e92018-04-23 11:08:15 +020099check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
100check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
101check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common.h>"'
102check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"'
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200103
Jiri Olsac9b51a02018-08-13 13:15:04 +0200104# diff non-symmetric files
105check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
106
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200107cd tools/perf