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

TOMOYO Linux Cross Reference
Linux/tools/perf/tests/shell/trace_btf_enum.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/tests/shell/trace_btf_enum.sh (Architecture i386) and /tools/perf/tests/shell/trace_btf_enum.sh (Architecture ppc)


  1 #!/bin/sh                                           1 #!/bin/sh
  2 # perf trace enum augmentation tests                2 # perf trace enum augmentation tests
  3 # SPDX-License-Identifier: GPL-2.0                  3 # SPDX-License-Identifier: GPL-2.0
  4                                                     4 
  5 err=0                                               5 err=0
  6 set -e                                              6 set -e
  7                                                     7 
  8 syscall="landlock_add_rule"                         8 syscall="landlock_add_rule"
  9 non_syscall="timer:hrtimer_init,timer:hrtimer_      9 non_syscall="timer:hrtimer_init,timer:hrtimer_start"
 10                                                    10 
 11 TESTPROG="perf test -w landlock"                   11 TESTPROG="perf test -w landlock"
 12                                                    12 
 13 # shellcheck source=lib/probe.sh                   13 # shellcheck source=lib/probe.sh
 14 . "$(dirname $0)"/lib/probe.sh                     14 . "$(dirname $0)"/lib/probe.sh
 15 skip_if_no_perf_trace || exit 2                    15 skip_if_no_perf_trace || exit 2
 16                                                    16 
 17 check_vmlinux() {                                  17 check_vmlinux() {
 18   echo "Checking if vmlinux exists"                18   echo "Checking if vmlinux exists"
 19   if ! ls /sys/kernel/btf/vmlinux 1>/dev/null      19   if ! ls /sys/kernel/btf/vmlinux 1>/dev/null 2>&1
 20   then                                             20   then
 21     echo "trace+enum test [Skipped missing vml     21     echo "trace+enum test [Skipped missing vmlinux BTF support]"
 22     err=2                                          22     err=2
 23   fi                                               23   fi
 24 }                                                  24 }
 25                                                    25 
 26 trace_landlock() {                                 26 trace_landlock() {
 27   echo "Tracing syscall ${syscall}"                27   echo "Tracing syscall ${syscall}"
 28                                                    28 
 29   # test flight just to see if landlock_add_ru     29   # test flight just to see if landlock_add_rule and libbpf are available
 30   $TESTPROG                                        30   $TESTPROG
 31                                                    31 
 32   if perf trace -e $syscall $TESTPROG 2>&1 | \     32   if perf trace -e $syscall $TESTPROG 2>&1 | \
 33      grep -q -E ".*landlock_add_rule\(ruleset_     33      grep -q -E ".*landlock_add_rule\(ruleset_fd: 11, rule_type: (LANDLOCK_RULE_PATH_BENEATH|LANDLOCK_RULE_NET_PORT), rule_attr: 0x[a-f0-9]+, flags: 45\) = -1.*"
 34   then                                             34   then
 35     err=0                                          35     err=0
 36   else                                             36   else
 37     err=1                                          37     err=1
 38   fi                                               38   fi
 39 }                                                  39 }
 40                                                    40 
 41 trace_non_syscall() {                              41 trace_non_syscall() {
 42   echo "Tracing non-syscall tracepoint ${non-s     42   echo "Tracing non-syscall tracepoint ${non-syscall}"
 43   if perf trace -e $non_syscall --max-events=1     43   if perf trace -e $non_syscall --max-events=1 2>&1 | \
 44      grep -q -E '.*timer:hrtimer_.*\(.*mode: H     44      grep -q -E '.*timer:hrtimer_.*\(.*mode: HRTIMER_MODE_.*\)$'
 45   then                                             45   then
 46     err=0                                          46     err=0
 47   else                                             47   else
 48     err=1                                          48     err=1
 49   fi                                               49   fi
 50 }                                                  50 }
 51                                                    51 
 52 check_vmlinux                                      52 check_vmlinux
 53                                                    53 
 54 if [ $err = 0 ]; then                              54 if [ $err = 0 ]; then
 55   trace_landlock                                   55   trace_landlock
 56 fi                                                 56 fi
 57                                                    57 
 58 if [ $err = 0 ]; then                              58 if [ $err = 0 ]; then
 59   trace_non_syscall                                59   trace_non_syscall
 60 fi                                                 60 fi
 61                                                    61 
 62 exit $err                                          62 exit $err
                                                      

~ [ 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