~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/tools/perf/check-headers.sh

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /tools/perf/check-headers.sh (Version linux-6.12-rc7) and /tools/perf/check-headers.sh (Version linux-5.1.21)


  1 #!/bin/bash                                    !!   1 #!/bin/sh
  2 # SPDX-License-Identifier: GPL-2.0                  2 # SPDX-License-Identifier: GPL-2.0
  3                                                     3 
  4 YELLOW='\033[0;33m'                            !!   4 HEADERS='
  5 NC='\033[0m' # No Color                        !!   5 include/uapi/drm/drm.h
  6                                                !!   6 include/uapi/drm/i915_drm.h
  7 declare -a FILES                               !!   7 include/uapi/linux/fadvise.h
  8 FILES=(                                        !!   8 include/uapi/linux/fcntl.h
  9   "include/uapi/linux/const.h"                 !!   9 include/uapi/linux/fs.h
 10   "include/uapi/drm/drm.h"                     !!  10 include/uapi/linux/kcmp.h
 11   "include/uapi/drm/i915_drm.h"                !!  11 include/uapi/linux/kvm.h
 12   "include/uapi/linux/bits.h"                  !!  12 include/uapi/linux/in.h
 13   "include/uapi/linux/fadvise.h"               !!  13 include/uapi/linux/mount.h
 14   "include/uapi/linux/fscrypt.h"               !!  14 include/uapi/linux/perf_event.h
 15   "include/uapi/linux/kcmp.h"                  !!  15 include/uapi/linux/prctl.h
 16   "include/uapi/linux/kvm.h"                   !!  16 include/uapi/linux/sched.h
 17   "include/uapi/linux/in.h"                    !!  17 include/uapi/linux/stat.h
 18   "include/uapi/linux/perf_event.h"            !!  18 include/uapi/linux/usbdevice_fs.h
 19   "include/uapi/linux/seccomp.h"               !!  19 include/uapi/linux/vhost.h
 20   "include/uapi/linux/stat.h"                  !!  20 include/uapi/sound/asound.h
 21   "include/linux/bits.h"                       !!  21 include/linux/bits.h
 22   "include/vdso/bits.h"                        !!  22 include/linux/hash.h
 23   "include/linux/const.h"                      !!  23 include/uapi/linux/hw_breakpoint.h
 24   "include/vdso/const.h"                       !!  24 arch/x86/include/asm/disabled-features.h
 25   "include/vdso/unaligned.h"                   !!  25 arch/x86/include/asm/required-features.h
 26   "include/linux/hash.h"                       !!  26 arch/x86/include/asm/cpufeatures.h
 27   "include/linux/list-sort.h"                  !!  27 arch/x86/include/uapi/asm/prctl.h
 28   "include/uapi/linux/hw_breakpoint.h"         !!  28 arch/arm/include/uapi/asm/perf_regs.h
 29   "arch/x86/include/asm/disabled-features.h"   !!  29 arch/arm64/include/uapi/asm/perf_regs.h
 30   "arch/x86/include/asm/required-features.h"   !!  30 arch/powerpc/include/uapi/asm/perf_regs.h
 31   "arch/x86/include/asm/cpufeatures.h"         !!  31 arch/s390/include/uapi/asm/perf_regs.h
 32   "arch/x86/include/asm/inat_types.h"          !!  32 arch/x86/include/uapi/asm/perf_regs.h
 33   "arch/x86/include/asm/emulate_prefix.h"      !!  33 arch/x86/include/uapi/asm/kvm.h
 34   "arch/x86/include/asm/msr-index.h"           !!  34 arch/x86/include/uapi/asm/kvm_perf.h
 35   "arch/x86/lib/x86-opcode-map.txt"            !!  35 arch/x86/include/uapi/asm/svm.h
 36   "arch/x86/tools/gen-insn-attr-x86.awk"       !!  36 arch/x86/include/uapi/asm/unistd.h
 37   "arch/arm/include/uapi/asm/perf_regs.h"      !!  37 arch/x86/include/uapi/asm/vmx.h
 38   "arch/arm64/include/uapi/asm/perf_regs.h"    !!  38 arch/powerpc/include/uapi/asm/kvm.h
 39   "arch/loongarch/include/uapi/asm/perf_regs.h !!  39 arch/s390/include/uapi/asm/kvm.h
 40   "arch/mips/include/uapi/asm/perf_regs.h"     !!  40 arch/s390/include/uapi/asm/kvm_perf.h
 41   "arch/powerpc/include/uapi/asm/perf_regs.h"  !!  41 arch/s390/include/uapi/asm/ptrace.h
 42   "arch/s390/include/uapi/asm/perf_regs.h"     !!  42 arch/s390/include/uapi/asm/sie.h
 43   "arch/x86/include/uapi/asm/perf_regs.h"      !!  43 arch/arm/include/uapi/asm/kvm.h
 44   "arch/x86/include/uapi/asm/kvm.h"            !!  44 arch/arm64/include/uapi/asm/kvm.h
 45   "arch/x86/include/uapi/asm/kvm_perf.h"       !!  45 arch/arm64/include/uapi/asm/unistd.h
 46   "arch/x86/include/uapi/asm/svm.h"            !!  46 arch/alpha/include/uapi/asm/errno.h
 47   "arch/x86/include/uapi/asm/unistd.h"         !!  47 arch/mips/include/asm/errno.h
 48   "arch/x86/include/uapi/asm/vmx.h"            !!  48 arch/mips/include/uapi/asm/errno.h
 49   "arch/powerpc/include/uapi/asm/kvm.h"        !!  49 arch/parisc/include/uapi/asm/errno.h
 50   "arch/s390/include/uapi/asm/kvm.h"           !!  50 arch/powerpc/include/uapi/asm/errno.h
 51   "arch/s390/include/uapi/asm/kvm_perf.h"      !!  51 arch/sparc/include/uapi/asm/errno.h
 52   "arch/s390/include/uapi/asm/sie.h"           !!  52 arch/x86/include/uapi/asm/errno.h
 53   "arch/arm/include/uapi/asm/kvm.h"            !!  53 include/asm-generic/bitops/arch_hweight.h
 54   "arch/arm64/include/uapi/asm/kvm.h"          !!  54 include/asm-generic/bitops/const_hweight.h
 55   "arch/arm64/include/uapi/asm/unistd.h"       !!  55 include/asm-generic/bitops/__fls.h
 56   "arch/alpha/include/uapi/asm/errno.h"        !!  56 include/asm-generic/bitops/fls.h
 57   "arch/mips/include/asm/errno.h"              !!  57 include/asm-generic/bitops/fls64.h
 58   "arch/mips/include/uapi/asm/errno.h"         !!  58 include/linux/coresight-pmu.h
 59   "arch/parisc/include/uapi/asm/errno.h"       !!  59 include/uapi/asm-generic/errno.h
 60   "arch/powerpc/include/uapi/asm/errno.h"      !!  60 include/uapi/asm-generic/errno-base.h
 61   "arch/sparc/include/uapi/asm/errno.h"        !!  61 include/uapi/asm-generic/ioctls.h
 62   "arch/x86/include/uapi/asm/errno.h"          !!  62 include/uapi/asm-generic/mman-common.h
 63   "include/asm-generic/bitops/arch_hweight.h"  !!  63 include/uapi/asm-generic/unistd.h
 64   "include/asm-generic/bitops/const_hweight.h" !!  64 '
 65   "include/asm-generic/bitops/__fls.h"         << 
 66   "include/asm-generic/bitops/fls.h"           << 
 67   "include/asm-generic/bitops/fls64.h"         << 
 68   "include/linux/coresight-pmu.h"              << 
 69   "include/uapi/asm-generic/errno.h"           << 
 70   "include/uapi/asm-generic/errno-base.h"      << 
 71   "include/uapi/asm-generic/ioctls.h"          << 
 72   "include/uapi/asm-generic/mman-common.h"     << 
 73   "include/uapi/asm-generic/unistd.h"          << 
 74 )                                              << 
 75                                                << 
 76 declare -a SYNC_CHECK_FILES                    << 
 77 SYNC_CHECK_FILES=(                             << 
 78   "arch/x86/include/asm/inat.h"                << 
 79   "arch/x86/include/asm/insn.h"                << 
 80   "arch/x86/lib/inat.c"                        << 
 81   "arch/x86/lib/insn.c"                        << 
 82 )                                              << 
 83                                                << 
 84 # These copies are under tools/perf/trace/beau << 
 85 # building object files only by scripts in too << 
 86 # tables that then gets included in .c files f << 
 87 # tables (and the reverse lookup as well: stri << 
 88                                                << 
 89 declare -a BEAUTY_FILES                        << 
 90 BEAUTY_FILES=(                                 << 
 91   "arch/x86/include/asm/irq_vectors.h"         << 
 92   "arch/x86/include/uapi/asm/prctl.h"          << 
 93   "include/linux/socket.h"                     << 
 94   "include/uapi/linux/fcntl.h"                 << 
 95   "include/uapi/linux/fs.h"                    << 
 96   "include/uapi/linux/mount.h"                 << 
 97   "include/uapi/linux/prctl.h"                 << 
 98   "include/uapi/linux/sched.h"                 << 
 99   "include/uapi/linux/stat.h"                  << 
100   "include/uapi/linux/usbdevice_fs.h"          << 
101   "include/uapi/linux/vhost.h"                 << 
102   "include/uapi/sound/asound.h"                << 
103 )                                              << 
104                                                << 
105 declare -a FAILURES                            << 
106                                                    65 
107 check_2 () {                                       66 check_2 () {
108   tools_file=$1                                !!  67   file1=$1
109   orig_file=$2                                 !!  68   file2=$2
110                                                    69 
111   shift                                            70   shift
112   shift                                            71   shift
113                                                    72 
114   cmd="diff $* $tools_file $orig_file > /dev/n !!  73   cmd="diff $* $file1 $file2 > /dev/null"
115                                                    74 
116   if [ -f "$orig_file" ] && ! eval "$cmd"      !!  75   test -f $file2 && {
117   then                                         !!  76     eval $cmd || {
118     FAILURES+=(                                !!  77       echo "Warning: Kernel ABI header at '$file1' differs from latest version at '$file2'" >&2
119       "$tools_file $orig_file"                 !!  78       echo diff -u $file1 $file2
120     )                                          !!  79     }
121   fi                                           !!  80   }
122 }                                                  81 }
123                                                    82 
124 check () {                                         83 check () {
125   file=$1                                          84   file=$1
126                                                    85 
127   shift                                            86   shift
128                                                    87 
129   check_2 "tools/$file" "$file" "$@"           !!  88   check_2 tools/$file $file $*
130 }                                              << 
131                                                << 
132 beauty_check () {                              << 
133   file=$1                                      << 
134                                                << 
135   shift                                        << 
136                                                << 
137   check_2 "tools/perf/trace/beauty/$file" "$fi << 
138 }                                              << 
139                                                << 
140 check_ignore_some_hunks () {                   << 
141   orig_file="$1"                               << 
142   tools_file="tools/$orig_file"                << 
143   hunks_to_ignore="tools/perf/check-header_ign << 
144                                                << 
145   if [ ! -f "$hunks_to_ignore" ]; then         << 
146     echo "$hunks_to_ignore not found. Skipping << 
147     FAILURES+=(                                << 
148       "$tools_file $orig_file"                 << 
149     )                                          << 
150     return                                     << 
151   fi                                           << 
152                                                << 
153   cmd="diff -u \"$tools_file\" \"$orig_file\"  << 
154                                                << 
155   if [ -f "$orig_file" ] && ! eval "$cmd"      << 
156   then                                         << 
157     FAILURES+=(                                << 
158       "$tools_file $orig_file"                 << 
159     )                                          << 
160   fi                                           << 
161 }                                                  89 }
162                                                    90 
163                                                << 
164 # Check if we have the kernel headers (tools/p     91 # Check if we have the kernel headers (tools/perf/../../include), else
165 # we're probably on a detached tarball, so no      92 # we're probably on a detached tarball, so no point in trying to check
166 # differences.                                     93 # differences.
167 if ! [ -d ../../include ]                      !!  94 test -d ../../include || exit 0
168 then                                           << 
169   echo -e "${YELLOW}Warning${NC}: Skipped chec << 
170   exit 0                                       << 
171 fi                                             << 
172                                                    95 
173 cd ../..                                           96 cd ../..
174                                                    97 
175 # simple diff check                                98 # simple diff check
176 for i in "${FILES[@]}"                         !!  99 for i in $HEADERS; do
177 do                                             !! 100   check $i -B
178   check "$i" -B                                << 
179 done                                           << 
180                                                << 
181 for i in "${SYNC_CHECK_FILES[@]}"              << 
182 do                                             << 
183   check "$i" '-I "^.*\/\*.*__ignore_sync_check << 
184 done                                              101 done
185                                                   102 
186 # diff with extra ignore lines                    103 # diff with extra ignore lines
187 check arch/x86/lib/memcpy_64.S        '-I "^EX !! 104 check arch/x86/lib/memcpy_64.S        '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
188 check arch/x86/lib/memset_64.S        '-I "^EX !! 105 check arch/x86/lib/memset_64.S        '-I "^EXPORT_SYMBOL" -I "^#include <asm/export.h>"'
189 check arch/x86/include/asm/amd-ibs.h  '-I "^#i << 
190 check arch/arm64/include/asm/cputype.h '-I "^# << 
191 check include/linux/unaligned.h '-I "^#include << 
192 check include/uapi/asm-generic/mman.h '-I "^#i    106 check include/uapi/asm-generic/mman.h '-I "^#include <\(uapi/\)*asm-generic/mman-common\(-tools\)*.h>"'
193 check include/uapi/linux/mman.h       '-I "^#i    107 check include/uapi/linux/mman.h       '-I "^#include <\(uapi/\)*asm/mman.h>"'
194 check include/linux/build_bug.h       '-I "^#\ << 
195 check include/linux/ctype.h           '-I "isd << 
196 check lib/ctype.c                     '-I "^EX << 
197                                                   108 
198 # diff non-symmetric files                        109 # diff non-symmetric files
199 check_2 tools/perf/arch/x86/entry/syscalls/sys << 
200 check_2 tools/perf/arch/x86/entry/syscalls/sys    110 check_2 tools/perf/arch/x86/entry/syscalls/syscall_64.tbl arch/x86/entry/syscalls/syscall_64.tbl
201 check_2 tools/perf/arch/powerpc/entry/syscalls << 
202 check_2 tools/perf/arch/s390/entry/syscalls/sy << 
203 check_2 tools/perf/arch/mips/entry/syscalls/sy << 
204                                                << 
205 for i in "${BEAUTY_FILES[@]}"                  << 
206 do                                             << 
207   beauty_check "$i" -B                         << 
208 done                                           << 
209                                                   111 
210 # check duplicated library files               !! 112 cd tools/perf
211 check_2 tools/perf/util/hashmap.h tools/lib/bp << 
212 check_2 tools/perf/util/hashmap.c tools/lib/bp << 
213                                                << 
214 # Files with larger differences                << 
215                                                << 
216 check_ignore_some_hunks lib/list_sort.c        << 
217                                                << 
218 cd tools/perf || exit                          << 
219                                                << 
220 if [ ${#FAILURES[@]} -gt 0 ]                   << 
221 then                                           << 
222   echo -e "${YELLOW}Warning${NC}: Kernel ABI h << 
223   for i in "${FAILURES[@]}"                    << 
224   do                                           << 
225     echo "  diff -u $i"                        << 
226   done                                         << 
227 fi                                             << 
                                                      

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php