mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-19 20:13:49 -04:00
kprobe_args_char.tc, kprobe_args_string.tc has validation check for tracefs_create_dir, for eventfs it should be eventfs_create_dir. Link: https://lkml.kernel.org/r/1690568452-46553-11-git-send-email-akaher@vmware.com Signed-off-by: Ajay Kaher <akaher@vmware.com> Co-developed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Tested-by: Ching-lin Yu <chinglinyu@google.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
57 lines
1.1 KiB
Bash
57 lines
1.1 KiB
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
|
|
;;
|
|
s390*)
|
|
ARG1=%r2
|
|
;;
|
|
mips*)
|
|
ARG1=%r4
|
|
;;
|
|
loongarch*)
|
|
ARG1=%r4
|
|
;;
|
|
*)
|
|
echo "Please implement other architecture here"
|
|
exit_untested
|
|
esac
|
|
|
|
: "Test get argument (1)"
|
|
if 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
|
|
|