linux/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
Masami Hiramatsu e527c47081 selftests/ftrace: Remove unneeded per-test init/cleanup ftrace
Since ftracetest framework calls initialize_ftrace() right before
each test and after all tests, we don't need to init/cleanup
ftrace for each test case.
Just remove such unneeded init/cleanup code because it can
increase logfile size.

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
2018-10-24 14:49:35 -06:00

44 lines
923 B
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: Kprobe event string type argument
[ -f kprobe_events ] || exit_unsupported # this is configurable
case `uname -m` in
x86_64)
ARG1=%di
;;
i[3456]86)
ARG1=%ax
;;
aarch64)
ARG1=%x0
;;
arm*)
ARG1=%r0
;;
ppc64*)
ARG1=%r3
;;
ppc*)
ARG1=%r3
;;
*)
echo "Please implement other architecture here"
exit_untested
esac
: "Test get argument (1)"
echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string" > kprobe_events
echo 1 > events/kprobes/testprobe/enable
echo "p:test _do_fork" >> kprobe_events
grep -qe "testprobe.* arg1=\"test\"" trace
echo 0 > events/kprobes/testprobe/enable
: "Test get argument (2)"
echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string arg2=+0(${ARG1}):string" > kprobe_events
echo 1 > events/kprobes/testprobe/enable
echo "p:test _do_fork" >> kprobe_events
grep -qe "testprobe.* arg1=\"test\" arg2=\"test\"" trace