-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
selftests/ftrace: Add %return suffix tests
Add kprobe %return suffix testcase and syntax error tests for %return suffix. Link: https://lkml.kernel.org/r/159972817653.428528.9180599115849301184.stgit@devnote2 Acked-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
- Loading branch information
Masami Hiramatsu
authored and
Steven Rostedt (VMware)
committed
Sep 22, 2020
1 parent
19c311a
commit 8f2a599
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_return_suffix.tc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/sh | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# description: Kretprobe %%return suffix test | ||
# requires: kprobe_events '<symbol>[+<offset>]%return':README | ||
|
||
# Test for kretprobe by "r" | ||
echo 'r:myprobeaccept vfs_read' > kprobe_events | ||
RESULT1=`cat kprobe_events` | ||
|
||
# Test for kretprobe by "%return" | ||
echo 'p:myprobeaccept vfs_read%return' > kprobe_events | ||
RESULT2=`cat kprobe_events` | ||
|
||
if [ "$RESULT1" != "$RESULT2" ]; then | ||
echo "Error: %return suffix didn't make a return probe." | ||
echo "r-command: $RESULT1" | ||
echo "%return: $RESULT2" | ||
exit_fail | ||
fi | ||
|
||
echo > kprobe_events |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters