aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_return_suffix.tc
blob: f07bd15cc033721e10f814292b764e602909b6b4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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