All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] selftests/ftrace: Exclude "(fault)" in testing add/remove eprobe events
@ 2021-09-08  3:04 Steven Rostedt
  2021-09-08  3:47 ` Masami Hiramatsu
  0 siblings, 1 reply; 2+ messages in thread
From: Steven Rostedt @ 2021-09-08  3:04 UTC (permalink / raw)
  To: LKML
  Cc: Ingo Molnar, Andrew Morton, Masami Hiramatsu, Shuah Khan,
	Tzvetomir Stoyanov

From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

The original test for adding and removing eprobes used synthetic events
and retrieved the filename from the open system call at the end of the
system call. This would allow it to always be loaded into the page tables
when accessed.

Masami suggested that the test was too complex for just testing add and
remove, so it was changed to test just adding and removing an event probe
on top of the start of the open system call event. Now it is possible that
the filename will not be loaded into memory at the time the eprobe is
triggered, and will result in "(fault)" being displayed in the event. This
causes the test to fail.

Account for "(fault)" also being one of the values of the filename field
of the event probe.

Fixes: 079db70794ec5 ("selftests/ftrace: Add test case to test adding and removing of event probe")
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 .../selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc
index 25a3da4eaa44..5f5b2ba3e557 100644
--- a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc
+++ b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc
@@ -22,7 +22,7 @@ ls
 echo 0 > events/eprobes/$EPROBE/enable
 
 content=`grep '^ *ls-' trace | grep 'file='`
-nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."'` || true
+nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."' -e '(fault)' ` || true
 
 if [ -z "$content" ]; then
 	exit_fail
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] selftests/ftrace: Exclude "(fault)" in testing add/remove eprobe events
  2021-09-08  3:04 [PATCH] selftests/ftrace: Exclude "(fault)" in testing add/remove eprobe events Steven Rostedt
@ 2021-09-08  3:47 ` Masami Hiramatsu
  0 siblings, 0 replies; 2+ messages in thread
From: Masami Hiramatsu @ 2021-09-08  3:47 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: LKML, Ingo Molnar, Andrew Morton, Masami Hiramatsu, Shuah Khan,
	Tzvetomir Stoyanov

On Tue, 7 Sep 2021 23:04:29 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> 
> The original test for adding and removing eprobes used synthetic events
> and retrieved the filename from the open system call at the end of the
> system call. This would allow it to always be loaded into the page tables
> when accessed.
> 
> Masami suggested that the test was too complex for just testing add and
> remove, so it was changed to test just adding and removing an event probe
> on top of the start of the open system call event. Now it is possible that
> the filename will not be loaded into memory at the time the eprobe is
> triggered, and will result in "(fault)" being displayed in the event. This
> causes the test to fail.
> 
> Account for "(fault)" also being one of the values of the filename field
> of the event probe.

Looks good to me.

Acked-by: Masami Hiramatsu <mhiramat@kernel.org>

Thank you,

> 
> Fixes: 079db70794ec5 ("selftests/ftrace: Add test case to test adding and removing of event probe")
> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> ---
>  .../selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc       | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc
> index 25a3da4eaa44..5f5b2ba3e557 100644
> --- a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc
> +++ b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_eprobe.tc
> @@ -22,7 +22,7 @@ ls
>  echo 0 > events/eprobes/$EPROBE/enable
>  
>  content=`grep '^ *ls-' trace | grep 'file='`
> -nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."'` || true
> +nocontent=`grep '^ *ls-' trace | grep 'file=' | grep -v -e '"/' -e '"."' -e '(fault)' ` || true
>  
>  if [ -z "$content" ]; then
>  	exit_fail
> -- 
> 2.31.1
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-08  3:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08  3:04 [PATCH] selftests/ftrace: Exclude "(fault)" in testing add/remove eprobe events Steven Rostedt
2021-09-08  3:47 ` Masami Hiramatsu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.