mirror of
https://github.com/torvalds/linux.git
synced 2026-04-19 23:34:00 -04:00
kprobe_args_{char,string}.tc are using available_filter_functions file
which is provided by function tracer. Thus if function tracer is disabled,
these tests are failed on recent kernels because tracefs_create_dir is
not raised events by adding a dynamic event.
Add available_filter_functions to requires line.
Fixes: 7c1130ea5c ("test: ftrace: Fix kprobe test for eventfs")
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
62 lines
1.2 KiB
Bash
62 lines
1.2 KiB
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Kprobe event string type argument
|
|
# requires: kprobe_events available_filter_functions
|
|
|
|
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
|
|
;;
|
|
s390*)
|
|
ARG1=%r2
|
|
;;
|
|
mips*)
|
|
ARG1=%r4
|
|
;;
|
|
loongarch*)
|
|
ARG1=%r4
|
|
;;
|
|
riscv*)
|
|
ARG1=%a0
|
|
;;
|
|
*)
|
|
echo "Please implement other architecture here"
|
|
exit_untested
|
|
esac
|
|
|
|
: "Test get argument (1)"
|
|
if grep -q eventfs_create_dir available_filter_functions; then
|
|
DIR_NAME="eventfs_create_dir"
|
|
elif grep -q eventfs_add_dir available_filter_functions; then
|
|
DIR_NAME="eventfs_add_dir"
|
|
else
|
|
DIR_NAME="tracefs_create_dir"
|
|
fi
|
|
echo "p:testprobe ${DIR_NAME} 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 ${DIR_NAME} 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
|
|
|