linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, shuah <shuah@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 2/2] ftrace/selftest: Test if set_event/ftrace_pid exists before writing
Date: Thu, 4 Jul 2019 14:56:31 +0900	[thread overview]
Message-ID: <20190704145631.58e78ce0add30b3987ea8845@kernel.org> (raw)
In-Reply-To: <20190703220105.5a5db301@gandalf.local.home>

On Wed, 3 Jul 2019 22:01:05 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Thu, 4 Jul 2019 10:51:26 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > > > diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> > > > index 779ec11f61bd..a7b06291e32c 100644
> > > > --- a/tools/testing/selftests/ftrace/test.d/functions
> > > > +++ b/tools/testing/selftests/ftrace/test.d/functions
> > > > @@ -91,8 +91,8 @@ initialize_ftrace() { # Reset ftrace to initial-state
> > > >      reset_events_filter
> > > >      reset_ftrace_filter
> > > >      disable_events
> > > > -    echo > set_event_pid	# event tracer is always on
> > > > -    echo > set_ftrace_pid
> > > > +    [ -f set_event_pid ] && echo > set_event_pid  # event tracer is always on  
> > > 
> > > I probably should remove that comment, because I believe that was why
> > > it wasn't tested :-/  
> > 
> > Hmm, OK. I think this comment means "the event tracer is always on if clearing
> > set_event_pid filter". Would this need to be removed?
> 
> When this was added in commit 131f840d5b7 ("selftests: ftrace:
> Initialize ftrace before each test"), we had this:
> 
> +    echo > set_event_pid       # event tracer is always on
> +    [ -f set_ftrace_filter ] && echo | tee set_ftrace_*
> +    [ -f set_graph_function ] && echo | tee set_graph_*
> +    [ -f stack_trace_filter ] && echo > stack_trace_filter
> +    [ -f kprobe_events ] && echo > kprobe_events
> +    [ -f uprobe_events ] && echo > uprobe_events
> 
> Where set_event_pid is the only file not tested for existence. I
> figured that comment was the reason for not testing it. If that was the
> case, then adding a test, I would think we should remove the comment.

Ah, I see.

> 
> Do you agree?

Yes, I agree with removing it.

Thank you!

> 
> -- Steve
> 
> 
> > 
> > Thank you,
> > 
> > > 
> > > -- Steve
> > > 
> > >   
> > > > +    [ -f set_ftrace_pid ] && echo > set_ftrace_pid
> > > >      [ -f set_ftrace_filter ] && echo | tee set_ftrace_*
> > > >      [ -f set_graph_function ] && echo | tee set_graph_*
> > > >      [ -f stack_trace_filter ] && echo > stack_trace_filter  
> > >   
> > 
> > 
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2019-07-04  5:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-03 19:49 [PATCH 0/2] ftrace/selftest: Fix ftracetest for non existant config and files Steven Rostedt
2019-07-03 19:50 ` [PATCH 1/2] ftrace/selftests: Return the skip code when tracing directory not configured in kernel Steven Rostedt
2019-07-04  1:40   ` Masami Hiramatsu
2019-07-03 19:50 ` [PATCH 2/2] ftrace/selftest: Test if set_event/ftrace_pid exists before writing Steven Rostedt
2019-07-03 20:00   ` Steven Rostedt
2019-07-03 20:01     ` Steven Rostedt
2019-07-04  1:51     ` Masami Hiramatsu
2019-07-04  2:01       ` Steven Rostedt
2019-07-04  5:56         ` Masami Hiramatsu [this message]
2019-07-04  1:43   ` Masami Hiramatsu

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=20190704145631.58e78ce0add30b3987ea8845@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=shuah@kernel.org \
    /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).