xref: /linux/tools/testing/selftests/ftrace/test.d/dynevent/generic_clear_event.tc (revision 9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Generic dynamic event - generic clear event
4# requires: dynamic_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
24
25echo "!p:myevent1 $PLACE" >> dynamic_events
26! grep -q myevent1 dynamic_events
27grep -q myevent2 dynamic_events
28grep -q latency1 dynamic_events
29grep -q latency2 dynamic_events
30
31echo "!s:latency1 u64 lat; pid_t pid;" >> dynamic_events
32grep -q myevent2 dynamic_events
33! grep -q latency1 dynamic_events
34grep -q latency2 dynamic_events
35
36echo "!r:myevent2 $PLACE" >> dynamic_events
37! grep -q myevent2 dynamic_events
38grep -q latency2 dynamic_events
39
40echo "!s:latency2 u64 lat; pid_t pid;" >> dynamic_events
41! grep -q latency2 dynamic_events
42
43echo > dynamic_events
44