Merge tag 'regulator-fix-v5.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel...
[platform/kernel/linux-rpi.git] / tools / testing / selftests / ftrace / test.d / dynevent / add_remove_eprobe.tc
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: Generic dynamic event - add/remove eprobe events
4 # requires: dynamic_events events/syscalls/sys_enter_openat "e[:[<group>/]<event>] <attached-group>.<attached-event> [<args>]":README
5
6 echo 0 > events/enable
7
8 clear_dynamic_events
9
10 SYSTEM="syscalls"
11 EVENT="sys_enter_openat"
12 FIELD="filename"
13 EPROBE="eprobe_open"
14
15 echo "e:$EPROBE $SYSTEM/$EVENT file=+0(\$filename):ustring" >> dynamic_events
16
17 grep -q "$EPROBE" dynamic_events
18 test -d events/eprobes/$EPROBE
19
20 echo 1 > events/eprobes/$EPROBE/enable
21 ls
22 echo 0 > events/eprobes/$EPROBE/enable
23
24 content=`grep '^ *ls-' trace | grep 'file='`
25 nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."' -e '(fault)' ` || true
26
27 if [ -z "$content" ]; then
28         exit_fail
29 fi
30
31 if [ ! -z "$nocontent" ]; then
32         exit_fail
33 fi
34
35 echo "-:$EPROBE" >> dynamic_events
36
37 ! grep -q "$EPROBE" dynamic_events
38 ! test -d events/eprobes/$EPROBE
39
40 clear_trace