diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2018-07-28 09:56:24 -0400 |
---|---|---|
committer | Shuah Khan (Samsung OSG) <shuah@kernel.org> | 2018-08-09 13:26:33 -0400 |
commit | 01675e9503c4e20c5ce9aebdfe6a9cf2ae4991e0 (patch) | |
tree | 8d87f3a3ce8d99b218241186f2006358cd3006b4 | |
parent | 9a29ad52d5c0b4732b0decbddb67c4c3ff4a70ce (diff) |
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.
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc | 30 | ||||
-rw-r--r-- | tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc | 2 |
2 files changed, 13 insertions, 19 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc index a0002563e9ee..1ad70cdaf442 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc | |||
@@ -9,28 +9,22 @@ echo > kprobe_events | |||
9 | 9 | ||
10 | case `uname -m` in | 10 | case `uname -m` in |
11 | x86_64) | 11 | x86_64) |
12 | ARG2=%si | 12 | ARG1=%di |
13 | OFFS=8 | ||
14 | ;; | 13 | ;; |
15 | i[3456]86) | 14 | i[3456]86) |
16 | ARG2=%cx | 15 | ARG1=%ax |
17 | OFFS=4 | ||
18 | ;; | 16 | ;; |
19 | aarch64) | 17 | aarch64) |
20 | ARG2=%x1 | 18 | ARG1=%x0 |
21 | OFFS=8 | ||
22 | ;; | 19 | ;; |
23 | arm*) | 20 | arm*) |
24 | ARG2=%r1 | 21 | ARG1=%r0 |
25 | OFFS=4 | ||
26 | ;; | 22 | ;; |
27 | ppc64*) | 23 | ppc64*) |
28 | ARG2=%r4 | 24 | ARG1=%r3 |
29 | OFFS=8 | ||
30 | ;; | 25 | ;; |
31 | ppc*) | 26 | ppc*) |
32 | ARG2=%r4 | 27 | ARG1=%r3 |
33 | OFFS=4 | ||
34 | ;; | 28 | ;; |
35 | *) | 29 | *) |
36 | echo "Please implement other architecture here" | 30 | echo "Please implement other architecture here" |
@@ -38,17 +32,17 @@ ppc*) | |||
38 | esac | 32 | esac |
39 | 33 | ||
40 | : "Test get argument (1)" | 34 | : "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 |
42 | echo 1 > events/kprobes/testprobe/enable | 36 | echo 1 > events/kprobes/testprobe/enable |
43 | ! echo test >> kprobe_events | 37 | echo "p:test _do_fork" >> kprobe_events |
44 | tail -n 1 trace | grep -qe "testprobe.* arg1=\"test\"" | 38 | grep -qe "testprobe.* arg1=\"test\"" trace |
45 | 39 | ||
46 | echo 0 > events/kprobes/testprobe/enable | 40 | echo 0 > events/kprobes/testprobe/enable |
47 | : "Test get argument (2)" | 41 | : "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 |
49 | echo 1 > events/kprobes/testprobe/enable | 43 | echo 1 > events/kprobes/testprobe/enable |
50 | ! echo test1 test2 >> kprobe_events | 44 | echo "p:test _do_fork" >> kprobe_events |
51 | tail -n 1 trace | grep -qe "testprobe.* arg1=\"test1\" arg2=\"test2\"" | 45 | grep -qe "testprobe.* arg1=\"test\" arg2=\"test\"" trace |
52 | 46 | ||
53 | echo 0 > events/enable | 47 | echo 0 > events/enable |
54 | echo > kprobe_events | 48 | echo > kprobe_events |
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc index 4fda01a08da4..519d2763f5d2 100644 --- a/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc +++ b/tools/testing/selftests/ftrace/test.d/kprobe/probepoint.tc | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | [ -f kprobe_events ] || exit_unsupported # this is configurable | 5 | [ -f kprobe_events ] || exit_unsupported # this is configurable |
6 | 6 | ||
7 | TARGET_FUNC=create_trace_kprobe | 7 | TARGET_FUNC=tracefs_create_dir |
8 | 8 | ||
9 | dec_addr() { # hexaddr | 9 | dec_addr() { # hexaddr |
10 | printf "%d" "0x"`echo $1 | tail -c 8` | 10 | printf "%d" "0x"`echo $1 | tail -c 8` |