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
11 EVENT="sys_enter_openat"
15 echo "e:$EPROBE $SYSTEM/$EVENT file=+0(\$filename):ustring" >> dynamic_events
17 grep -q "$EPROBE" dynamic_events
18 test -d events/eprobes/$EPROBE
20 echo 1 > events/eprobes/$EPROBE/enable
22 echo 0 > events/eprobes/$EPROBE/enable
24 content=`grep '^ *ls-' trace | grep 'file='`
25 nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."' -e '(fault)' ` || true
27 if [ -z "$content" ]; then
31 if [ ! -z "$nocontent" ]; then
35 echo "-:$EPROBE" >> dynamic_events
37 ! grep -q "$EPROBE" dynamic_events
38 ! test -d events/eprobes/$EPROBE