1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Generic dynamic event - add/remove kprobe events
4
5[ -f dynamic_events ] || exit_unsupported
6
7grep -q "place: \[<module>:\]<symbol>" README || exit_unsupported
8grep -q "place (kretprobe): \[<module>:\]<symbol>" README || exit_unsupported
9
10echo 0 > events/enable
11echo > dynamic_events
12
13PLACE=_do_fork
14
15echo "p:myevent1 $PLACE" >> dynamic_events
16echo "r:myevent2 $PLACE" >> dynamic_events
17
18grep -q myevent1 dynamic_events
19grep -q myevent2 dynamic_events
20test -d events/kprobes/myevent1
21test -d events/kprobes/myevent2
22
23echo "-:myevent2" >> dynamic_events
24
25grep -q myevent1 dynamic_events
26! grep -q myevent2 dynamic_events
27
28echo > dynamic_events
29
30clear_trace
31