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

TOMOYO Linux Cross Reference
Linux/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_btfarg.tc

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

  1 #!/bin/sh
  2 # SPDX-License-Identifier: GPL-2.0
  3 # description: Generic dynamic event - add/remove probes with BTF arguments
  4 # requires: dynamic_events "<argname>":README
  5 
  6 KPROBES=
  7 FPROBES=
  8 FIELDS=
  9 
 10 if grep -qF "p[:[<group>/][<event>]] <place> [<args>]" README ; then
 11   KPROBES=yes
 12 fi
 13 if grep -qF "f[:[<group>/][<event>]] <func-name>[%return] [<args>]" README ; then
 14   FPROBES=yes
 15 fi
 16 if grep -qF "<argname>[->field[->field|.field...]]" README ; then
 17   FIELDS=yes
 18 fi
 19 
 20 if [ -z "$KPROBES" -a -z "$FPROBES" ] ; then
 21   exit_unsupported
 22 fi
 23 
 24 echo 0 > events/enable
 25 echo > dynamic_events
 26 
 27 TP=kfree
 28 TP2=kmem_cache_alloc
 29 TP3=getname_flags
 30 TP4=sched_wakeup
 31 
 32 if [ "$FPROBES" ] ; then
 33 echo "f:fpevent $TP object" >> dynamic_events
 34 echo "t:tpevent $TP ptr" >> dynamic_events
 35 
 36 grep -q "fpevent.*object=object" dynamic_events
 37 grep -q "tpevent.*ptr=ptr" dynamic_events
 38 
 39 echo > dynamic_events
 40 
 41 echo "f:fpevent $TP "'$arg1' >> dynamic_events
 42 grep -q "fpevent.*object=object" dynamic_events
 43 
 44 echo > dynamic_events
 45 
 46 echo "f:fpevent $TP "'$arg*' >> dynamic_events
 47 echo "t:tpevent $TP "'$arg*' >> dynamic_events
 48 
 49 grep -q "fpevent.*object=object" dynamic_events
 50 grep -q "tpevent.*ptr=ptr" dynamic_events
 51 ! grep -q "tpevent.*_data" dynamic_events
 52 fi
 53 
 54 echo > dynamic_events
 55 
 56 if [ "$FIELDS" -a "$FPROBES" ] ; then
 57 echo "t:tpevent ${TP2} obj_size=s->object_size" >> dynamic_events
 58 echo "f:fpevent ${TP3}%return path=\$retval->name:string" >> dynamic_events
 59 echo "t:tpevent2 ${TP4} p->se.group_node.next->prev" >> dynamic_events
 60 
 61 grep -q "tpevent .*obj_size=s->object_size" dynamic_events
 62 grep -q "fpevent.*path=\$retval->name:string" dynamic_events
 63 grep -q 'tpevent2 .*p->se.group_node.next->prev' dynamic_events
 64 
 65 echo > dynamic_events
 66 fi
 67 
 68 if [ "$KPROBES" ] ; then
 69 echo "p:kpevent $TP object" >> dynamic_events
 70 grep -q "kpevent.*object=object" dynamic_events
 71 
 72 echo > dynamic_events
 73 
 74 echo "p:kpevent $TP "'$arg*' >> dynamic_events
 75 grep -q "kpevent.*object=object" dynamic_events
 76 fi
 77 
 78 clear_trace

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