blob: ea602cd1b43a87b3afb81226a52589338904900e [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
38include/asm-generic/bitops/arch_hweight.h
39include/asm-generic/bitops/const_hweight.h
40include/asm-generic/bitops/__fls.h
41include/asm-generic/bitops/fls.h
42include/asm-generic/bitops/fls64.h
43include/linux/coresight-pmu.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030044include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010045include/uapi/asm-generic/mman-common.h
46'
47
48check () {
49 file=$1
Jiri Olsaaeafd622016-12-06 14:18:51 +010050
51 shift
52 while [ -n "$*" ]; do
53 opts="$opts \"$1\""
54 shift
55 done
56
57 cmd="diff $opts ../$file ../../$file > /dev/null"
58
59 test -f ../../$file &&
Ingo Molnarc59796d2017-07-30 11:37:47 +020060 eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2
Jiri Olsaaeafd622016-12-06 14:18:51 +010061}
62
63
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -030064# Check if we have the kernel headers (tools/perf/../../include), else
65# we're probably on a detached tarball, so no point in trying to check
66# differences.
67test -d ../../include || exit 0
68
Jiri Olsaaeafd622016-12-06 14:18:51 +010069# simple diff check
70for i in $HEADERS; do
71 check $i -B
72done
73
74# diff with extra ignore lines
Arnaldo Carvalho de Melo470de0f2017-07-31 22:55:12 -030075check arch/x86/lib/memcpy_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
76check arch/x86/lib/memset_64.S -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
77check include/uapi/asm-generic/mman.h -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
78check include/uapi/linux/mman.h -I "^#include <\(uapi/\)*asm/mman.h>"