Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 1 | #!/bin/sh |
Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 2 | # SPDX-License-Identifier: GPL-2.0 |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 3 | |
| 4 | HEADERS=' |
Arnaldo Carvalho de Melo | c1737f2 | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 5 | include/uapi/drm/drm.h |
| 6 | include/uapi/drm/i915_drm.h |
Arnaldo Carvalho de Melo | f9cdd63 | 2018-12-18 16:15:53 -0300 | [diff] [blame] | 7 | include/uapi/linux/fadvise.h |
Arnaldo Carvalho de Melo | 67ef287 | 2017-03-30 11:16:59 -0300 | [diff] [blame] | 8 | include/uapi/linux/fcntl.h |
Arnaldo Carvalho de Melo | f443f38 | 2018-10-24 14:31:12 -0300 | [diff] [blame] | 9 | include/uapi/linux/fs.h |
Arnaldo Carvalho de Melo | 735e215 | 2017-10-31 10:04:11 -0300 | [diff] [blame] | 10 | include/uapi/linux/kcmp.h |
Arnaldo Carvalho de Melo | 3ce9751 | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 11 | include/uapi/linux/kvm.h |
Arnaldo Carvalho de Melo | a4b2061 | 2018-07-26 09:26:13 -0300 | [diff] [blame] | 12 | include/uapi/linux/in.h |
Arnaldo Carvalho de Melo | 250bfc8 | 2019-01-08 13:42:37 -0300 | [diff] [blame] | 13 | include/uapi/linux/mount.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 14 | include/uapi/linux/perf_event.h |
Arnaldo Carvalho de Melo | 4337279 | 2017-10-26 14:41:01 -0300 | [diff] [blame] | 15 | include/uapi/linux/prctl.h |
Arnaldo Carvalho de Melo | 450c86c | 2017-07-20 10:46:34 -0300 | [diff] [blame] | 16 | include/uapi/linux/sched.h |
Arnaldo Carvalho de Melo | 67ef287 | 2017-03-30 11:16:59 -0300 | [diff] [blame] | 17 | include/uapi/linux/stat.h |
Arnaldo Carvalho de Melo | 2bd71d1 | 2018-12-27 14:18:13 -0300 | [diff] [blame] | 18 | include/uapi/linux/usbdevice_fs.h |
Arnaldo Carvalho de Melo | d02b395 | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 19 | include/uapi/linux/vhost.h |
Arnaldo Carvalho de Melo | a215684e | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 20 | include/uapi/sound/asound.h |
Arnaldo Carvalho de Melo | ba4aa02 | 2018-09-25 10:55:59 -0300 | [diff] [blame] | 21 | include/linux/bits.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 22 | include/linux/hash.h |
| 23 | include/uapi/linux/hw_breakpoint.h |
| 24 | arch/x86/include/asm/disabled-features.h |
| 25 | arch/x86/include/asm/required-features.h |
| 26 | arch/x86/include/asm/cpufeatures.h |
Arnaldo Carvalho de Melo | c22e268 | 2018-12-17 16:15:27 -0300 | [diff] [blame] | 27 | arch/x86/include/uapi/asm/prctl.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 28 | arch/arm/include/uapi/asm/perf_regs.h |
| 29 | arch/arm64/include/uapi/asm/perf_regs.h |
| 30 | arch/powerpc/include/uapi/asm/perf_regs.h |
Arnaldo Carvalho de Melo | 10b9baa | 2017-11-28 11:08:41 -0300 | [diff] [blame] | 31 | arch/s390/include/uapi/asm/perf_regs.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 32 | arch/x86/include/uapi/asm/perf_regs.h |
| 33 | arch/x86/include/uapi/asm/kvm.h |
| 34 | arch/x86/include/uapi/asm/kvm_perf.h |
| 35 | arch/x86/include/uapi/asm/svm.h |
Arnaldo Carvalho de Melo | 047726d | 2017-07-18 17:09:21 -0300 | [diff] [blame] | 36 | arch/x86/include/uapi/asm/unistd.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 37 | arch/x86/include/uapi/asm/vmx.h |
| 38 | arch/powerpc/include/uapi/asm/kvm.h |
| 39 | arch/s390/include/uapi/asm/kvm.h |
| 40 | arch/s390/include/uapi/asm/kvm_perf.h |
Hendrik Brueckner | a81c421 | 2017-12-04 10:56:49 +0100 | [diff] [blame] | 41 | arch/s390/include/uapi/asm/ptrace.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 42 | arch/s390/include/uapi/asm/sie.h |
| 43 | arch/arm/include/uapi/asm/kvm.h |
| 44 | arch/arm64/include/uapi/asm/kvm.h |
Kim Phillips | 34b009cf | 2018-07-06 16:34:34 -0500 | [diff] [blame] | 45 | arch/arm64/include/uapi/asm/unistd.h |
Hendrik Brueckner | 95f2819 | 2018-01-19 09:56:13 +0100 | [diff] [blame] | 46 | arch/alpha/include/uapi/asm/errno.h |
| 47 | arch/mips/include/asm/errno.h |
| 48 | arch/mips/include/uapi/asm/errno.h |
| 49 | arch/parisc/include/uapi/asm/errno.h |
| 50 | arch/powerpc/include/uapi/asm/errno.h |
| 51 | arch/sparc/include/uapi/asm/errno.h |
| 52 | arch/x86/include/uapi/asm/errno.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 53 | include/asm-generic/bitops/arch_hweight.h |
| 54 | include/asm-generic/bitops/const_hweight.h |
| 55 | include/asm-generic/bitops/__fls.h |
| 56 | include/asm-generic/bitops/fls.h |
| 57 | include/asm-generic/bitops/fls64.h |
| 58 | include/linux/coresight-pmu.h |
Hendrik Brueckner | 28b8f95 | 2018-01-19 09:56:14 +0100 | [diff] [blame] | 59 | include/uapi/asm-generic/errno.h |
| 60 | include/uapi/asm-generic/errno-base.h |
Arnaldo Carvalho de Melo | 6375f0a | 2017-07-31 22:52:28 -0300 | [diff] [blame] | 61 | include/uapi/asm-generic/ioctls.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 62 | include/uapi/asm-generic/mman-common.h |
Kim Phillips | 34b009cf | 2018-07-06 16:34:34 -0500 | [diff] [blame] | 63 | include/uapi/asm-generic/unistd.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 64 | ' |
| 65 | |
Jiri Olsa | 58247297 | 2018-04-23 11:08:16 +0200 | [diff] [blame] | 66 | check_2 () { |
| 67 | file1=$1 |
| 68 | file2=$2 |
| 69 | |
| 70 | shift |
| 71 | shift |
| 72 | |
| 73 | cmd="diff $* $file1 $file2 > /dev/null" |
| 74 | |
Alexander Kapshuk | 51d8aac | 2018-08-11 11:39:15 +0300 | [diff] [blame] | 75 | test -f $file2 && { |
| 76 | eval $cmd || { |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 77 | echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2 |
| 78 | echo diff -u $file1 $file2 |
Alexander Kapshuk | 51d8aac | 2018-08-11 11:39:15 +0300 | [diff] [blame] | 79 | } |
| 80 | } |
Jiri Olsa | 58247297 | 2018-04-23 11:08:16 +0200 | [diff] [blame] | 81 | } |
| 82 | |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 83 | check () { |
| 84 | file=$1 |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 85 | |
| 86 | shift |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 87 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 88 | check_2 tools/$file $file $* |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 89 | } |
| 90 | |
Arnaldo Carvalho de Melo | d7e05ce | 2017-10-16 15:53:08 -0300 | [diff] [blame] | 91 | # 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. |
| 94 | test -d ../../include || exit 0 |
| 95 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 96 | cd ../.. |
| 97 | |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 98 | # simple diff check |
| 99 | for i in $HEADERS; do |
| 100 | check $i -B |
| 101 | done |
| 102 | |
| 103 | # diff with extra ignore lines |
Jiri Olsa | 15019e9 | 2018-04-23 11:08:15 +0200 | [diff] [blame] | 104 | check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"' |
| 105 | check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"' |
Arnaldo Carvalho de Melo | be709d4 | 2019-03-25 14:06:07 -0300 | [diff] [blame^] | 106 | check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"' |
Jiri Olsa | 15019e9 | 2018-04-23 11:08:15 +0200 | [diff] [blame] | 107 | check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"' |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 108 | |
Jiri Olsa | c9b51a0 | 2018-08-13 13:15:04 +0200 | [diff] [blame] | 109 | # diff non-symmetric files |
| 110 | check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl |
| 111 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 112 | cd tools/perf |