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