summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_synth.tc
blob: 62b77b5941d09182b568943699928e682ad49a93 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - add/remove synthetic events

[ -f dynamic_events ] || exit_unsupported

grep -q "s:\[synthetic/\]" README || exit_unsupported

echo 0 > events/enable
echo > dynamic_events

echo "s:latency1 u64 lat; pid_t pid;" >> dynamic_events
echo "s:latency2 u64 lat; pid_t pid;" >> dynamic_events

grep -q latency1 dynamic_events
grep -q latency2 dynamic_events
test -d events/synthetic/latency1
test -d events/synthetic/latency2

echo "-:synthetic/latency2" >> dynamic_events

grep -q latency1 dynamic_events
! grep -q latency2 dynamic_events

echo > dynamic_events

clear_trace