Commitcad6967ac1
("fork: introduce kernel_clone()") replaced "_do_fork()" with "kernel_clone()". The ftrace selftests reference the fork function in several of the tests. The rename will make the tests break, but if those names are changed in the tests, they would then break on older kernels. The same set of tests should pass older kernels if they have previously passed. Obviously, a new test may not work on older kernels if the test was added due to a bug or a new feature. The setup of ftracetest will now create a $FUNCTION_FORK bash variable that will contain "_do_fork" for older kernels and "kernel_clone" for newer ones. It figures out the proper name by examining /proc/kallsyms. Note, available_filter_functions could also be used, but because some tests should be able to pass without function tracing enabled, it could not be used. Fixes:eea11285da
("tracing: switch to kernel_clone()") Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
43 lines
896 B
Bash
43 lines
896 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Kprobe event string type argument
|
|
# requires: kprobe_events
|
|
|
|
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 $FUNCTION_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 $FUNCTION_FORK" >> kprobe_events
|
|
grep -qe "testprobe.* arg1=\"test\" arg2=\"test\"" trace
|
|
|