mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-16 04:04:06 +00:00
selftests/ftrace: Update test for more eprobe removal process
The removal of eprobes was broken and missed in testing. Add various ways to remove eprobes that are considered acceptable to the testing process to catch when/if they break again. Link: https://lkml.kernel.org/r/20211013205533.836644549@goodmis.org Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
This commit is contained in:
parent
7d5fda1c84
commit
0282b0f012
1 changed files with 52 additions and 2 deletions
|
@ -11,8 +11,8 @@ SYSTEM="syscalls"
|
|||
EVENT="sys_enter_openat"
|
||||
FIELD="filename"
|
||||
EPROBE="eprobe_open"
|
||||
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT file=+0(\$filename):ustring" >> dynamic_events
|
||||
OPTIONS="file=+0(\$filename):ustring"
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
|
||||
grep -q "$EPROBE" dynamic_events
|
||||
test -d events/eprobes/$EPROBE
|
||||
|
@ -37,4 +37,54 @@ echo "-:$EPROBE" >> dynamic_events
|
|||
! grep -q "$EPROBE" dynamic_events
|
||||
! test -d events/eprobes/$EPROBE
|
||||
|
||||
# test various ways to remove the probe (already tested with just event name)
|
||||
|
||||
# With group name
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
grep -q "$EPROBE" dynamic_events
|
||||
test -d events/eprobes/$EPROBE
|
||||
echo "-:eprobes/$EPROBE" >> dynamic_events
|
||||
! grep -q "$EPROBE" dynamic_events
|
||||
! test -d events/eprobes/$EPROBE
|
||||
|
||||
# With group name and system/event
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
grep -q "$EPROBE" dynamic_events
|
||||
test -d events/eprobes/$EPROBE
|
||||
echo "-:eprobes/$EPROBE $SYSTEM/$EVENT" >> dynamic_events
|
||||
! grep -q "$EPROBE" dynamic_events
|
||||
! test -d events/eprobes/$EPROBE
|
||||
|
||||
# With just event name and system/event
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
grep -q "$EPROBE" dynamic_events
|
||||
test -d events/eprobes/$EPROBE
|
||||
echo "-:$EPROBE $SYSTEM/$EVENT" >> dynamic_events
|
||||
! grep -q "$EPROBE" dynamic_events
|
||||
! test -d events/eprobes/$EPROBE
|
||||
|
||||
# With just event name and system/event and options
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
grep -q "$EPROBE" dynamic_events
|
||||
test -d events/eprobes/$EPROBE
|
||||
echo "-:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
! grep -q "$EPROBE" dynamic_events
|
||||
! test -d events/eprobes/$EPROBE
|
||||
|
||||
# With group name and system/event and options
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
grep -q "$EPROBE" dynamic_events
|
||||
test -d events/eprobes/$EPROBE
|
||||
echo "-:eprobes/$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
! grep -q "$EPROBE" dynamic_events
|
||||
! test -d events/eprobes/$EPROBE
|
||||
|
||||
# Finally make sure what is in the dynamic_events file clears it too
|
||||
echo "e:$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
LINE=`sed -e '/$EPROBE/s/^e/-/' < dynamic_events`
|
||||
test -d events/eprobes/$EPROBE
|
||||
echo "-:eprobes/$EPROBE $SYSTEM/$EVENT $OPTIONS" >> dynamic_events
|
||||
! grep -q "$EPROBE" dynamic_events
|
||||
! test -d events/eprobes/$EPROBE
|
||||
|
||||
clear_trace
|
||||
|
|
Loading…
Add table
Reference in a new issue