blob: bf206ffe5c457636441aec845403e2c670f4dc88 [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
Jiri Olsaaeafd622016-12-06 14:18:51 +010010include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43372792017-10-26 14:41:01 -030011include/uapi/linux/prctl.h
Arnaldo Carvalho de Melo450c86c2017-07-20 10:46:34 -030012include/uapi/linux/sched.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -030013include/uapi/linux/stat.h
Arnaldo Carvalho de Melod02b3952017-07-31 16:45:32 -030014include/uapi/linux/vhost.h
Arnaldo Carvalho de Meloa215684e2017-07-31 16:45:32 -030015include/uapi/sound/asound.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010016include/linux/hash.h
17include/uapi/linux/hw_breakpoint.h
18arch/x86/include/asm/disabled-features.h
19arch/x86/include/asm/required-features.h
20arch/x86/include/asm/cpufeatures.h
21arch/arm/include/uapi/asm/perf_regs.h
22arch/arm64/include/uapi/asm/perf_regs.h
23arch/powerpc/include/uapi/asm/perf_regs.h
Arnaldo Carvalho de Melo10b9baa2017-11-28 11:08:41 -030024arch/s390/include/uapi/asm/perf_regs.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010025arch/x86/include/uapi/asm/perf_regs.h
26arch/x86/include/uapi/asm/kvm.h
27arch/x86/include/uapi/asm/kvm_perf.h
28arch/x86/include/uapi/asm/svm.h
Arnaldo Carvalho de Melo047726d2017-07-18 17:09:21 -030029arch/x86/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010030arch/x86/include/uapi/asm/vmx.h
31arch/powerpc/include/uapi/asm/kvm.h
32arch/s390/include/uapi/asm/kvm.h
33arch/s390/include/uapi/asm/kvm_perf.h
Hendrik Bruecknera81c4212017-12-04 10:56:49 +010034arch/s390/include/uapi/asm/ptrace.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010035arch/s390/include/uapi/asm/sie.h
36arch/arm/include/uapi/asm/kvm.h
37arch/arm64/include/uapi/asm/kvm.h
Hendrik Brueckner95f28192018-01-19 09:56:13 +010038arch/alpha/include/uapi/asm/errno.h
39arch/mips/include/asm/errno.h
40arch/mips/include/uapi/asm/errno.h
41arch/parisc/include/uapi/asm/errno.h
42arch/powerpc/include/uapi/asm/errno.h
43arch/sparc/include/uapi/asm/errno.h
44arch/x86/include/uapi/asm/errno.h
Ravi Bangoria1350fb72018-01-29 14:04:15 +053045arch/powerpc/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010046include/asm-generic/bitops/arch_hweight.h
47include/asm-generic/bitops/const_hweight.h
48include/asm-generic/bitops/__fls.h
49include/asm-generic/bitops/fls.h
50include/asm-generic/bitops/fls64.h
51include/linux/coresight-pmu.h
Hendrik Brueckner28b8f952018-01-19 09:56:14 +010052include/uapi/asm-generic/errno.h
53include/uapi/asm-generic/errno-base.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030054include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010055include/uapi/asm-generic/mman-common.h
56'
57
58check () {
59 file=$1
Jiri Olsaaeafd622016-12-06 14:18:51 +010060
61 shift
62 while [ -n "$*" ]; do
63 opts="$opts \"$1\""
64 shift
65 done
66
67 cmd="diff $opts ../$file ../../$file > /dev/null"
68
69 test -f ../../$file &&
Ingo Molnarc59796d2017-07-30 11:37:47 +020070 eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2
Jiri Olsaaeafd622016-12-06 14:18:51 +010071}
72
73
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -030074# Check if we have the kernel headers (tools/perf/../../include), else
75# we're probably on a detached tarball, so no point in trying to check
76# differences.
77test -d ../../include || exit 0
78
Jiri Olsaaeafd622016-12-06 14:18:51 +010079# simple diff check
80for i in $HEADERS; do
81 check $i -B
82done
83
84# diff with extra ignore lines
Arnaldo Carvalho de Melo470de0f2017-07-31 22:55:12 -030085check arch/x86/lib/memcpy_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
86check arch/x86/lib/memset_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
87check include/uapi/asm-generic/mman.h -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
88check include/uapi/linux/mman.h -I "^#include <\(uapi/\)*asm/mman.h>"