summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_kprobe.tc
blob: c6d8387dbbb8688585cbf555b6276c9c11dc7a2d (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
28
29
30
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Generic dynamic event - add/remove kprobe events

[ -f dynamic_events ] || exit_unsupported

grep -q "place: \[<module>:\]<symbol>" README || exit_unsupported
grep -q "place (kretprobe): \[<module>:\]<symbol>" README || exit_unsupported

echo 0 > events/enable
echo > dynamic_events

PLACE=_do_fork

echo "p:myevent1 $PLACE" >> dynamic_events
echo "r:myevent2 $PLACE" >> dynamic_events

grep -q myevent1 dynamic_events
grep -q myevent2 dynamic_events
test -d events/kprobes/myevent1
test -d events/kprobes/myevent2

echo "-:myevent2" >> dynamic_events

grep -q myevent1 dynamic_events
! grep -q myevent2 dynamic_events

echo > dynamic_events

clear_trace