.. | .. |
---|
1 | 1 | #!/bin/sh |
---|
2 | 2 | # SPDX-License-Identifier: GPL-2.0 |
---|
3 | 3 | |
---|
4 | | -HEADERS=' |
---|
| 4 | +FILES=' |
---|
| 5 | +include/uapi/linux/const.h |
---|
5 | 6 | include/uapi/drm/drm.h |
---|
6 | 7 | include/uapi/drm/i915_drm.h |
---|
| 8 | +include/uapi/linux/fadvise.h |
---|
7 | 9 | include/uapi/linux/fcntl.h |
---|
| 10 | +include/uapi/linux/fs.h |
---|
| 11 | +include/uapi/linux/fscrypt.h |
---|
8 | 12 | include/uapi/linux/kcmp.h |
---|
9 | 13 | include/uapi/linux/kvm.h |
---|
10 | 14 | include/uapi/linux/in.h |
---|
| 15 | +include/uapi/linux/mount.h |
---|
| 16 | +include/uapi/linux/openat2.h |
---|
11 | 17 | include/uapi/linux/perf_event.h |
---|
12 | 18 | include/uapi/linux/prctl.h |
---|
13 | 19 | include/uapi/linux/sched.h |
---|
14 | 20 | include/uapi/linux/stat.h |
---|
| 21 | +include/uapi/linux/usbdevice_fs.h |
---|
15 | 22 | include/uapi/linux/vhost.h |
---|
16 | 23 | include/uapi/sound/asound.h |
---|
17 | 24 | include/linux/bits.h |
---|
| 25 | +include/vdso/bits.h |
---|
| 26 | +include/linux/const.h |
---|
| 27 | +include/vdso/const.h |
---|
18 | 28 | include/linux/hash.h |
---|
19 | 29 | include/uapi/linux/hw_breakpoint.h |
---|
20 | 30 | arch/x86/include/asm/disabled-features.h |
---|
21 | 31 | arch/x86/include/asm/required-features.h |
---|
22 | 32 | arch/x86/include/asm/cpufeatures.h |
---|
| 33 | +arch/x86/include/asm/inat_types.h |
---|
| 34 | +arch/x86/include/asm/emulate_prefix.h |
---|
| 35 | +arch/x86/include/asm/irq_vectors.h |
---|
| 36 | +arch/x86/include/asm/msr-index.h |
---|
| 37 | +arch/x86/include/uapi/asm/prctl.h |
---|
| 38 | +arch/x86/lib/x86-opcode-map.txt |
---|
| 39 | +arch/x86/tools/gen-insn-attr-x86.awk |
---|
23 | 40 | arch/arm/include/uapi/asm/perf_regs.h |
---|
24 | 41 | arch/arm64/include/uapi/asm/perf_regs.h |
---|
25 | 42 | arch/powerpc/include/uapi/asm/perf_regs.h |
---|
.. | .. |
---|
45 | 62 | arch/powerpc/include/uapi/asm/errno.h |
---|
46 | 63 | arch/sparc/include/uapi/asm/errno.h |
---|
47 | 64 | arch/x86/include/uapi/asm/errno.h |
---|
48 | | -arch/powerpc/include/uapi/asm/unistd.h |
---|
49 | 65 | include/asm-generic/bitops/arch_hweight.h |
---|
50 | 66 | include/asm-generic/bitops/const_hweight.h |
---|
51 | 67 | include/asm-generic/bitops/__fls.h |
---|
.. | .. |
---|
57 | 73 | include/uapi/asm-generic/ioctls.h |
---|
58 | 74 | include/uapi/asm-generic/mman-common.h |
---|
59 | 75 | include/uapi/asm-generic/unistd.h |
---|
| 76 | +' |
---|
| 77 | + |
---|
| 78 | +SYNC_CHECK_FILES=' |
---|
| 79 | +arch/x86/include/asm/inat.h |
---|
| 80 | +arch/x86/include/asm/insn.h |
---|
| 81 | +arch/x86/lib/inat.c |
---|
| 82 | +arch/x86/lib/insn.c |
---|
| 83 | +' |
---|
| 84 | + |
---|
| 85 | +# These copies are under tools/perf/trace/beauty/ as they are not used to in |
---|
| 86 | +# building object files only by scripts in tools/perf/trace/beauty/ to generate |
---|
| 87 | +# tables that then gets included in .c files for things like id->string syscall |
---|
| 88 | +# tables (and the reverse lookup as well: string -> id) |
---|
| 89 | + |
---|
| 90 | +BEAUTY_FILES=' |
---|
| 91 | +include/linux/socket.h |
---|
60 | 92 | ' |
---|
61 | 93 | |
---|
62 | 94 | check_2 () { |
---|
.. | .. |
---|
84 | 116 | check_2 tools/$file $file $* |
---|
85 | 117 | } |
---|
86 | 118 | |
---|
| 119 | +beauty_check () { |
---|
| 120 | + file=$1 |
---|
| 121 | + |
---|
| 122 | + shift |
---|
| 123 | + |
---|
| 124 | + check_2 tools/perf/trace/beauty/$file $file $* |
---|
| 125 | +} |
---|
| 126 | + |
---|
87 | 127 | # Check if we have the kernel headers (tools/perf/../../include), else |
---|
88 | 128 | # we're probably on a detached tarball, so no point in trying to check |
---|
89 | 129 | # differences. |
---|
.. | .. |
---|
92 | 132 | cd ../.. |
---|
93 | 133 | |
---|
94 | 134 | # simple diff check |
---|
95 | | -for i in $HEADERS; do |
---|
| 135 | +for i in $FILES; do |
---|
96 | 136 | check $i -B |
---|
97 | 137 | done |
---|
98 | 138 | |
---|
| 139 | +for i in $SYNC_CHECK_FILES; do |
---|
| 140 | + check $i '-I "^.*\/\*.*__ignore_sync_check__.*\*\/.*$"' |
---|
| 141 | +done |
---|
| 142 | + |
---|
99 | 143 | # diff with extra ignore lines |
---|
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>"' |
---|
| 144 | +check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"' |
---|
| 145 | +check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"' |
---|
| 146 | +check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"' |
---|
103 | 147 | check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"' |
---|
| 148 | +check include/linux/build_bug.h '-I "^#\(ifndef\|endif\)\( \/\/\)* static_assert$"' |
---|
| 149 | +check include/linux/ctype.h '-I "isdigit("' |
---|
| 150 | +check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B' |
---|
104 | 151 | |
---|
105 | 152 | # diff non-symmetric files |
---|
106 | 153 | check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl |
---|
107 | 154 | |
---|
| 155 | +for i in $BEAUTY_FILES; do |
---|
| 156 | + beauty_check $i -B |
---|
| 157 | +done |
---|
| 158 | + |
---|
| 159 | +# check duplicated library files |
---|
| 160 | +check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h |
---|
| 161 | +check_2 tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c |
---|
| 162 | + |
---|
108 | 163 | cd tools/perf |
---|