xref: /openbmc/linux/tools/perf/check-headers.sh (revision 8730046c)
1#!/bin/sh
2
3HEADERS='
4include/uapi/linux/perf_event.h
5include/linux/hash.h
6include/uapi/linux/hw_breakpoint.h
7arch/x86/include/asm/disabled-features.h
8arch/x86/include/asm/required-features.h
9arch/x86/include/asm/cpufeatures.h
10arch/arm/include/uapi/asm/perf_regs.h
11arch/arm64/include/uapi/asm/perf_regs.h
12arch/powerpc/include/uapi/asm/perf_regs.h
13arch/x86/include/uapi/asm/perf_regs.h
14arch/x86/include/uapi/asm/kvm.h
15arch/x86/include/uapi/asm/kvm_perf.h
16arch/x86/include/uapi/asm/svm.h
17arch/x86/include/uapi/asm/vmx.h
18arch/powerpc/include/uapi/asm/kvm.h
19arch/s390/include/uapi/asm/kvm.h
20arch/s390/include/uapi/asm/kvm_perf.h
21arch/s390/include/uapi/asm/sie.h
22arch/arm/include/uapi/asm/kvm.h
23arch/arm64/include/uapi/asm/kvm.h
24include/asm-generic/bitops/arch_hweight.h
25include/asm-generic/bitops/const_hweight.h
26include/asm-generic/bitops/__fls.h
27include/asm-generic/bitops/fls.h
28include/asm-generic/bitops/fls64.h
29include/linux/coresight-pmu.h
30include/uapi/asm-generic/mman-common.h
31'
32
33check () {
34  file=$1
35  opts=
36
37  shift
38  while [ -n "$*" ]; do
39    opts="$opts \"$1\""
40    shift
41  done
42
43  cmd="diff $opts ../$file ../../$file > /dev/null"
44
45  test -f ../../$file &&
46  eval $cmd || echo "Warning: $file differs from kernel" >&2
47}
48
49
50# simple diff check
51for i in $HEADERS; do
52  check $i -B
53done
54
55# diff with extra ignore lines
56check arch/x86/lib/memcpy_64.S        -B -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
57check arch/x86/lib/memset_64.S        -B -I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"
58check include/uapi/asm-generic/mman.h -B -I "^#include <\(uapi/\)*asm-generic/mman-common.h>"
59check include/uapi/linux/mman.h       -B -I "^#include <\(uapi/\)*asm/mman.h>"
60