1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Generic dynamic event - add/remove fprobe events
4# requires: dynamic_events "f[:[<group>/][<event>]] <func-name>[%return] [<args>]":README
5
6echo 0 > events/enable
7echo > dynamic_events
8
9PLACE=$FUNCTION_FORK
10
11echo "f:myevent1 $PLACE" >> dynamic_events
12echo "f:myevent2 $PLACE%return" >> dynamic_events
13
14grep -q myevent1 dynamic_events
15grep -q myevent2 dynamic_events
16test -d events/fprobes/myevent1
17test -d events/fprobes/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