1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Generic dynamic event - selective clear (compatibility)
4# requires: dynamic_events kprobe_events synthetic_events "place: [<module>:]<symbol>":README "place (kretprobe): [<module>:]<symbol>":README "s:[synthetic/]":README
5
6echo 0 > events/enable
7echo > dynamic_events
8
9PLACE=$FUNCTION_FORK
10
11setup_events() {
12echo "p:myevent1 $PLACE" >> dynamic_events
13echo "s:latency1 u64 lat; pid_t pid;" >> dynamic_events
14echo "r:myevent2 $PLACE" >> dynamic_events
15echo "s:latency2 u64 lat; pid_t pid;" >> dynamic_events
16
17grep -q myevent1 dynamic_events
18grep -q myevent2 dynamic_events
19grep -q latency1 dynamic_events
20grep -q latency2 dynamic_events
21}
22
23setup_events
24echo > synthetic_events
25
26grep -q myevent1 dynamic_events
27grep -q myevent2 dynamic_events
28! grep -q latency1 dynamic_events
29! grep -q latency2 dynamic_events
30
31echo > dynamic_events
32
33setup_events
34echo > kprobe_events
35
36! grep -q myevent1 dynamic_events
37! grep -q myevent2 dynamic_events
38grep -q latency1 dynamic_events
39grep -q latency2 dynamic_events
40
41echo > dynamic_events
42