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 | e3698b2 | 2020-04-14 10:27:39 -0300 | [diff] [blame] | 25 | include/vdso/bits.h |
Arnaldo Carvalho de Melo | aaa6ef8 | 2019-08-19 11:00:54 -0300 | [diff] [blame] | 26 | include/linux/const.h |
Arnaldo Carvalho de Melo | ca64d84 | 2020-04-14 08:52:23 -0300 | [diff] [blame] | 27 | include/vdso/const.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 28 | include/linux/hash.h |
| 29 | include/uapi/linux/hw_breakpoint.h |
| 30 | arch/x86/include/asm/disabled-features.h |
| 31 | arch/x86/include/asm/required-features.h |
| 32 | arch/x86/include/asm/cpufeatures.h |
Josh Poimboeuf | 00a2639 | 2019-08-29 17:41:21 -0500 | [diff] [blame] | 33 | arch/x86/include/asm/inat_types.h |
Masami Hiramatsu | 4d65adf | 2019-09-06 22:14:10 +0900 | [diff] [blame] | 34 | arch/x86/include/asm/emulate_prefix.h |
Arnaldo Carvalho de Melo | d2b72b7 | 2019-10-15 15:40:23 -0300 | [diff] [blame] | 35 | arch/x86/include/asm/irq_vectors.h |
Arnaldo Carvalho de Melo | 444e2ff | 2019-09-26 15:26:39 -0300 | [diff] [blame] | 36 | arch/x86/include/asm/msr-index.h |
Arnaldo Carvalho de Melo | c22e268 | 2018-12-17 16:15:27 -0300 | [diff] [blame] | 37 | arch/x86/include/uapi/asm/prctl.h |
Josh Poimboeuf | 00a2639 | 2019-08-29 17:41:21 -0500 | [diff] [blame] | 38 | arch/x86/lib/x86-opcode-map.txt |
| 39 | arch/x86/tools/gen-insn-attr-x86.awk |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 40 | arch/arm/include/uapi/asm/perf_regs.h |
| 41 | arch/arm64/include/uapi/asm/perf_regs.h |
Tiezhu Yang | 6c1ced2 | 2021-06-01 19:53:56 +0800 | [diff] [blame] | 42 | arch/mips/include/uapi/asm/perf_regs.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 43 | arch/powerpc/include/uapi/asm/perf_regs.h |
Arnaldo Carvalho de Melo | 10b9baa | 2017-11-28 11:08:41 -0300 | [diff] [blame] | 44 | arch/s390/include/uapi/asm/perf_regs.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 45 | arch/x86/include/uapi/asm/perf_regs.h |
| 46 | arch/x86/include/uapi/asm/kvm.h |
| 47 | arch/x86/include/uapi/asm/kvm_perf.h |
| 48 | arch/x86/include/uapi/asm/svm.h |
Arnaldo Carvalho de Melo | 047726d | 2017-07-18 17:09:21 -0300 | [diff] [blame] | 49 | arch/x86/include/uapi/asm/unistd.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 50 | arch/x86/include/uapi/asm/vmx.h |
| 51 | arch/powerpc/include/uapi/asm/kvm.h |
| 52 | arch/s390/include/uapi/asm/kvm.h |
| 53 | arch/s390/include/uapi/asm/kvm_perf.h |
Hendrik Brueckner | a81c421 | 2017-12-04 10:56:49 +0100 | [diff] [blame] | 54 | arch/s390/include/uapi/asm/ptrace.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 55 | arch/s390/include/uapi/asm/sie.h |
| 56 | arch/arm/include/uapi/asm/kvm.h |
| 57 | arch/arm64/include/uapi/asm/kvm.h |
Kim Phillips | 34b009cf | 2018-07-06 16:34:34 -0500 | [diff] [blame] | 58 | arch/arm64/include/uapi/asm/unistd.h |
Hendrik Brueckner | 95f2819 | 2018-01-19 09:56:13 +0100 | [diff] [blame] | 59 | arch/alpha/include/uapi/asm/errno.h |
| 60 | arch/mips/include/asm/errno.h |
| 61 | arch/mips/include/uapi/asm/errno.h |
| 62 | arch/parisc/include/uapi/asm/errno.h |
| 63 | arch/powerpc/include/uapi/asm/errno.h |
| 64 | arch/sparc/include/uapi/asm/errno.h |
| 65 | arch/x86/include/uapi/asm/errno.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 66 | include/asm-generic/bitops/arch_hweight.h |
| 67 | include/asm-generic/bitops/const_hweight.h |
| 68 | include/asm-generic/bitops/__fls.h |
| 69 | include/asm-generic/bitops/fls.h |
| 70 | include/asm-generic/bitops/fls64.h |
| 71 | include/linux/coresight-pmu.h |
Hendrik Brueckner | 28b8f95 | 2018-01-19 09:56:14 +0100 | [diff] [blame] | 72 | include/uapi/asm-generic/errno.h |
| 73 | include/uapi/asm-generic/errno-base.h |
Arnaldo Carvalho de Melo | 6375f0a | 2017-07-31 22:52:28 -0300 | [diff] [blame] | 74 | include/uapi/asm-generic/ioctls.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 75 | include/uapi/asm-generic/mman-common.h |
Kim Phillips | 34b009cf | 2018-07-06 16:34:34 -0500 | [diff] [blame] | 76 | include/uapi/asm-generic/unistd.h |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 77 | ' |
| 78 | |
Borislav Petkov | d30c7b8 | 2021-02-22 13:34:40 +0100 | [diff] [blame] | 79 | SYNC_CHECK_FILES=' |
| 80 | arch/x86/include/asm/inat.h |
| 81 | arch/x86/include/asm/insn.h |
| 82 | arch/x86/lib/inat.c |
| 83 | arch/x86/lib/insn.c |
| 84 | ' |
| 85 | |
Arnaldo Carvalho de Melo | d758d5d | 2020-09-29 08:56:38 -0300 | [diff] [blame] | 86 | # These copies are under tools/perf/trace/beauty/ as they are not used to in |
| 87 | # building object files only by scripts in tools/perf/trace/beauty/ to generate |
| 88 | # tables that then gets included in .c files for things like id->string syscall |
| 89 | # tables (and the reverse lookup as well: string -> id) |
| 90 | |
| 91 | BEAUTY_FILES=' |
| 92 | include/linux/socket.h |
| 93 | ' |
| 94 | |
Jiri Olsa | 58247297 | 2018-04-23 11:08:16 +0200 | [diff] [blame] | 95 | check_2 () { |
| 96 | file1=$1 |
| 97 | file2=$2 |
| 98 | |
| 99 | shift |
| 100 | shift |
| 101 | |
| 102 | cmd="diff $* $file1 $file2 > /dev/null" |
| 103 | |
Alexander Kapshuk | 51d8aac | 2018-08-11 11:39:15 +0300 | [diff] [blame] | 104 | test -f $file2 && { |
| 105 | eval $cmd || { |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 106 | echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2 |
| 107 | echo diff -u $file1 $file2 |
Alexander Kapshuk | 51d8aac | 2018-08-11 11:39:15 +0300 | [diff] [blame] | 108 | } |
| 109 | } |
Jiri Olsa | 58247297 | 2018-04-23 11:08:16 +0200 | [diff] [blame] | 110 | } |
| 111 | |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 112 | check () { |
| 113 | file=$1 |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 114 | |
| 115 | shift |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 116 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 117 | check_2 tools/$file $file $* |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 118 | } |
| 119 | |
Arnaldo Carvalho de Melo | d758d5d | 2020-09-29 08:56:38 -0300 | [diff] [blame] | 120 | beauty_check () { |
| 121 | file=$1 |
| 122 | |
| 123 | shift |
| 124 | |
| 125 | check_2 tools/perf/trace/beauty/$file $file $* |
| 126 | } |
| 127 | |
Arnaldo Carvalho de Melo | d7e05ce | 2017-10-16 15:53:08 -0300 | [diff] [blame] | 128 | # Check if we have the kernel headers (tools/perf/../../include), else |
| 129 | # we're probably on a detached tarball, so no point in trying to check |
| 130 | # differences. |
| 131 | test -d ../../include || exit 0 |
| 132 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 133 | cd ../.. |
| 134 | |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 135 | # simple diff check |
Josh Poimboeuf | 00a2639 | 2019-08-29 17:41:21 -0500 | [diff] [blame] | 136 | for i in $FILES; do |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 137 | check $i -B |
| 138 | done |
| 139 | |
Borislav Petkov | d30c7b8 | 2021-02-22 13:34:40 +0100 | [diff] [blame] | 140 | for i in $SYNC_CHECK_FILES; do |
| 141 | check $i '-I "^.*\/\*.*__ignore_sync_check__.*\*\/.*$"' |
| 142 | done |
| 143 | |
Jiri Olsa | aeafd62 | 2016-12-06 14:18:51 +0100 | [diff] [blame] | 144 | # diff with extra ignore lines |
Arnaldo Carvalho de Melo | bd5c6b8 | 2019-12-02 11:40:57 -0300 | [diff] [blame] | 145 | check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"' |
| 146 | check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"' |
Kim Phillips | dde994d | 2021-08-17 17:15:08 -0500 | [diff] [blame] | 147 | check arch/x86/include/asm/amd-ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"' |
Arnaldo Carvalho de Melo | be709d4 | 2019-03-25 14:06:07 -0300 | [diff] [blame] | 148 | 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] | 149 | check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"' |
Arnaldo Carvalho de Melo | e3698b2 | 2020-04-14 10:27:39 -0300 | [diff] [blame] | 150 | check include/linux/build_bug.h '-I "^#\(ifndef\|endif\)\( \/\/\)* static_assert$"' |
Arnaldo Carvalho de Melo | 3052ba5 | 2019-06-25 17:27:31 -0300 | [diff] [blame] | 151 | check include/linux/ctype.h '-I "isdigit("' |
| 152 | check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B' |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 153 | |
Jiri Olsa | c9b51a0 | 2018-08-13 13:15:04 +0200 | [diff] [blame] | 154 | # diff non-symmetric files |
| 155 | check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl |
Tiezhu Yang | 9bad32b | 2020-12-18 15:59:21 +0800 | [diff] [blame] | 156 | check_2 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl |
Tiezhu Yang | 22ffc3f | 2020-12-18 15:59:22 +0800 | [diff] [blame] | 157 | check_2 tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl |
Tiezhu Yang | d9fd5a7 | 2021-02-04 11:35:24 +0800 | [diff] [blame] | 158 | check_2 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl |
Jiri Olsa | c9b51a0 | 2018-08-13 13:15:04 +0200 | [diff] [blame] | 159 | |
Arnaldo Carvalho de Melo | d758d5d | 2020-09-29 08:56:38 -0300 | [diff] [blame] | 160 | for i in $BEAUTY_FILES; do |
| 161 | beauty_check $i -B |
| 162 | done |
Arnaldo Carvalho de Melo | f3cf7fa | 2020-08-12 08:43:51 -0300 | [diff] [blame] | 163 | |
Ian Rogers | eee1950 | 2020-05-15 15:17:29 -0700 | [diff] [blame] | 164 | # check duplicated library files |
| 165 | check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h |
| 166 | check_2 tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c |
| 167 | |
Jiri Olsa | 7ea6e98 | 2018-08-13 13:15:03 +0200 | [diff] [blame] | 168 | cd tools/perf |