* [PATCH] selftests/kprobe: Do not test for GRP/ without event failures
@ 2022-07-12 20:17 Steven Rostedt
2022-07-18 2:08 ` Masami Hiramatsu
0 siblings, 1 reply; 7+ messages in thread
From: Steven Rostedt @ 2022-07-12 20:17 UTC (permalink / raw)
To: LKML; +Cc: Ingo Molnar, Andrew Morton, Masami Hiramatsu, Linyu Yuan
From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
A new feature is added where kprobes (and other probes) do not need to
explicitly state the event name when creating a probe. The event name will
come from what is being attached.
That is:
# echo 'p:foo/ vfs_read' > kprobe_events
Will no longer error, but instead create an event:
# cat kprobe_events
p:foo/p_vfs_read_0 vfs_read
This should not be tested as an error case anymore. Remove it from the
selftest as now this feature "breaks" the selftest as it no longer fails
as expected.
Link: https://lore.kernel.org/all/1656296348-16111-1-git-send-email-quic_linyyuan@quicinc.com/
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
---
.../selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
index fa928b431555..7c02509c71d0 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
@@ -21,7 +21,6 @@ check_error 'p:^/bar vfs_read' # NO_GROUP_NAME
check_error 'p:^12345678901234567890123456789012345678901234567890123456789012345/bar vfs_read' # GROUP_TOO_LONG
check_error 'p:^foo.1/bar vfs_read' # BAD_GROUP_NAME
-check_error 'p:foo/^ vfs_read' # NO_EVENT_NAME
check_error 'p:foo/^12345678901234567890123456789012345678901234567890123456789012345 vfs_read' # EVENT_TOO_LONG
check_error 'p:foo/^bar.1 vfs_read' # BAD_EVENT_NAME
--
2.35.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] selftests/kprobe: Do not test for GRP/ without event failures
2022-07-12 20:17 [PATCH] selftests/kprobe: Do not test for GRP/ without event failures Steven Rostedt
@ 2022-07-18 2:08 ` Masami Hiramatsu
2022-07-18 5:40 ` Masami Hiramatsu
0 siblings, 1 reply; 7+ messages in thread
From: Masami Hiramatsu @ 2022-07-18 2:08 UTC (permalink / raw)
To: Steven Rostedt
Cc: LKML, Ingo Molnar, Andrew Morton, Masami Hiramatsu, Linyu Yuan
On Tue, 12 Jul 2022 16:17:07 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:
> From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
>
> A new feature is added where kprobes (and other probes) do not need to
> explicitly state the event name when creating a probe. The event name will
> come from what is being attached.
>
> That is:
>
> # echo 'p:foo/ vfs_read' > kprobe_events
>
> Will no longer error, but instead create an event:
>
> # cat kprobe_events
> p:foo/p_vfs_read_0 vfs_read
>
> This should not be tested as an error case anymore. Remove it from the
> selftest as now this feature "breaks" the selftest as it no longer fails
> as expected.
Good catch!
Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
BTW, in this case, NO_EVENT_NAME error should not happen anymore.
Let me cleanup the code.
Thank you,
>
> Link: https://lore.kernel.org/all/1656296348-16111-1-git-send-email-quic_linyyuan@quicinc.com/
>
> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
> ---
> .../selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> index fa928b431555..7c02509c71d0 100644
> --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> @@ -21,7 +21,6 @@ check_error 'p:^/bar vfs_read' # NO_GROUP_NAME
> check_error 'p:^12345678901234567890123456789012345678901234567890123456789012345/bar vfs_read' # GROUP_TOO_LONG
>
> check_error 'p:^foo.1/bar vfs_read' # BAD_GROUP_NAME
> -check_error 'p:foo/^ vfs_read' # NO_EVENT_NAME
> check_error 'p:foo/^12345678901234567890123456789012345678901234567890123456789012345 vfs_read' # EVENT_TOO_LONG
> check_error 'p:foo/^bar.1 vfs_read' # BAD_EVENT_NAME
>
> --
> 2.35.1
>
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] selftests/kprobe: Do not test for GRP/ without event failures
2022-07-18 2:08 ` Masami Hiramatsu
@ 2022-07-18 5:40 ` Masami Hiramatsu
2022-07-18 7:05 ` [PATCH] selftests/kprobe: Update test for no event name syntax error Masami Hiramatsu (Google)
0 siblings, 1 reply; 7+ messages in thread
From: Masami Hiramatsu @ 2022-07-18 5:40 UTC (permalink / raw)
To: Masami Hiramatsu
Cc: Steven Rostedt, LKML, Ingo Molnar, Andrew Morton, Linyu Yuan
On Mon, 18 Jul 2022 11:08:53 +0900
Masami Hiramatsu (Google) <mhiramat@kernel.org> wrote:
> On Tue, 12 Jul 2022 16:17:07 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > From: "Steven Rostedt (Google)" <rostedt@goodmis.org>
> >
> > A new feature is added where kprobes (and other probes) do not need to
> > explicitly state the event name when creating a probe. The event name will
> > come from what is being attached.
> >
> > That is:
> >
> > # echo 'p:foo/ vfs_read' > kprobe_events
> >
> > Will no longer error, but instead create an event:
> >
> > # cat kprobe_events
> > p:foo/p_vfs_read_0 vfs_read
> >
> > This should not be tested as an error case anymore. Remove it from the
> > selftest as now this feature "breaks" the selftest as it no longer fails
> > as expected.
>
> Good catch!
>
> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> BTW, in this case, NO_EVENT_NAME error should not happen anymore.
> Let me cleanup the code.
Oops, no. There is an error case of NO_EVENT_NAME. 'p: vfs_read' will cause
this error because it expects an event name after ':'. Thus, the correct
fix is just removing "foo/":
check_error 'p:^ vfs_read' # NO_EVENT_NAME
Thank you,
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] selftests/kprobe: Update test for no event name syntax error
2022-07-18 5:40 ` Masami Hiramatsu
@ 2022-07-18 7:05 ` Masami Hiramatsu (Google)
2022-07-18 9:36 ` Linyu Yuan
2022-07-18 22:38 ` Steven Rostedt
0 siblings, 2 replies; 7+ messages in thread
From: Masami Hiramatsu (Google) @ 2022-07-18 7:05 UTC (permalink / raw)
To: Steven Rostedt; +Cc: LKML, Ingo Molnar, Andrew Morton, Linyu Yuan
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
The commit 208003254c32 ("selftests/kprobe: Do not test for GRP/
without event failures") removed a syntax which is no more cause
a syntax error (NO_EVENT_NAME error with GRP/).
However, there are another case (NO_EVENT_NAME error without GRP/)
which causes a same error. This adds a test for that case.
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
---
.../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
index 7c02509c71d0..9e85d3019ff0 100644
--- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
+++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
@@ -21,6 +21,7 @@ check_error 'p:^/bar vfs_read' # NO_GROUP_NAME
check_error 'p:^12345678901234567890123456789012345678901234567890123456789012345/bar vfs_read' # GROUP_TOO_LONG
check_error 'p:^foo.1/bar vfs_read' # BAD_GROUP_NAME
+check_error 'p:^ vfs_read' # NO_EVENT_NAME
check_error 'p:foo/^12345678901234567890123456789012345678901234567890123456789012345 vfs_read' # EVENT_TOO_LONG
check_error 'p:foo/^bar.1 vfs_read' # BAD_EVENT_NAME
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] selftests/kprobe: Update test for no event name syntax error
2022-07-18 7:05 ` [PATCH] selftests/kprobe: Update test for no event name syntax error Masami Hiramatsu (Google)
@ 2022-07-18 9:36 ` Linyu Yuan
2022-07-21 14:55 ` Masami Hiramatsu
2022-07-18 22:38 ` Steven Rostedt
1 sibling, 1 reply; 7+ messages in thread
From: Linyu Yuan @ 2022-07-18 9:36 UTC (permalink / raw)
To: Masami Hiramatsu (Google), Steven Rostedt
Cc: LKML, Ingo Molnar, Andrew Morton
hi Masami,
On 7/18/2022 3:05 PM, Masami Hiramatsu (Google) wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> The commit 208003254c32 ("selftests/kprobe: Do not test for GRP/
> without event failures") removed a syntax which is no more cause
> a syntax error (NO_EVENT_NAME error with GRP/).
> However, there are another case (NO_EVENT_NAME error without GRP/)
> which causes a same error. This adds a test for that case.
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> ---
> .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> index 7c02509c71d0..9e85d3019ff0 100644
> --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> @@ -21,6 +21,7 @@ check_error 'p:^/bar vfs_read' # NO_GROUP_NAME
> check_error 'p:^12345678901234567890123456789012345678901234567890123456789012345/bar vfs_read' # GROUP_TOO_LONG
>
> check_error 'p:^foo.1/bar vfs_read' # BAD_GROUP_NAME
> +check_error 'p:^ vfs_read' # NO_EVENT_NAME
i think you fix the issue which exist from start, right ?
is there better comment than NO_EVENT_NAME ?
> check_error 'p:foo/^12345678901234567890123456789012345678901234567890123456789012345 vfs_read' # EVENT_TOO_LONG
> check_error 'p:foo/^bar.1 vfs_read' # BAD_EVENT_NAME
>
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] selftests/kprobe: Update test for no event name syntax error
2022-07-18 9:36 ` Linyu Yuan
@ 2022-07-21 14:55 ` Masami Hiramatsu
0 siblings, 0 replies; 7+ messages in thread
From: Masami Hiramatsu @ 2022-07-21 14:55 UTC (permalink / raw)
To: Linyu Yuan; +Cc: Steven Rostedt, LKML, Ingo Molnar, Andrew Morton
On Mon, 18 Jul 2022 17:36:43 +0800
Linyu Yuan <quic_linyyuan@quicinc.com> wrote:
> hi Masami,
>
> On 7/18/2022 3:05 PM, Masami Hiramatsu (Google) wrote:
> > From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> >
> > The commit 208003254c32 ("selftests/kprobe: Do not test for GRP/
> > without event failures") removed a syntax which is no more cause
> > a syntax error (NO_EVENT_NAME error with GRP/).
> > However, there are another case (NO_EVENT_NAME error without GRP/)
> > which causes a same error. This adds a test for that case.
> >
> > Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
> > ---
> > .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> > index 7c02509c71d0..9e85d3019ff0 100644
> > --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> > +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> > @@ -21,6 +21,7 @@ check_error 'p:^/bar vfs_read' # NO_GROUP_NAME
> > check_error 'p:^12345678901234567890123456789012345678901234567890123456789012345/bar vfs_read' # GROUP_TOO_LONG
> >
> > check_error 'p:^foo.1/bar vfs_read' # BAD_GROUP_NAME
> > +check_error 'p:^ vfs_read' # NO_EVENT_NAME
>
> i think you fix the issue which exist from start, right ?
Yes, this is not a new bug but the error case which still
exists.
>
> is there better comment than NO_EVENT_NAME ?
These comments are corresponding to the error name, so that we can
find the logging code easily. (Not for users)
Thank you,
>
> > check_error 'p:foo/^12345678901234567890123456789012345678901234567890123456789012345 vfs_read' # EVENT_TOO_LONG
> > check_error 'p:foo/^bar.1 vfs_read' # BAD_EVENT_NAME
> >
> >
--
Masami Hiramatsu (Google) <mhiramat@kernel.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] selftests/kprobe: Update test for no event name syntax error
2022-07-18 7:05 ` [PATCH] selftests/kprobe: Update test for no event name syntax error Masami Hiramatsu (Google)
2022-07-18 9:36 ` Linyu Yuan
@ 2022-07-18 22:38 ` Steven Rostedt
1 sibling, 0 replies; 7+ messages in thread
From: Steven Rostedt @ 2022-07-18 22:38 UTC (permalink / raw)
To: Masami Hiramatsu (Google); +Cc: LKML, Ingo Molnar, Andrew Morton, Linyu Yuan
On Mon, 18 Jul 2022 16:05:10 +0900
"Masami Hiramatsu (Google)" <mhiramat@kernel.org> wrote:
> From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
>
> The commit 208003254c32 ("selftests/kprobe: Do not test for GRP/
> without event failures") removed a syntax which is no more cause
> a syntax error (NO_EVENT_NAME error with GRP/).
> However, there are another case (NO_EVENT_NAME error without GRP/)
> which causes a same error. This adds a test for that case.
>
> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Queued. Thanks Masami!
-- Steve
> ---
> .../ftrace/test.d/kprobe/kprobe_syntax_errors.tc | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> index 7c02509c71d0..9e85d3019ff0 100644
> --- a/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> +++ b/tools/testing/selftests/ftrace/test.d/kprobe/kprobe_syntax_errors.tc
> @@ -21,6 +21,7 @@ check_error 'p:^/bar vfs_read' # NO_GROUP_NAME
> check_error 'p:^12345678901234567890123456789012345678901234567890123456789012345/bar vfs_read' # GROUP_TOO_LONG
>
> check_error 'p:^foo.1/bar vfs_read' # BAD_GROUP_NAME
> +check_error 'p:^ vfs_read' # NO_EVENT_NAME
> check_error 'p:foo/^12345678901234567890123456789012345678901234567890123456789012345 vfs_read' # EVENT_TOO_LONG
> check_error 'p:foo/^bar.1 vfs_read' # BAD_EVENT_NAME
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-07-21 14:55 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-12 20:17 [PATCH] selftests/kprobe: Do not test for GRP/ without event failures Steven Rostedt
2022-07-18 2:08 ` Masami Hiramatsu
2022-07-18 5:40 ` Masami Hiramatsu
2022-07-18 7:05 ` [PATCH] selftests/kprobe: Update test for no event name syntax error Masami Hiramatsu (Google)
2022-07-18 9:36 ` Linyu Yuan
2022-07-21 14:55 ` Masami Hiramatsu
2022-07-18 22:38 ` Steven Rostedt
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).