blob: c68ee06cae637fe5aad2c51e2dba1e16af0b5064 [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 Melof9cdd632018-12-18 16:15:53 -03007include/uapi/linux/fadvise.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -03008include/uapi/linux/fcntl.h
Arnaldo Carvalho de Melof443f382018-10-24 14:31:12 -03009include/uapi/linux/fs.h
Arnaldo Carvalho de Melo735e2152017-10-31 10:04:11 -030010include/uapi/linux/kcmp.h
Arnaldo Carvalho de Melo3ce97512017-07-31 16:45:32 -030011include/uapi/linux/kvm.h
Arnaldo Carvalho de Meloa4b20612018-07-26 09:26:13 -030012include/uapi/linux/in.h
Arnaldo Carvalho de Melo250bfc82019-01-08 13:42:37 -030013include/uapi/linux/mount.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010014include/uapi/linux/perf_event.h
Arnaldo Carvalho de Melo43372792017-10-26 14:41:01 -030015include/uapi/linux/prctl.h
Arnaldo Carvalho de Melo450c86c2017-07-20 10:46:34 -030016include/uapi/linux/sched.h
Arnaldo Carvalho de Melo67ef2872017-03-30 11:16:59 -030017include/uapi/linux/stat.h
Arnaldo Carvalho de Melo2bd71d12018-12-27 14:18:13 -030018include/uapi/linux/usbdevice_fs.h
Arnaldo Carvalho de Melod02b3952017-07-31 16:45:32 -030019include/uapi/linux/vhost.h
Arnaldo Carvalho de Meloa215684e2017-07-31 16:45:32 -030020include/uapi/sound/asound.h
Arnaldo Carvalho de Meloba4aa022018-09-25 10:55:59 -030021include/linux/bits.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010022include/linux/hash.h
23include/uapi/linux/hw_breakpoint.h
24arch/x86/include/asm/disabled-features.h
25arch/x86/include/asm/required-features.h
26arch/x86/include/asm/cpufeatures.h
Arnaldo Carvalho de Meloc22e2682018-12-17 16:15:27 -030027arch/x86/include/uapi/asm/prctl.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010028arch/arm/include/uapi/asm/perf_regs.h
29arch/arm64/include/uapi/asm/perf_regs.h
30arch/powerpc/include/uapi/asm/perf_regs.h
Arnaldo Carvalho de Melo10b9baa2017-11-28 11:08:41 -030031arch/s390/include/uapi/asm/perf_regs.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010032arch/x86/include/uapi/asm/perf_regs.h
33arch/x86/include/uapi/asm/kvm.h
34arch/x86/include/uapi/asm/kvm_perf.h
35arch/x86/include/uapi/asm/svm.h
Arnaldo Carvalho de Melo047726d2017-07-18 17:09:21 -030036arch/x86/include/uapi/asm/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010037arch/x86/include/uapi/asm/vmx.h
38arch/powerpc/include/uapi/asm/kvm.h
39arch/s390/include/uapi/asm/kvm.h
40arch/s390/include/uapi/asm/kvm_perf.h
Hendrik Bruecknera81c4212017-12-04 10:56:49 +010041arch/s390/include/uapi/asm/ptrace.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010042arch/s390/include/uapi/asm/sie.h
43arch/arm/include/uapi/asm/kvm.h
44arch/arm64/include/uapi/asm/kvm.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050045arch/arm64/include/uapi/asm/unistd.h
Hendrik Brueckner95f28192018-01-19 09:56:13 +010046arch/alpha/include/uapi/asm/errno.h
47arch/mips/include/asm/errno.h
48arch/mips/include/uapi/asm/errno.h
49arch/parisc/include/uapi/asm/errno.h
50arch/powerpc/include/uapi/asm/errno.h
51arch/sparc/include/uapi/asm/errno.h
52arch/x86/include/uapi/asm/errno.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010053include/asm-generic/bitops/arch_hweight.h
54include/asm-generic/bitops/const_hweight.h
55include/asm-generic/bitops/__fls.h
56include/asm-generic/bitops/fls.h
57include/asm-generic/bitops/fls64.h
58include/linux/coresight-pmu.h
Hendrik Brueckner28b8f952018-01-19 09:56:14 +010059include/uapi/asm-generic/errno.h
60include/uapi/asm-generic/errno-base.h
Arnaldo Carvalho de Melo6375f0a2017-07-31 22:52:28 -030061include/uapi/asm-generic/ioctls.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010062include/uapi/asm-generic/mman-common.h
Kim Phillips34b009cf2018-07-06 16:34:34 -050063include/uapi/asm-generic/unistd.h
Jiri Olsaaeafd622016-12-06 14:18:51 +010064'
65
Jiri Olsa582472972018-04-23 11:08:16 +020066check_2 () {
67 file1=$1
68 file2=$2
69
70 shift
71 shift
72
73 cmd="diff $* $file1 $file2 > /dev/null"
74
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030075 test -f $file2 && {
76 eval $cmd || {
Jiri Olsa7ea6e982018-08-13 13:15:03 +020077 echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
78 echo diff -u $file1 $file2
Alexander Kapshuk51d8aac2018-08-11 11:39:15 +030079 }
80 }
Jiri Olsa582472972018-04-23 11:08:16 +020081}
82
Jiri Olsaaeafd622016-12-06 14:18:51 +010083check () {
84 file=$1
Jiri Olsaaeafd622016-12-06 14:18:51 +010085
86 shift
Jiri Olsaaeafd622016-12-06 14:18:51 +010087
Jiri Olsa7ea6e982018-08-13 13:15:03 +020088 check_2 tools/$file $file $*
Jiri Olsaaeafd622016-12-06 14:18:51 +010089}
90
Arnaldo Carvalho de Melod7e05ce2017-10-16 15:53:08 -030091# Check if we have the kernel headers (tools/perf/../../include), else
92# we're probably on a detached tarball, so no point in trying to check
93# differences.
94test -d ../../include || exit 0
95
Jiri Olsa7ea6e982018-08-13 13:15:03 +020096cd ../..
97
Jiri Olsaaeafd622016-12-06 14:18:51 +010098# simple diff check
99for i in $HEADERS; do
100 check $i -B
101done
102
103# diff with extra ignore lines
Jiri Olsa15019e92018-04-23 11:08:15 +0200104check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
105check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
Arnaldo Carvalho de Melobe709d42019-03-25 14:06:07 -0300106check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
Jiri Olsa15019e92018-04-23 11:08:15 +0200107check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"'
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200108
Jiri Olsac9b51a02018-08-13 13:15:04 +0200109# diff non-symmetric files
110check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
111
Jiri Olsa7ea6e982018-08-13 13:15:03 +0200112cd tools/perf