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