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