2016-12-06 14:18:51 +01:00
|
|
|
#!/bin/sh
|
2017-11-01 15:07:57 +01:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
2016-12-06 14:18:51 +01:00
|
|
|
|
2019-08-29 17:41:21 -05:00
|
|
|
FILES='
|
2019-08-19 11:00:54 -03:00
|
|
|
include/uapi/linux/const.h
|
2017-07-31 16:45:32 -03:00
|
|
|
include/uapi/drm/drm.h
|
|
|
|
|
include/uapi/drm/i915_drm.h
|
2018-12-18 16:15:53 -03:00
|
|
|
include/uapi/linux/fadvise.h
|
2017-03-30 11:16:59 -03:00
|
|
|
include/uapi/linux/fcntl.h
|
2018-10-24 14:31:12 -03:00
|
|
|
include/uapi/linux/fs.h
|
2019-09-27 12:01:26 -03:00
|
|
|
include/uapi/linux/fscrypt.h
|
2017-10-31 10:04:11 -03:00
|
|
|
include/uapi/linux/kcmp.h
|
2017-07-31 16:45:32 -03:00
|
|
|
include/uapi/linux/kvm.h
|
2018-07-26 09:26:13 -03:00
|
|
|
include/uapi/linux/in.h
|
2019-01-08 13:42:37 -03:00
|
|
|
include/uapi/linux/mount.h
|
2020-02-11 11:58:56 -03:00
|
|
|
include/uapi/linux/openat2.h
|
2016-12-06 14:18:51 +01:00
|
|
|
include/uapi/linux/perf_event.h
|
2017-10-26 14:41:01 -03:00
|
|
|
include/uapi/linux/prctl.h
|
2017-07-20 10:46:34 -03:00
|
|
|
include/uapi/linux/sched.h
|
2017-03-30 11:16:59 -03:00
|
|
|
include/uapi/linux/stat.h
|
2018-12-27 14:18:13 -03:00
|
|
|
include/uapi/linux/usbdevice_fs.h
|
2017-07-31 16:45:32 -03:00
|
|
|
include/uapi/linux/vhost.h
|
2017-07-31 16:45:32 -03:00
|
|
|
include/uapi/sound/asound.h
|
2018-09-25 10:55:59 -03:00
|
|
|
include/linux/bits.h
|
2020-04-14 10:27:39 -03:00
|
|
|
include/vdso/bits.h
|
2019-08-19 11:00:54 -03:00
|
|
|
include/linux/const.h
|
2020-04-14 08:52:23 -03:00
|
|
|
include/vdso/const.h
|
2016-12-06 14:18:51 +01:00
|
|
|
include/linux/hash.h
|
2021-10-15 10:21:12 -07:00
|
|
|
include/linux/list-sort.h
|
2016-12-06 14:18:51 +01:00
|
|
|
include/uapi/linux/hw_breakpoint.h
|
|
|
|
|
arch/x86/include/asm/disabled-features.h
|
|
|
|
|
arch/x86/include/asm/required-features.h
|
|
|
|
|
arch/x86/include/asm/cpufeatures.h
|
2019-08-29 17:41:21 -05:00
|
|
|
arch/x86/include/asm/inat_types.h
|
2019-09-06 22:14:10 +09:00
|
|
|
arch/x86/include/asm/emulate_prefix.h
|
2019-10-15 15:40:23 -03:00
|
|
|
arch/x86/include/asm/irq_vectors.h
|
2019-09-26 15:26:39 -03:00
|
|
|
arch/x86/include/asm/msr-index.h
|
2018-12-17 16:15:27 -03:00
|
|
|
arch/x86/include/uapi/asm/prctl.h
|
2019-08-29 17:41:21 -05:00
|
|
|
arch/x86/lib/x86-opcode-map.txt
|
|
|
|
|
arch/x86/tools/gen-insn-attr-x86.awk
|
2016-12-06 14:18:51 +01:00
|
|
|
arch/arm/include/uapi/asm/perf_regs.h
|
|
|
|
|
arch/arm64/include/uapi/asm/perf_regs.h
|
2021-06-01 19:53:56 +08:00
|
|
|
arch/mips/include/uapi/asm/perf_regs.h
|
2016-12-06 14:18:51 +01:00
|
|
|
arch/powerpc/include/uapi/asm/perf_regs.h
|
2017-11-28 11:08:41 -03:00
|
|
|
arch/s390/include/uapi/asm/perf_regs.h
|
2016-12-06 14:18:51 +01:00
|
|
|
arch/x86/include/uapi/asm/perf_regs.h
|
|
|
|
|
arch/x86/include/uapi/asm/kvm.h
|
|
|
|
|
arch/x86/include/uapi/asm/kvm_perf.h
|
|
|
|
|
arch/x86/include/uapi/asm/svm.h
|
2017-07-18 17:09:21 -03:00
|
|
|
arch/x86/include/uapi/asm/unistd.h
|
2016-12-06 14:18:51 +01:00
|
|
|
arch/x86/include/uapi/asm/vmx.h
|
|
|
|
|
arch/powerpc/include/uapi/asm/kvm.h
|
|
|
|
|
arch/s390/include/uapi/asm/kvm.h
|
|
|
|
|
arch/s390/include/uapi/asm/kvm_perf.h
|
2017-12-04 10:56:49 +01:00
|
|
|
arch/s390/include/uapi/asm/ptrace.h
|
2016-12-06 14:18:51 +01:00
|
|
|
arch/s390/include/uapi/asm/sie.h
|
|
|
|
|
arch/arm/include/uapi/asm/kvm.h
|
|
|
|
|
arch/arm64/include/uapi/asm/kvm.h
|
2018-07-06 16:34:34 -05:00
|
|
|
arch/arm64/include/uapi/asm/unistd.h
|
2018-01-19 09:56:13 +01:00
|
|
|
arch/alpha/include/uapi/asm/errno.h
|
|
|
|
|
arch/mips/include/asm/errno.h
|
|
|
|
|
arch/mips/include/uapi/asm/errno.h
|
|
|
|
|
arch/parisc/include/uapi/asm/errno.h
|
|
|
|
|
arch/powerpc/include/uapi/asm/errno.h
|
|
|
|
|
arch/sparc/include/uapi/asm/errno.h
|
|
|
|
|
arch/x86/include/uapi/asm/errno.h
|
2016-12-06 14:18:51 +01:00
|
|
|
include/asm-generic/bitops/arch_hweight.h
|
|
|
|
|
include/asm-generic/bitops/const_hweight.h
|
|
|
|
|
include/asm-generic/bitops/__fls.h
|
|
|
|
|
include/asm-generic/bitops/fls.h
|
|
|
|
|
include/asm-generic/bitops/fls64.h
|
|
|
|
|
include/linux/coresight-pmu.h
|
2018-01-19 09:56:14 +01:00
|
|
|
include/uapi/asm-generic/errno.h
|
|
|
|
|
include/uapi/asm-generic/errno-base.h
|
2017-07-31 22:52:28 -03:00
|
|
|
include/uapi/asm-generic/ioctls.h
|
2016-12-06 14:18:51 +01:00
|
|
|
include/uapi/asm-generic/mman-common.h
|
2018-07-06 16:34:34 -05:00
|
|
|
include/uapi/asm-generic/unistd.h
|
2016-12-06 14:18:51 +01:00
|
|
|
'
|
|
|
|
|
|
2021-02-22 13:34:40 +01:00
|
|
|
SYNC_CHECK_FILES='
|
|
|
|
|
arch/x86/include/asm/inat.h
|
|
|
|
|
arch/x86/include/asm/insn.h
|
|
|
|
|
arch/x86/lib/inat.c
|
|
|
|
|
arch/x86/lib/insn.c
|
|
|
|
|
'
|
|
|
|
|
|
2020-09-29 08:56:38 -03:00
|
|
|
# These copies are under tools/perf/trace/beauty/ as they are not used to in
|
|
|
|
|
# building object files only by scripts in tools/perf/trace/beauty/ to generate
|
|
|
|
|
# tables that then gets included in .c files for things like id->string syscall
|
|
|
|
|
# tables (and the reverse lookup as well: string -> id)
|
|
|
|
|
|
|
|
|
|
BEAUTY_FILES='
|
|
|
|
|
include/linux/socket.h
|
|
|
|
|
'
|
|
|
|
|
|
2018-04-23 11:08:16 +02:00
|
|
|
check_2 () {
|
|
|
|
|
file1=$1
|
|
|
|
|
file2=$2
|
|
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
|
|
cmd="diff $* $file1 $file2 > /dev/null"
|
|
|
|
|
|
2018-08-11 11:39:15 +03:00
|
|
|
test -f $file2 && {
|
|
|
|
|
eval $cmd || {
|
2018-08-13 13:15:03 +02:00
|
|
|
echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
|
|
|
|
|
echo diff -u $file1 $file2
|
2018-08-11 11:39:15 +03:00
|
|
|
}
|
|
|
|
|
}
|
2018-04-23 11:08:16 +02:00
|
|
|
}
|
|
|
|
|
|
2016-12-06 14:18:51 +01:00
|
|
|
check () {
|
|
|
|
|
file=$1
|
|
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
2018-08-13 13:15:03 +02:00
|
|
|
check_2 tools/$file $file $*
|
2016-12-06 14:18:51 +01:00
|
|
|
}
|
|
|
|
|
|
2020-09-29 08:56:38 -03:00
|
|
|
beauty_check () {
|
|
|
|
|
file=$1
|
|
|
|
|
|
|
|
|
|
shift
|
|
|
|
|
|
|
|
|
|
check_2 tools/perf/trace/beauty/$file $file $*
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-16 15:53:08 -03:00
|
|
|
# Check if we have the kernel headers (tools/perf/../../include), else
|
|
|
|
|
# we're probably on a detached tarball, so no point in trying to check
|
|
|
|
|
# differences.
|
|
|
|
|
test -d ../../include || exit 0
|
|
|
|
|
|
2018-08-13 13:15:03 +02:00
|
|
|
cd ../..
|
|
|
|
|
|
2016-12-06 14:18:51 +01:00
|
|
|
# simple diff check
|
2019-08-29 17:41:21 -05:00
|
|
|
for i in $FILES; do
|
2016-12-06 14:18:51 +01:00
|
|
|
check $i -B
|
|
|
|
|
done
|
|
|
|
|
|
2021-02-22 13:34:40 +01:00
|
|
|
for i in $SYNC_CHECK_FILES; do
|
|
|
|
|
check $i '-I "^.*\/\*.*__ignore_sync_check__.*\*\/.*$"'
|
|
|
|
|
done
|
|
|
|
|
|
2016-12-06 14:18:51 +01:00
|
|
|
# diff with extra ignore lines
|
2019-12-02 11:40:57 -03:00
|
|
|
check arch/x86/lib/memcpy_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memcpy_\(erms\|orig\))"'
|
|
|
|
|
check arch/x86/lib/memset_64.S '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>" -I"^SYM_FUNC_START\(_LOCAL\)*(memset_\(erms\|orig\))"'
|
2021-08-17 17:15:08 -05:00
|
|
|
check arch/x86/include/asm/amd-ibs.h '-I "^#include [<\"]\(asm/\)*msr-index.h"'
|
2019-03-25 14:06:07 -03:00
|
|
|
check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
|
2018-04-23 11:08:15 +02:00
|
|
|
check include/uapi/linux/mman.h '-I "^#include <\(uapi/\)*asm/mman.h>"'
|
2020-04-14 10:27:39 -03:00
|
|
|
check include/linux/build_bug.h '-I "^#\(ifndef\|endif\)\( \/\/\)* static_assert$"'
|
2019-06-25 17:27:31 -03:00
|
|
|
check include/linux/ctype.h '-I "isdigit("'
|
|
|
|
|
check lib/ctype.c '-I "^EXPORT_SYMBOL" -I "^#include <linux/export.h>" -B'
|
2021-10-15 10:21:12 -07:00
|
|
|
check lib/list_sort.c '-I "^#include <linux/bug.h>"'
|
2018-08-13 13:15:03 +02:00
|
|
|
|
2018-08-13 13:15:04 +02:00
|
|
|
# diff non-symmetric files
|
|
|
|
|
check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
|
2020-12-18 15:59:21 +08:00
|
|
|
check_2 tools/perf/arch/powerpc/entry/syscalls/syscall.tbl arch/powerpc/kernel/syscalls/syscall.tbl
|
2020-12-18 15:59:22 +08:00
|
|
|
check_2 tools/perf/arch/s390/entry/syscalls/syscall.tbl arch/s390/kernel/syscalls/syscall.tbl
|
2021-02-04 11:35:24 +08:00
|
|
|
check_2 tools/perf/arch/mips/entry/syscalls/syscall_n64.tbl arch/mips/kernel/syscalls/syscall_n64.tbl
|
2018-08-13 13:15:04 +02:00
|
|
|
|
2020-09-29 08:56:38 -03:00
|
|
|
for i in $BEAUTY_FILES; do
|
|
|
|
|
beauty_check $i -B
|
|
|
|
|
done
|
2020-08-12 08:43:51 -03:00
|
|
|
|
2020-05-15 15:17:29 -07:00
|
|
|
# check duplicated library files
|
|
|
|
|
check_2 tools/perf/util/hashmap.h tools/lib/bpf/hashmap.h
|
|
|
|
|
check_2 tools/perf/util/hashmap.c tools/lib/bpf/hashmap.c
|
|
|
|
|
|
2018-08-13 13:15:03 +02:00
|
|
|
cd tools/perf
|