xref: /openbmc/linux/tools/perf/check-headers.sh (revision e2c75e76)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4HEADERS='
5include/uapi/drm/drm.h
6include/uapi/drm/i915_drm.h
7include/uapi/linux/fcntl.h
8include/uapi/linux/kcmp.h
9include/uapi/linux/kvm.h
10include/uapi/linux/perf_event.h
11include/uapi/linux/prctl.h
12include/uapi/linux/sched.h
13include/uapi/linux/stat.h
14include/uapi/linux/vhost.h
15include/uapi/sound/asound.h
16include/linux/hash.h
17include/uapi/linux/hw_breakpoint.h
18arch/x86/include/asm/disabled-features.h
19arch/x86/include/asm/required-features.h
20arch/x86/include/asm/cpufeatures.h
21arch/arm/include/uapi/asm/perf_regs.h
22arch/arm64/include/uapi/asm/perf_regs.h
23arch/powerpc/include/uapi/asm/perf_regs.h
24arch/s390/include/uapi/asm/perf_regs.h
25arch/x86/include/uapi/asm/perf_regs.h
26arch/x86/include/uapi/asm/kvm.h
27arch/x86/include/uapi/asm/kvm_perf.h
28arch/x86/include/uapi/asm/svm.h
29arch/x86/include/uapi/asm/unistd.h
30arch/x86/include/uapi/asm/vmx.h
31arch/powerpc/include/uapi/asm/kvm.h
32arch/s390/include/uapi/asm/kvm.h
33arch/s390/include/uapi/asm/kvm_perf.h
34arch/s390/include/uapi/asm/ptrace.h
35arch/s390/include/uapi/asm/sie.h
36arch/arm/include/uapi/asm/kvm.h
37arch/arm64/include/uapi/asm/kvm.h
38arch/alpha/include/uapi/asm/errno.h
39arch/mips/include/asm/errno.h
40arch/mips/include/uapi/asm/errno.h
41arch/parisc/include/uapi/asm/errno.h
42arch/powerpc/include/uapi/asm/errno.h
43arch/sparc/include/uapi/asm/errno.h
44arch/x86/include/uapi/asm/errno.h
45include/asm-generic/bitops/arch_hweight.h
46include/asm-generic/bitops/const_hweight.h
47include/asm-generic/bitops/__fls.h
48include/asm-generic/bitops/fls.h
49include/asm-generic/bitops/fls64.h
50include/linux/coresight-pmu.h
51include/uapi/asm-generic/errno.h
52include/uapi/asm-generic/errno-base.h
53include/uapi/asm-generic/ioctls.h
54include/uapi/asm-generic/mman-common.h
55'
56
57check () {
58  file=$1
59
60  shift
61  while [ -n "$*" ]; do
62    opts="$opts \"$1\""
63    shift
64  done
65
66  cmd="diff $opts ../$file ../../$file > /dev/null"
67
68  test -f ../../$file &&
69  eval $cmd || echo "Warning: Kernel ABI header at 'tools/$file' differs from latest version at '$file'" >&2
70}
71
72
73# Check if we have the kernel headers (tools/perf/../../include), else
74# we're probably on a detached tarball, so no point in trying to check
75# differences.
76test -d ../../include || exit 0
77
78# simple diff check
79for i in $HEADERS; do
80  check $i -B
81done
82
83# diff with extra ignore lines
84check arch/x86/lib/memcpy_64.S        -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
85check arch/x86/lib/memset_64.S        -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
86check include/uapi/asm-generic/mman.h -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
87check include/uapi/linux/mman.h       -I "^#include <\(uapi/\)*asm/mman.h>"
88