Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: GPL-2.0 |
| 3 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 4 | FILES=' |
| 5 | include/uapi/linux/const.h |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 6 | include/uapi/drm/drm.h |
| 7 | include/uapi/drm/i915_drm.h |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 8 | include/uapi/linux/fadvise.h |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 9 | include/uapi/linux/fcntl.h |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 10 | include/uapi/linux/fs.h |
| 11 | include/uapi/linux/fscrypt.h |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 12 | include/uapi/linux/kcmp.h |
| 13 | include/uapi/linux/kvm.h |
| 14 | include/uapi/linux/in.h |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 15 | include/uapi/linux/mount.h |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 16 | include/uapi/linux/openat2.h |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 17 | include/uapi/linux/perf_event.h |
| 18 | include/uapi/linux/prctl.h |
| 19 | include/uapi/linux/sched.h |
| 20 | include/uapi/linux/stat.h |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 21 | include/uapi/linux/usbdevice_fs.h |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 22 | include/uapi/linux/vhost.h |
| 23 | include/uapi/sound/asound.h |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 24 | include/linux/bits.h |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 25 | include/vdso/bits.h |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 26 | include/linux/const.h |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 27 | include/vdso/const.h |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [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 |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 33 | arch/x86/include/asm/inat_types.h |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 34 | arch/x86/include/asm/emulate_prefix.h |
| 35 | arch/x86/include/asm/irq_vectors.h |
| 36 | arch/x86/include/asm/msr-index.h |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 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 |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 40 | arch/arm/include/uapi/asm/perf_regs.h |
| 41 | arch/arm64/include/uapi/asm/perf_regs.h |
| 42 | arch/powerpc/include/uapi/asm/perf_regs.h |
| 43 | arch/s390/include/uapi/asm/perf_regs.h |
| 44 | arch/x86/include/uapi/asm/perf_regs.h |
| 45 | arch/x86/include/uapi/asm/kvm.h |
| 46 | arch/x86/include/uapi/asm/kvm_perf.h |
| 47 | arch/x86/include/uapi/asm/svm.h |
| 48 | arch/x86/include/uapi/asm/unistd.h |
| 49 | arch/x86/include/uapi/asm/vmx.h |
| 50 | arch/powerpc/include/uapi/asm/kvm.h |
| 51 | arch/s390/include/uapi/asm/kvm.h |
| 52 | arch/s390/include/uapi/asm/kvm_perf.h |
| 53 | arch/s390/include/uapi/asm/ptrace.h |
| 54 | arch/s390/include/uapi/asm/sie.h |
| 55 | arch/arm/include/uapi/asm/kvm.h |
| 56 | arch/arm64/include/uapi/asm/kvm.h |
| 57 | arch/arm64/include/uapi/asm/unistd.h |
| 58 | arch/alpha/include/uapi/asm/errno.h |
| 59 | arch/mips/include/asm/errno.h |
| 60 | arch/mips/include/uapi/asm/errno.h |
| 61 | arch/parisc/include/uapi/asm/errno.h |
| 62 | arch/powerpc/include/uapi/asm/errno.h |
| 63 | arch/sparc/include/uapi/asm/errno.h |
| 64 | arch/x86/include/uapi/asm/errno.h |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 65 | include/asm-generic/bitops/arch_hweight.h |
| 66 | include/asm-generic/bitops/const_hweight.h |
| 67 | include/asm-generic/bitops/__fls.h |
| 68 | include/asm-generic/bitops/fls.h |
| 69 | include/asm-generic/bitops/fls64.h |
| 70 | include/linux/coresight-pmu.h |
| 71 | include/uapi/asm-generic/errno.h |
| 72 | include/uapi/asm-generic/errno-base.h |
| 73 | include/uapi/asm-generic/ioctls.h |
| 74 | include/uapi/asm-generic/mman-common.h |
| 75 | include/uapi/asm-generic/unistd.h |
| 76 | ' |
| 77 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 78 | # These copies are under tools/perf/trace/beauty/ as they are not used to in |
| 79 | # building object files only by scripts in tools/perf/trace/beauty/ to generate |
| 80 | # tables that then gets included in .c files for things like id->string syscall |
| 81 | # tables (and the reverse lookup as well: string -> id) |
| 82 | |
| 83 | BEAUTY_FILES=' |
| 84 | include/linux/socket.h |
| 85 | ' |
| 86 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 87 | check_2 () { |
| 88 | file1=$1 |
| 89 | file2=$2 |
| 90 | |
| 91 | shift |
| 92 | shift |
| 93 | |
| 94 | cmd="diff $* $file1 $file2 > /dev/null" |
| 95 | |
| 96 | test -f $file2 && { |
| 97 | eval $cmd || { |
| 98 | echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2 |
| 99 | echo diff -u $file1 $file2 |
| 100 | } |
| 101 | } |
| 102 | } |
| 103 | |
| 104 | check () { |
| 105 | file=$1 |
| 106 | |
| 107 | shift |
| 108 | |
| 109 | check_2 tools/$file $file $* |
| 110 | } |
| 111 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 112 | beauty_check () { |
| 113 | file=$1 |
| 114 | |
| 115 | shift |
| 116 | |
| 117 | check_2 tools/perf/trace/beauty/$file $file $* |
| 118 | } |
| 119 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 120 | # Check if we have the kernel headers (tools/perf/../../include), else |
| 121 | # we're probably on a detached tarball, so no point in trying to check |
| 122 | # differences. |
| 123 | test -d ../../include || exit 0 |
| 124 | |
| 125 | cd ../.. |
| 126 | |
| 127 | # simple diff check |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 128 | for i in $FILES; do |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 129 | check $i -B |
| 130 | done |
| 131 | |
| 132 | # diff with extra ignore lines |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 133 | check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"' |
| 134 | check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"' |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 135 | check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"' |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 136 | check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"' |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 137 | check include/linux/build_bug.h '-I "^#\(ifndef\|endif\)\( \/\/\)* static_assert$"' |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 138 | check include/linux/ctype.h '-I "isdigit("' |
| 139 | check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B' |
| 140 | check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"' |
| 141 | check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"' |
| 142 | check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"' |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 143 | check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"' |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 144 | |
| 145 | # diff non-symmetric files |
| 146 | check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl |
| 147 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 148 | for i in $BEAUTY_FILES; do |
| 149 | beauty_check $i -B |
| 150 | done |
| 151 | |
| 152 | # check duplicated library files |
| 153 | check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h |
| 154 | check_2 tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c |
| 155 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 156 | cd tools/perf |