blob: cea13cb987d00c77a0bb33ccbfda62c6b6efd100 [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
Jiri Olsaaeafd622016-12-06 14:18:51 +010016include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43372792017-10-26 14:41:01 -030017include/uapi/linux/prctl.h
Arnaldo Carvalho de Melo450c86c2017-07-20 10:46:34 -030018include/uapi/linux/sched.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -030019include/uapi/linux/stat.h
Arnaldo Carvalho de Melo2bd71d12018-12-27 14:18:13 -030020include/uapi/linux/usbdevice_fs.h
Arnaldo Carvalho de Melod02b3952017-07-31 16:45:32 -030021include/uapi/linux/vhost.h
Arnaldo Carvalho de Meloa215684e2017-07-31 16:45:32 -030022include/uapi/sound/asound.h
Arnaldo Carvalho de Meloba4aa022018-09-25 10:55:59 -030023include/linux/bits.h
Arnaldo Carvalho de Meloaaa6ef82019-08-19 11:00:54 -030024include/linux/const.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010025include/linux/hash.h
26include/uapi/linux/hw_breakpoint.h
27arch/x86/include/asm/disabled-features.h
28arch/x86/include/asm/required-features.h
29arch/x86/include/asm/cpufeatures.h
Josh Poimboeuf00a26392019-08-29 17:41:21 -050030arch/x86/include/asm/inat_types.h
Arnaldo Carvalho de Meloc22e2682018-12-17 16:15:27 -030031arch/x86/include/uapi/asm/prctl.h
Josh Poimboeuf00a26392019-08-29 17:41:21 -050032arch/x86/lib/x86-opcode-map.txt
33arch/x86/tools/gen-insn-attr-x86.awk
Jiri Olsaaeafd622016-12-06 14:18:51 +010034arch/arm/include/uapi/asm/perf_regs.h
35arch/arm64/include/uapi/asm/perf_regs.h
36arch/powerpc/include/uapi/asm/perf_regs.h
Arnaldo Carvalho de Melo10b9baa2017-11-28 11:08:41 -030037arch/s390/include/uapi/asm/perf_regs.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010038arch/x86/include/uapi/asm/perf_regs.h
39arch/x86/include/uapi/asm/kvm.h
40arch/x86/include/uapi/asm/kvm_perf.h
41arch/x86/include/uapi/asm/svm.h
Arnaldo Carvalho de Melo047726d2017-07-18 17:09:21 -030042arch/x86/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010043arch/x86/include/uapi/asm/vmx.h
44arch/powerpc/include/uapi/asm/kvm.h
45arch/s390/include/uapi/asm/kvm.h
46arch/s390/include/uapi/asm/kvm_perf.h
Hendrik Bruecknera81c4212017-12-04 10:56:49 +010047arch/s390/include/uapi/asm/ptrace.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010048arch/s390/include/uapi/asm/sie.h
49arch/arm/include/uapi/asm/kvm.h
50arch/arm64/include/uapi/asm/kvm.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050051arch/arm64/include/uapi/asm/unistd.h
Hendrik Brueckner95f28192018-01-19 09:56:13 +010052arch/alpha/include/uapi/asm/errno.h
53arch/mips/include/asm/errno.h
54arch/mips/include/uapi/asm/errno.h
55arch/parisc/include/uapi/asm/errno.h
56arch/powerpc/include/uapi/asm/errno.h
57arch/sparc/include/uapi/asm/errno.h
58arch/x86/include/uapi/asm/errno.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010059include/asm-generic/bitops/arch_hweight.h
60include/asm-generic/bitops/const_hweight.h
61include/asm-generic/bitops/__fls.h
62include/asm-generic/bitops/fls.h
63include/asm-generic/bitops/fls64.h
64include/linux/coresight-pmu.h
Hendrik Brueckner28b8f952018-01-19 09:56:14 +010065include/uapi/asm-generic/errno.h
66include/uapi/asm-generic/errno-base.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030067include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010068include/uapi/asm-generic/mman-common.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050069include/uapi/asm-generic/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010070'
71
Jiri Olsa582472972018-04-23 11:08:16 +020072check_2 () {
73 file1=$1
74 file2=$2
75
76 shift
77 shift
78
79 cmd="diff $* $file1 $file2 > /dev/null"
80
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030081 test -f $file2 && {
82 eval $cmd || {
Jiri Olsa7ea6e982018-08-13 13:15:03 +020083 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
84 echo diff -u $file1 $file2
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030085 }
86 }
Jiri Olsa582472972018-04-23 11:08:16 +020087}
88
Jiri Olsaaeafd622016-12-06 14:18:51 +010089check () {
90 file=$1
Jiri Olsaaeafd622016-12-06 14:18:51 +010091
92 shift
Jiri Olsaaeafd622016-12-06 14:18:51 +010093
Jiri Olsa7ea6e982018-08-13 13:15:03 +020094 check_2 tools/$file $file $*
Jiri Olsaaeafd622016-12-06 14:18:51 +010095}
96
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -030097# Check if we have the kernel headers (tools/perf/../../include), else
98# we're probably on a detached tarball, so no point in trying to check
99# differences.
100test -d ../../include || exit 0
101
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200102cd ../..
103
Jiri Olsaaeafd622016-12-06 14:18:51 +0100104# simple diff check
Josh Poimboeuf00a26392019-08-29 17:41:21 -0500105for i in $FILES; do
Jiri Olsaaeafd622016-12-06 14:18:51 +0100106 check $i -B
107done
108
109# diff with extra ignore lines
Jiri Olsa15019e92018-04-23 11:08:15 +0200110check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
111check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
Arnaldo Carvalho de Melobe709d42019-03-25 14:06:07 -0300112check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
Jiri Olsa15019e92018-04-23 11:08:15 +0200113check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"'
Arnaldo Carvalho de Melo3052ba52019-06-25 17:27:31 -0300114check include/linux/ctype.h '-I "isdigit("'
115check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B'
Arnaldo Carvalho de Melo87a682a2019-08-31 17:14:19 -0300116check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"'
117check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
118check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
119check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]"'
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200120
Jiri Olsac9b51a02018-08-13 13:15:04 +0200121# diff non-symmetric files
122check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
123
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200124cd tools/perf