2 # SPDX-License-Identifier: GPL-2.0
3 # description: Create/delete multiprobe on kprobe event
4 # requires: kprobe_events "Create/append/":README
6 # Choose 2 symbols for target
9 EVENT_NAME
=kprobes
/testevent
11 DEF1
="p:$EVENT_NAME $SYM1"
12 DEF2
="p:$EVENT_NAME $SYM2"
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"
20 :;: "Remove the event by name (should remove both)" ;:
21 echo "-:$EVENT_NAME" >> kprobe_events
22 test `cat kprobe_events | wc -l` -eq 0
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"
31 :;: "Appending different type must fail" ;:
32 ! echo "$DEF1 \$stack" >> kprobe_events