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 | |
Josh Poimboeuf | 00a2639 | 2019-08-29 17:41:21 -0500 | [diff] [blame] | 4 | FILES=' |
Arnaldo Carvalho de Melo | aaa6ef8 | 2019-08-19 11:00:54 -0300 | [diff] [blame] | 5 | include/uapi/linux/const.h |
Arnaldo Carvalho de Melo | c1737f2 | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 6 | include/uapi/drm/drm.h |
| 7 | include/uapi/drm/i915_drm.h |
Arnaldo Carvalho de Melo | f9cdd63 | 2018-12-18 16:15:53 -0300 | [diff] [blame] | 8 | include/uapi/linux/fadvise.h |
Arnaldo Carvalho de Melo | 67ef287 | 2017-03-30 11:16:59 -0300 | [diff] [blame] | 9 | include/uapi/linux/fcntl.h |
Arnaldo Carvalho de Melo | f443f38 | 2018-10-24 14:31:12 -0300 | [diff] [blame] | 10 | include/uapi/linux/fs.h |
Arnaldo Carvalho de Melo | 0ae4061 | 2019-09-27 12:01:26 -0300 | [diff] [blame] | 11 | include/uapi/linux/fscrypt.h |
Arnaldo Carvalho de Melo | 735e215 | 2017-10-31 10:04:11 -0300 | [diff] [blame] | 12 | include/uapi/linux/kcmp.h |
Arnaldo Carvalho de Melo | 3ce9751 | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 13 | include/uapi/linux/kvm.h |
Arnaldo Carvalho de Melo | a4b2061 | 2018-07-26 09:26:13 -0300 | [diff] [blame] | 14 | include/uapi/linux/in.h |
Arnaldo Carvalho de Melo | 250bfc8 | 2019-01-08 13:42:37 -0300 | [diff] [blame] | 15 | include/uapi/linux/mount.h |
Arnaldo Carvalho de Melo | c452833 | 2020-02-11 11:58:56 -0300 | [diff] [blame] | 16 | include/uapi/linux/openat2.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 17 | include/uapi/linux/perf_event.h |
Arnaldo Carvalho de Melo | 4337279 | 2017-10-26 14:41:01 -0300 | [diff] [blame] | 18 | include/uapi/linux/prctl.h |
Arnaldo Carvalho de Melo | 450c86c | 2017-07-20 10:46:34 -0300 | [diff] [blame] | 19 | include/uapi/linux/sched.h |
Arnaldo Carvalho de Melo | 67ef287 | 2017-03-30 11:16:59 -0300 | [diff] [blame] | 20 | include/uapi/linux/stat.h |
Arnaldo Carvalho de Melo | 2bd71d1 | 2018-12-27 14:18:13 -0300 | [diff] [blame] | 21 | include/uapi/linux/usbdevice_fs.h |
Arnaldo Carvalho de Melo | d02b395 | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 22 | include/uapi/linux/vhost.h |
Arnaldo Carvalho de Melo | a215684e | 2017-07-31 16:45:32 -0300 | [diff] [blame] | 23 | include/uapi/sound/asound.h |
Arnaldo Carvalho de Melo | ba4aa02 | 2018-09-25 10:55:59 -0300 | [diff] [blame] | 24 | include/linux/bits.h |
Arnaldo Carvalho de Melo | aaa6ef8 | 2019-08-19 11:00:54 -0300 | [diff] [blame] | 25 | include/linux/const.h |
Arnaldo Carvalho de Melo | ca64d84 | 2020-04-14 08:52:23 -0300 | [diff] [blame^] | 26 | include/vdso/const.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 27 | include/linux/hash.h |
| 28 | include/uapi/linux/hw_breakpoint.h |
| 29 | arch/x86/include/asm/disabled-features.h |
| 30 | arch/x86/include/asm/required-features.h |
| 31 | arch/x86/include/asm/cpufeatures.h |
Josh Poimboeuf | 00a2639 | 2019-08-29 17:41:21 -0500 | [diff] [blame] | 32 | arch/x86/include/asm/inat_types.h |
Masami Hiramatsu | 4d65adf | 2019-09-06 22:14:10 +0900 | [diff] [blame] | 33 | arch/x86/include/asm/emulate_prefix.h |
Arnaldo Carvalho de Melo | d2b72b7 | 2019-10-15 15:40:23 -0300 | [diff] [blame] | 34 | arch/x86/include/asm/irq_vectors.h |
Arnaldo Carvalho de Melo | 444e2ff | 2019-09-26 15:26:39 -0300 | [diff] [blame] | 35 | arch/x86/include/asm/msr-index.h |
Arnaldo Carvalho de Melo | c22e268 | 2018-12-17 16:15:27 -0300 | [diff] [blame] | 36 | arch/x86/include/uapi/asm/prctl.h |
Josh Poimboeuf | 00a2639 | 2019-08-29 17:41:21 -0500 | [diff] [blame] | 37 | arch/x86/lib/x86-opcode-map.txt |
| 38 | arch/x86/tools/gen-insn-attr-x86.awk |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 39 | arch/arm/include/uapi/asm/perf_regs.h |
| 40 | arch/arm64/include/uapi/asm/perf_regs.h |
| 41 | arch/powerpc/include/uapi/asm/perf_regs.h |
Arnaldo Carvalho de Melo | 10b9baa | 2017-11-28 11:08:41 -0300 | [diff] [blame] | 42 | arch/s390/include/uapi/asm/perf_regs.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 43 | arch/x86/include/uapi/asm/perf_regs.h |
| 44 | arch/x86/include/uapi/asm/kvm.h |
| 45 | arch/x86/include/uapi/asm/kvm_perf.h |
| 46 | arch/x86/include/uapi/asm/svm.h |
Arnaldo Carvalho de Melo | 047726d | 2017-07-18 17:09:21 -0300 | [diff] [blame] | 47 | arch/x86/include/uapi/asm/unistd.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 48 | arch/x86/include/uapi/asm/vmx.h |
| 49 | arch/powerpc/include/uapi/asm/kvm.h |
| 50 | arch/s390/include/uapi/asm/kvm.h |
| 51 | arch/s390/include/uapi/asm/kvm_perf.h |
Hendrik Brueckner | a81c421 | 2017-12-04 10:56:49 +0100 | [diff] [blame] | 52 | arch/s390/include/uapi/asm/ptrace.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 53 | arch/s390/include/uapi/asm/sie.h |
| 54 | arch/arm/include/uapi/asm/kvm.h |
| 55 | arch/arm64/include/uapi/asm/kvm.h |
Kim Phillips | 34b009cf | 2018-07-06 16:34:34 -0500 | [diff] [blame] | 56 | arch/arm64/include/uapi/asm/unistd.h |
Hendrik Brueckner | 95f2819 | 2018-01-19 09:56:13 +0100 | [diff] [blame] | 57 | arch/alpha/include/uapi/asm/errno.h |
| 58 | arch/mips/include/asm/errno.h |
| 59 | arch/mips/include/uapi/asm/errno.h |
| 60 | arch/parisc/include/uapi/asm/errno.h |
| 61 | arch/powerpc/include/uapi/asm/errno.h |
| 62 | arch/sparc/include/uapi/asm/errno.h |
| 63 | arch/x86/include/uapi/asm/errno.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 64 | include/asm-generic/bitops/arch_hweight.h |
| 65 | include/asm-generic/bitops/const_hweight.h |
| 66 | include/asm-generic/bitops/__fls.h |
| 67 | include/asm-generic/bitops/fls.h |
| 68 | include/asm-generic/bitops/fls64.h |
| 69 | include/linux/coresight-pmu.h |
Hendrik Brueckner | 28b8f95 | 2018-01-19 09:56:14 +0100 | [diff] [blame] | 70 | include/uapi/asm-generic/errno.h |
| 71 | include/uapi/asm-generic/errno-base.h |
Arnaldo Carvalho de Melo | 6375f0a | 2017-07-31 22:52:28 -0300 | [diff] [blame] | 72 | include/uapi/asm-generic/ioctls.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 73 | include/uapi/asm-generic/mman-common.h |
Kim Phillips | 34b009cf | 2018-07-06 16:34:34 -0500 | [diff] [blame] | 74 | include/uapi/asm-generic/unistd.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 75 | ' |
| 76 | |
Jiri Olsa | 58247297 | 2018-04-23 11:08:16 +0200 | [diff] [blame] | 77 | check_2 () { |
| 78 | file1=$1 |
| 79 | file2=$2 |
| 80 | |
| 81 | shift |
| 82 | shift |
| 83 | |
| 84 | cmd="diff $* $file1 $file2 > /dev/null" |
| 85 | |
Alexander Kapshuk | 51d8aac | 2018-08-11 11:39:15 +0300 | [diff] [blame] | 86 | test -f $file2 && { |
| 87 | eval $cmd || { |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 88 | echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2 |
| 89 | echo diff -u $file1 $file2 |
Alexander Kapshuk | 51d8aac | 2018-08-11 11:39:15 +0300 | [diff] [blame] | 90 | } |
| 91 | } |
Jiri Olsa | 58247297 | 2018-04-23 11:08:16 +0200 | [diff] [blame] | 92 | } |
| 93 | |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 94 | check () { |
| 95 | file=$1 |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 96 | |
| 97 | shift |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 98 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 99 | check_2 tools/$file $file $* |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 100 | } |
| 101 | |
Arnaldo Carvalho de Melo | d7e05ce | 2017-10-16 15:53:08 -0300 | [diff] [blame] | 102 | # Check if we have the kernel headers (tools/perf/../../include), else |
| 103 | # we're probably on a detached tarball, so no point in trying to check |
| 104 | # differences. |
| 105 | test -d ../../include || exit 0 |
| 106 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 107 | cd ../.. |
| 108 | |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 109 | # simple diff check |
Josh Poimboeuf | 00a2639 | 2019-08-29 17:41:21 -0500 | [diff] [blame] | 110 | for i in $FILES; do |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 111 | check $i -B |
| 112 | done |
| 113 | |
| 114 | # diff with extra ignore lines |
Arnaldo Carvalho de Melo | bd5c6b8 | 2019-12-02 11:40:57 -0300 | [diff] [blame] | 115 | check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"' |
| 116 | check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"' |
Arnaldo Carvalho de Melo | be709d4 | 2019-03-25 14:06:07 -0300 | [diff] [blame] | 117 | 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] | 118 | check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"' |
Arnaldo Carvalho de Melo | 3052ba5 | 2019-06-25 17:27:31 -0300 | [diff] [blame] | 119 | check include/linux/ctype.h '-I "isdigit("' |
| 120 | check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B' |
Arnaldo Carvalho de Melo | 87a682a | 2019-08-31 17:14:19 -0300 | [diff] [blame] | 121 | check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"' |
| 122 | check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"' |
| 123 | check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"' |
Masami Hiramatsu | 4d65adf | 2019-09-06 22:14:10 +0900 | [diff] [blame] | 124 | check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"' |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 125 | |
Jiri Olsa | c9b51a0 | 2018-08-13 13:15:04 +0200 | [diff] [blame] | 126 | # diff non-symmetric files |
| 127 | check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl |
| 128 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 129 | cd tools/perf |