xref: /linux/tools/testing/selftests/ftrace/test.d/kprobe/kretprobe_entry_arg.tc (revision e6a901a00822659181c93c86d8bbc2a17779fddc)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3# description: Kretprobe entry argument access
4# requires: kprobe_events 'kernel return probes support:':README
5
6echo 'p:myevent1 vfs_open arg=$arg1' >> kprobe_events
7echo 'r:myevent2 vfs_open arg=$arg1' >> kprobe_events
8
9echo 1 > events/kprobes/enable
10
11echo > trace
12cat trace > /dev/null
13
14function streq() {
15	test $1 = $2
16}
17
18streq `grep -A 1 -m 1 myevent1 trace | sed -r 's/^.*(arg=.*)/\1/' `
19