From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ajay Kaher <akaher@vmware.com>,
shuah@kernel.org, mhiramat@kernel.org, chinglinyu@google.com,
linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-trace-kernel@vger.kernel.org, lkp@intel.com,
namit@vmware.com, oe-lkp@lists.linux.dev, amakhalov@vmware.com,
er.ajay.kaher@gmail.com, srivatsa@csail.mit.edu,
tkundu@vmware.com, vsirnapalli@vmware.com
Subject: Re: [PATCH v4 10/10] test: ftrace: Fix kprobe test for eventfs
Date: Fri, 14 Jul 2023 22:27:05 +0900 [thread overview]
Message-ID: <20230714222705.bc38f83d857473656a45d441@kernel.org> (raw)
In-Reply-To: <20230713223758.31a1e391@rorschach.local.home>
On Thu, 13 Jul 2023 22:37:58 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> On Thu, 13 Jul 2023 17:03:24 +0530
> Ajay Kaher <akaher@vmware.com> wrote:
>
> > kprobe_args_char.tc, kprobe_args_string.tc has validation check
> > for tracefs_create_dir, for eventfs it should be eventfs_create_dir.
> >
> > 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>
>
> As this patch as is will break when running on older kernels, I was
> wondering if we should do this instead?
+1 since the latest kselftest is used also for checking the older
stable kernels, the test case has to check the environment and
change the parameter (or make it unsupported for new feature)
So below looks good to me.
Thanks,
>
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc
> index 285b4770efad..ff7499eb98d6 100644
> --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc
> @@ -34,14 +34,19 @@ mips*)
> esac
>
> : "Test get argument (1)"
> -echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):char" > kprobe_events
> +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}):char" > kprobe_events
> echo 1 > events/kprobes/testprobe/enable
> echo "p:test $FUNCTION_FORK" >> kprobe_events
> grep -qe "testprobe.* arg1='t'" trace
>
> echo 0 > events/kprobes/testprobe/enable
> : "Test get argument (2)"
> -echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):char arg2=+0(${ARG1}):char[4]" > kprobe_events
> +echo "p:testprobe ${DIR_NAME} arg1=+0(${ARG1}):char arg2=+0(${ARG1}):char[4]" > kprobe_events
> echo 1 > events/kprobes/testprobe/enable
> echo "p:test $FUNCTION_FORK" >> kprobe_events
> grep -qe "testprobe.* arg1='t' arg2={'t','e','s','t'}" trace
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
> index a4f8e7c53c1f..a202b2ea4baf 100644
> --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
> @@ -37,14 +37,19 @@ loongarch*)
> esac
>
> : "Test get argument (1)"
> -echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string" > kprobe_events
> +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 tracefs_create_dir arg1=+0(${ARG1}):string arg2=+0(${ARG1}):string" > kprobe_events
> +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
>
> -- Steve
>
> > ---
> > .../selftests/ftrace/test.d/kprobe/kprobe_args_char.tc | 4 ++--
> > .../selftests/ftrace/test.d/kprobe/kprobe_args_string.tc | 4 ++--
> > 2 files changed, 4 insertions(+), 4 deletions(-)
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc
> > index 285b4770efad..523cfb64539f 100644
> > --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_char.tc
> > @@ -34,14 +34,14 @@ mips*)
> > esac
> >
> > : "Test get argument (1)"
> > -echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):char" > kprobe_events
> > +echo "p:testprobe eventfs_add_dir arg1=+0(${ARG1}):char" > kprobe_events
> > echo 1 > events/kprobes/testprobe/enable
> > echo "p:test $FUNCTION_FORK" >> kprobe_events
> > grep -qe "testprobe.* arg1='t'" trace
> >
> > echo 0 > events/kprobes/testprobe/enable
> > : "Test get argument (2)"
> > -echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):char arg2=+0(${ARG1}):char[4]" > kprobe_events
> > +echo "p:testprobe eventfs_add_dir arg1=+0(${ARG1}):char arg2=+0(${ARG1}):char[4]" > kprobe_events
> > echo 1 > events/kprobes/testprobe/enable
> > echo "p:test $FUNCTION_FORK" >> kprobe_events
> > grep -qe "testprobe.* arg1='t' arg2={'t','e','s','t'}" trace
> > diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
> > index a4f8e7c53c1f..b9f8c3f8bae8 100644
> > --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_args_string.tc
> > @@ -37,14 +37,14 @@ loongarch*)
> > esac
> >
> > : "Test get argument (1)"
> > -echo "p:testprobe tracefs_create_dir arg1=+0(${ARG1}):string" > kprobe_events
> > +echo "p:testprobe eventfs_add_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 "p:testprobe eventfs_add_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
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
next prev parent reply other threads:[~2023-07-14 13:27 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-13 11:33 [PATCH v4 00/10] tracing: introducing eventfs Ajay Kaher
2023-07-13 11:33 ` [PATCH v4 01/10] tracing: Require all trace events to have a TRACE_SYSTEM Ajay Kaher
2023-07-13 11:33 ` [PATCH v4 02/10] tracefs: Rename some tracefs function Ajay Kaher
2023-07-14 15:11 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 03/10] eventfs: Implement eventfs dir creation functions Ajay Kaher
2023-07-14 15:44 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 04/10] eventfs: Implement eventfs file add functions Ajay Kaher
2023-07-14 16:23 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 05/10] eventfs: Implement eventfs file, directory remove function Ajay Kaher
2023-07-14 16:35 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 06/10] eventfs: Implement functions to create eventfs files and directories Ajay Kaher
2023-07-14 16:47 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 07/10] eventfs: Implement eventfs lookup, read, open functions Ajay Kaher
2023-07-14 20:17 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 08/10] eventfs: Implement tracefs_inode_cache Ajay Kaher
2023-07-14 20:27 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 09/10] eventfs: Move tracing/events to eventfs Ajay Kaher
2023-07-14 21:06 ` Steven Rostedt
2023-07-19 11:08 ` Ajay Kaher
2023-07-19 11:08 ` Ajay Kaher
2023-09-08 12:14 ` Sven Schnelle
2023-09-08 12:31 ` Steven Rostedt
2023-07-13 11:33 ` [PATCH v4 10/10] test: ftrace: Fix kprobe test for eventfs Ajay Kaher
2023-07-14 2:37 ` Steven Rostedt
2023-07-14 13:27 ` Masami Hiramatsu [this message]
2023-07-17 5:24 ` Ajay Kaher
2023-07-17 12:24 ` Steven Rostedt
2023-07-14 22:58 ` [PATCH v4 00/10] tracing: introducing eventfs Steven Rostedt
2023-07-16 17:32 ` Ajay Kaher
2023-07-18 13:40 ` Steven Rostedt
2023-07-19 10:25 ` Ajay Kaher
2023-07-19 14:23 ` Steven Rostedt
2023-07-19 18:37 ` Ajay Kaher
2023-07-19 18:40 ` Steven Rostedt
2023-07-21 13:18 ` Steven Rostedt
2023-07-21 19:14 ` Steven Rostedt
[not found] ` <20230721084839.4a97a595@gandalf.local.home>
2023-07-21 13:19 ` Steven Rostedt
2023-07-21 17:17 ` Nadav Amit
2023-07-21 17:24 ` Steven Rostedt
2023-07-21 17:30 ` Steven Rostedt
2023-07-21 20:40 ` Steven Rostedt
2023-07-26 18:54 ` Ajay Kaher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230714222705.bc38f83d857473656a45d441@kernel.org \
--to=mhiramat@kernel.org \
--cc=akaher@vmware.com \
--cc=amakhalov@vmware.com \
--cc=chinglinyu@google.com \
--cc=er.ajay.kaher@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=namit@vmware.com \
--cc=oe-lkp@lists.linux.dev \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=srivatsa@csail.mit.edu \
--cc=tkundu@vmware.com \
--cc=vsirnapalli@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).