1 #!/bin/sh 2 # SPDX-License-Identifier: GPL-2.0 3 # description: Create/delete multiprobe on kprobe event 4 # requires: kprobe_events "Create/append/":README 5 6 # Choose 2 symbols for target 7 SYM1=$FUNCTION_FORK 8 SYM2=do_exit 9 EVENT_NAME=kprobes/testevent 10 11 DEF1="p:$EVENT_NAME $SYM1" 12 DEF2="p:$EVENT_NAME $SYM2" 13 14 :;: "Define an event which has 2 probes" ;: 15 echo $DEF1 >> kprobe_events 16 echo $DEF2 >> kprobe_events 17 cat kprobe_events | grep "$DEF1" 18 cat kprobe_events | grep "$DEF2" 19 20 :;: "Remove the event by name (should remove both)" ;: 21 echo "-:$EVENT_NAME" >> kprobe_events 22 test `cat kprobe_events | wc -l` -eq 0 23 24 :;: "Remove just 1 event" ;: 25 echo $DEF1 >> kprobe_events 26 echo $DEF2 >> kprobe_events 27 echo "-:$EVENT_NAME $SYM1" >> kprobe_events 28 ! cat kprobe_events | grep "$DEF1" 29 cat kprobe_events | grep "$DEF2" 30 31 :;: "Appending different type must fail" ;: 32 ! echo "$DEF1 \$stack" >> kprobe_events
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.