blob: a3a041b0d35ea46f9e60c8d8461e8e3f579ce367 [file] [log] [blame]
Jiri Olsaaeafd622016-12-06 14:18:51 +01001#!/bin/sh
2
3HEADERS='
Arnaldo Carvalho de Meloc1737f22017-07-31 16:45:32 -03004include/uapi/drm/drm.h
5include/uapi/drm/i915_drm.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -03006include/uapi/linux/fcntl.h
Arnaldo Carvalho de Melo735e2152017-10-31 10:04:11 -03007include/uapi/linux/kcmp.h
Arnaldo Carvalho de Melo3ce97512017-07-31 16:45:32 -03008include/uapi/linux/kvm.h
Jiri Olsaaeafd622016-12-06 14:18:51 +01009include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43372792017-10-26 14:41:01 -030010include/uapi/linux/prctl.h
Arnaldo Carvalho de Melo450c86c2017-07-20 10:46:34 -030011include/uapi/linux/sched.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -030012include/uapi/linux/stat.h
Arnaldo Carvalho de Melod02b3952017-07-31 16:45:32 -030013include/uapi/linux/vhost.h
Arnaldo Carvalho de Meloa215684e2017-07-31 16:45:32 -030014include/uapi/sound/asound.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010015include/linux/hash.h
16include/uapi/linux/hw_breakpoint.h
17arch/x86/include/asm/disabled-features.h
18arch/x86/include/asm/required-features.h
19arch/x86/include/asm/cpufeatures.h
20arch/arm/include/uapi/asm/perf_regs.h
21arch/arm64/include/uapi/asm/perf_regs.h
22arch/powerpc/include/uapi/asm/perf_regs.h
23arch/x86/include/uapi/asm/perf_regs.h
24arch/x86/include/uapi/asm/kvm.h
25arch/x86/include/uapi/asm/kvm_perf.h
26arch/x86/include/uapi/asm/svm.h
Arnaldo Carvalho de Melo047726d2017-07-18 17:09:21 -030027arch/x86/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010028arch/x86/include/uapi/asm/vmx.h
29arch/powerpc/include/uapi/asm/kvm.h
30arch/s390/include/uapi/asm/kvm.h
31arch/s390/include/uapi/asm/kvm_perf.h
32arch/s390/include/uapi/asm/sie.h
33arch/arm/include/uapi/asm/kvm.h
34arch/arm64/include/uapi/asm/kvm.h
35include/asm-generic/bitops/arch_hweight.h
36include/asm-generic/bitops/const_hweight.h
37include/asm-generic/bitops/__fls.h
38include/asm-generic/bitops/fls.h
39include/asm-generic/bitops/fls64.h
40include/linux/coresight-pmu.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030041include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010042include/uapi/asm-generic/mman-common.h
43'
44
45check () {
46 file=$1
Arnaldo Carvalho de Melo470de0f2017-07-31 22:55:12 -030047 opts="--ignore-blank-lines --ignore-space-change"
Jiri Olsaaeafd622016-12-06 14:18:51 +010048
49 shift
50 while [ -n "$*" ]; do
51 opts="$opts \"$1\""
52 shift
53 done
54
55 cmd="diff $opts ../$file ../../$file > /dev/null"
56
57 test -f ../../$file &&
Ingo Molnarc59796d2017-07-30 11:37:47 +020058 eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2
Jiri Olsaaeafd622016-12-06 14:18:51 +010059}
60
61
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -030062# Check if we have the kernel headers (tools/perf/../../include), else
63# we're probably on a detached tarball, so no point in trying to check
64# differences.
65test -d ../../include || exit 0
66
Jiri Olsaaeafd622016-12-06 14:18:51 +010067# simple diff check
68for i in $HEADERS; do
69 check $i -B
70done
71
72# diff with extra ignore lines
Arnaldo Carvalho de Melo470de0f2017-07-31 22:55:12 -030073check arch/x86/lib/memcpy_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
74check arch/x86/lib/memset_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
75check include/uapi/asm-generic/mman.h -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
76check include/uapi/linux/mman.h -I "^#include <\(uapi/\)*asm/mman.h>"