blob: c905c683606ac3b408ccdd68b4846819ba77ee3a [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
Arnaldo Carvalho de Meloc4528332020-02-11 11:58:56 -030016include/uapi/linux/openat2.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010017include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43372792017-10-26 14:41:01 -030018include/uapi/linux/prctl.h
Arnaldo Carvalho de Melo450c86c2017-07-20 10:46:34 -030019include/uapi/linux/sched.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -030020include/uapi/linux/stat.h
Arnaldo Carvalho de Melo2bd71d12018-12-27 14:18:13 -030021include/uapi/linux/usbdevice_fs.h
Arnaldo Carvalho de Melod02b3952017-07-31 16:45:32 -030022include/uapi/linux/vhost.h
Arnaldo Carvalho de Meloa215684e2017-07-31 16:45:32 -030023include/uapi/sound/asound.h
Arnaldo Carvalho de Meloba4aa022018-09-25 10:55:59 -030024include/linux/bits.h
Arnaldo Carvalho de Meloaaa6ef82019-08-19 11:00:54 -030025include/linux/const.h
Arnaldo Carvalho de Meloca64d842020-04-14 08:52:23 -030026include/vdso/const.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010027include/linux/hash.h
28include/uapi/linux/hw_breakpoint.h
29arch/x86/include/asm/disabled-features.h
30arch/x86/include/asm/required-features.h
31arch/x86/include/asm/cpufeatures.h
Josh Poimboeuf00a26392019-08-29 17:41:21 -050032arch/x86/include/asm/inat_types.h
Masami Hiramatsu4d65adf2019-09-06 22:14:10 +090033arch/x86/include/asm/emulate_prefix.h
Arnaldo Carvalho de Melod2b72b72019-10-15 15:40:23 -030034arch/x86/include/asm/irq_vectors.h
Arnaldo Carvalho de Melo444e2ff2019-09-26 15:26:39 -030035arch/x86/include/asm/msr-index.h
Arnaldo Carvalho de Meloc22e2682018-12-17 16:15:27 -030036arch/x86/include/uapi/asm/prctl.h
Josh Poimboeuf00a26392019-08-29 17:41:21 -050037arch/x86/lib/x86-opcode-map.txt
38arch/x86/tools/gen-insn-attr-x86.awk
Jiri Olsaaeafd622016-12-06 14:18:51 +010039arch/arm/include/uapi/asm/perf_regs.h
40arch/arm64/include/uapi/asm/perf_regs.h
41arch/powerpc/include/uapi/asm/perf_regs.h
Arnaldo Carvalho de Melo10b9baa2017-11-28 11:08:41 -030042arch/s390/include/uapi/asm/perf_regs.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010043arch/x86/include/uapi/asm/perf_regs.h
44arch/x86/include/uapi/asm/kvm.h
45arch/x86/include/uapi/asm/kvm_perf.h
46arch/x86/include/uapi/asm/svm.h
Arnaldo Carvalho de Melo047726d2017-07-18 17:09:21 -030047arch/x86/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010048arch/x86/include/uapi/asm/vmx.h
49arch/powerpc/include/uapi/asm/kvm.h
50arch/s390/include/uapi/asm/kvm.h
51arch/s390/include/uapi/asm/kvm_perf.h
Hendrik Bruecknera81c4212017-12-04 10:56:49 +010052arch/s390/include/uapi/asm/ptrace.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010053arch/s390/include/uapi/asm/sie.h
54arch/arm/include/uapi/asm/kvm.h
55arch/arm64/include/uapi/asm/kvm.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050056arch/arm64/include/uapi/asm/unistd.h
Hendrik Brueckner95f28192018-01-19 09:56:13 +010057arch/alpha/include/uapi/asm/errno.h
58arch/mips/include/asm/errno.h
59arch/mips/include/uapi/asm/errno.h
60arch/parisc/include/uapi/asm/errno.h
61arch/powerpc/include/uapi/asm/errno.h
62arch/sparc/include/uapi/asm/errno.h
63arch/x86/include/uapi/asm/errno.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010064include/asm-generic/bitops/arch_hweight.h
65include/asm-generic/bitops/const_hweight.h
66include/asm-generic/bitops/__fls.h
67include/asm-generic/bitops/fls.h
68include/asm-generic/bitops/fls64.h
69include/linux/coresight-pmu.h
Hendrik Brueckner28b8f952018-01-19 09:56:14 +010070include/uapi/asm-generic/errno.h
71include/uapi/asm-generic/errno-base.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030072include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010073include/uapi/asm-generic/mman-common.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050074include/uapi/asm-generic/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010075'
76
Jiri Olsa582472972018-04-23 11:08:16 +020077check_2 () {
78 file1=$1
79 file2=$2
80
81 shift
82 shift
83
84 cmd="diff $* $file1 $file2 > /dev/null"
85
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030086 test -f $file2 && {
87 eval $cmd || {
Jiri Olsa7ea6e982018-08-13 13:15:03 +020088 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
89 echo diff -u $file1 $file2
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030090 }
91 }
Jiri Olsa582472972018-04-23 11:08:16 +020092}
93
Jiri Olsaaeafd622016-12-06 14:18:51 +010094check () {
95 file=$1
Jiri Olsaaeafd622016-12-06 14:18:51 +010096
97 shift
Jiri Olsaaeafd622016-12-06 14:18:51 +010098
Jiri Olsa7ea6e982018-08-13 13:15:03 +020099 check_2 tools/$file $file $*
Jiri Olsaaeafd622016-12-06 14:18:51 +0100100}
101
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -0300102# Check if we have the kernel headers (tools/perf/../../include), else
103# we're probably on a detached tarball, so no point in trying to check
104# differences.
105test -d ../../include || exit 0
106
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200107cd ../..
108
Jiri Olsaaeafd622016-12-06 14:18:51 +0100109# simple diff check
Josh Poimboeuf00a26392019-08-29 17:41:21 -0500110for i in $FILES; do
Jiri Olsaaeafd622016-12-06 14:18:51 +0100111 check $i -B
112done
113
114# diff with extra ignore lines
Arnaldo Carvalho de Melobd5c6b82019-12-02 11:40:57 -0300115check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"'
116check 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 -0300117check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
Jiri Olsa15019e92018-04-23 11:08:15 +0200118check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"'
Arnaldo Carvalho de Melo3052ba52019-06-25 17:27:31 -0300119check include/linux/ctype.h '-I "isdigit("'
120check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B'
Arnaldo Carvalho de Melo87a682a2019-08-31 17:14:19 -0300121check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
122check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
123check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
Masami Hiramatsu4d65adf2019-09-06 22:14:10 +0900124check 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 +0200125
Jiri Olsac9b51a02018-08-13 13:15:04 +0200126# diff non-symmetric files
127check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
128
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200129cd tools/perf