Skip to content

Commit 6fc7c41

Browse files
mhiramatrostedt
authored andcommitted
selftests/ftrace: Fix kprobe string testcase to not probe notrace function
Fix kprobe string argument testcase to not probe notrace function. Instead, it probes tracefs function which must be available with ftrace. Link: http://lkml.kernel.org/r/153294607107.32740.1664854684396589624.stgit@devbox Signed-off-by: Masami Hiramatsu <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent d899926 commit 6fc7c41

File tree

2 files changed

+13
-19
lines changed

2 files changed

+13
-19
lines changed

tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,40 @@ echo > kprobe_events
99

1010
case `uname -m` in
1111
x86_64)
12-
ARG2=%si
13-
OFFS=8
12+
ARG1=%di
1413
;;
1514
i[3456]86)
16-
ARG2=%cx
17-
OFFS=4
15+
ARG1=%ax
1816
;;
1917
aarch64)
20-
ARG2=%x1
21-
OFFS=8
18+
ARG1=%x0
2219
;;
2320
arm*)
24-
ARG2=%r1
25-
OFFS=4
21+
ARG1=%r0
2622
;;
2723
ppc64*)
28-
ARG2=%r4
29-
OFFS=8
24+
ARG1=%r3
3025
;;
3126
ppc*)
32-
ARG2=%r4
33-
OFFS=4
27+
ARG1=%r3
3428
;;
3529
*)
3630
echo "Please implement other architecture here"
3731
exit_untested
3832
esac
3933

4034
: "Test get argument (1)"
41-
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string" > kprobe_events
35+
echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string" > kprobe_events
4236
echo 1 > events/kprobes/testprobe/enable
43-
! echo test >> kprobe_events
44-
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test\""
37+
echo "p:test _do_fork" >> kprobe_events
38+
grep -qe "testprobe.* arg1=\"test\"" trace
4539

4640
echo 0 > events/kprobes/testprobe/enable
4741
: "Test get argument (2)"
48-
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string arg2=+0(+${OFFS}(${ARG2})):string" > kprobe_events
42+
echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string arg2=+0(${ARG1}):string" > kprobe_events
4943
echo 1 > events/kprobes/testprobe/enable
50-
! echo test1 test2 >> kprobe_events
51-
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test1\" arg2=\"test2\""
44+
echo "p:test _do_fork" >> kprobe_events
45+
grep -qe "testprobe.* arg1=\"test\" arg2=\"test\"" trace
5246

5347
echo 0 > events/enable
5448
echo > kprobe_events

tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
[ -f kprobe_events ] || exit_unsupported # this is configurable
66

7-
TARGET_FUNC=create_trace_kprobe
7+
TARGET_FUNC=tracefs_create_dir
88

99
dec_addr() { # hexaddr
1010
printf "%d" "0x"`echo $1 | tail -c 8`

0 commit comments

Comments
 (0)