xref: /openbmc/linux/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_synth.tc (revision 4f727ecefefbd180de10e25b3e74c03dce3f1e75)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Generic dynamic event - add/remove synthetic events
4
5[ -f dynamic_events ] || exit_unsupported
6
7grep -q "s:\[synthetic/\]" README || exit_unsupported
8
9echo 0 > events/enable
10echo > dynamic_events
11
12echo "s:latency1 u64 lat; pid_t pid;" >> dynamic_events
13echo "s:latency2 u64 lat; pid_t pid;" >> dynamic_events
14
15grep -q latency1 dynamic_events
16grep -q latency2 dynamic_events
17test -d events/synthetic/latency1
18test -d events/synthetic/latency2
19
20echo "-:synthetic/latency2" >> dynamic_events
21
22grep -q latency1 dynamic_events
23! grep -q latency2 dynamic_events
24
25echo > dynamic_events
26
27clear_trace
28