xref: /linux/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_kprobe.tc (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Generic dynamic event - add/remove kprobe events
4# requires: dynamic_events "place: [<module>:]<symbol>":README "place (kretprobe): [<module>:]<symbol>":README
5
6echo 0 > events/enable
7echo > dynamic_events
8
9PLACE=$FUNCTION_FORK
10
11echo "p:myevent1 $PLACE" >> dynamic_events
12echo "r:myevent2 $PLACE" >> dynamic_events
13
14grep -q myevent1 dynamic_events
15grep -q myevent2 dynamic_events
16test -d events/kprobes/myevent1
17test -d events/kprobes/myevent2
18
19echo "-:myevent2" >> dynamic_events
20
21grep -q myevent1 dynamic_events
22! grep -q myevent2 dynamic_events
23
24echo > dynamic_events
25
26clear_trace
27