Commit 08023a3b authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Stefan Bader

selftests/ftrace: Fix kprobe string testcase to not probe notrace function

BugLink: https://bugs.launchpad.net/bugs/1825780

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@devboxSigned-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
(cherry picked from commit 6fc7c411)
Signed-off-by: default avatarPo-Hsu Lin <po-hsu.lin@canonical.com>
Acked-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Acked-by: default avatarKleber Souza <kleber.souza@canonical.com>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
parent e0283115
...@@ -9,28 +9,22 @@ echo > kprobe_events ...@@ -9,28 +9,22 @@ echo > kprobe_events
case `uname -m` in case `uname -m` in
x86_64) x86_64)
ARG2=%si ARG1=%di
OFFS=8
;; ;;
i[3456]86) i[3456]86)
ARG2=%cx ARG1=%ax
OFFS=4
;; ;;
aarch64) aarch64)
ARG2=%x1 ARG1=%x0
OFFS=8
;; ;;
arm*) arm*)
ARG2=%r1 ARG1=%r0
OFFS=4
;; ;;
ppc64*) ppc64*)
ARG2=%r4 ARG1=%r3
OFFS=8
;; ;;
ppc*) ppc*)
ARG2=%r4 ARG1=%r3
OFFS=4
;; ;;
*) *)
echo "Please implement other architecture here" echo "Please implement other architecture here"
...@@ -38,17 +32,17 @@ ppc*) ...@@ -38,17 +32,17 @@ ppc*)
esac esac
: "Test get argument (1)" : "Test get argument (1)"
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string" > kprobe_events echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string" > kprobe_events
echo 1 > events/kprobes/testprobe/enable echo 1 > events/kprobes/testprobe/enable
! echo test >> kprobe_events echo "p:test _do_fork" >> kprobe_events
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test\"" grep -qe "testprobe.* arg1=\"test\"" trace
echo 0 > events/kprobes/testprobe/enable echo 0 > events/kprobes/testprobe/enable
: "Test get argument (2)" : "Test get argument (2)"
echo "p:testprobe create_trace_kprobe arg1=+0(+0(${ARG2})):string arg2=+0(+${OFFS}(${ARG2})):string" > kprobe_events echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string arg2=+0(${ARG1}):string" > kprobe_events
echo 1 > events/kprobes/testprobe/enable echo 1 > events/kprobes/testprobe/enable
! echo test1 test2 >> kprobe_events echo "p:test _do_fork" >> kprobe_events
tail -n 1 trace | grep -qe "testprobe.* arg1=\"test1\" arg2=\"test2\"" grep -qe "testprobe.* arg1=\"test\" arg2=\"test\"" trace
echo 0 > events/enable echo 0 > events/enable
echo > kprobe_events echo > kprobe_events
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
[ -f kprobe_events ] || exit_unsupported # this is configurable [ -f kprobe_events ] || exit_unsupported # this is configurable
TARGET_FUNC=create_trace_kprobe TARGET_FUNC=tracefs_create_dir
dec_addr() { # hexaddr dec_addr() { # hexaddr
printf "%d" "0x"`echo $1 | tail -c 8` printf "%d" "0x"`echo $1 | tail -c 8`
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment