On Thu, 25 Jan 2024 15:39:22 +0800 Ye Bin <yebi...@huawei.com> wrote:
> This patch adds test cases for new print format type "%pd/%pD".The test cases > test the following items: > 1. Test README if add "%pd/%pD" type; > 2. Test "%pd" type for dput(); > 3. Test "%pD" type for vfs_read(); > > This test case require enable CONFIG_HAVE_FUNCTION_ARG_ACCESS_API > configuration. > > Signed-off-by: Ye Bin <yebi...@huawei.com> > --- > .../ftrace/test.d/kprobe/kprobe_args_vfs.tc | 43 +++++++++++++++++++ > 1 file changed, 43 insertions(+) > create mode 100644 > tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc > > diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc > b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc > new file mode 100644 > index 000000000000..cf0599b90f1a > --- /dev/null > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_vfs.tc > @@ -0,0 +1,43 @@ > +#!/bin/sh > +# SPDX-License-Identifier: GPL-2.0 > +# description: Kprobe event VFS type argument > +# requires: kprobe_events > + > +: "Test argument %pd/%pD in README" > +grep -q "%pd/%pD" README No. This means, if the kernel doesn't support %pd/%pD, this test fails. But the latest version of the ftracetest will be used for testing stable kernels (which will not support this feature). So you should make test returning 'unsupported' for that case. You can add a requirement as # requires: kprobe_events "%pd/%pD":README (e.g. tools/testing/selftests/ftrace/test.d/dynevent/eprobes_syntax_errors.tc) Thank you, > + > +: "Test argument %pd with name" > +echo 'p:testprobe dput name=$arg1:%pd' > kprobe_events > +echo 1 > events/kprobes/testprobe/enable > +grep -q "1" events/kprobes/testprobe/enable > +echo 0 > events/kprobes/testprobe/enable > +grep "dput" trace | grep -q "enable" > +echo "" > kprobe_events > +echo "" > trace > + > +: "Test argument %pd without name" > +echo 'p:testprobe dput $arg1:%pd' > kprobe_events > +echo 1 > events/kprobes/testprobe/enable > +grep -q "1" events/kprobes/testprobe/enable > +echo 0 > events/kprobes/testprobe/enable > +grep "dput" trace | grep -q "enable" > +echo "" > kprobe_events > +echo "" > trace > + > +: "Test argument %pD with name" > +echo 'p:testprobe vfs_read name=$arg1:%pD' > kprobe_events > +echo 1 > events/kprobes/testprobe/enable > +grep -q "1" events/kprobes/testprobe/enable > +echo 0 > events/kprobes/testprobe/enable > +grep "vfs_read" trace | grep -q "enable" > +echo "" > kprobe_events > +echo "" > trace > + > +: "Test argument %pD without name" > +echo 'p:testprobe vfs_read $arg1:%pD' > kprobe_events > +echo 1 > events/kprobes/testprobe/enable > +grep -q "1" events/kprobes/testprobe/enable > +echo 0 > events/kprobes/testprobe/enable > +grep "vfs_read" trace | grep -q "enable" > +echo "" > kprobe_events > +echo "" > trace > -- > 2.31.1 > > -- Masami Hiramatsu (Google) <mhira...@kernel.org>