linux-rt-users.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, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Tom Zanussi <tom.zanussi@linux.intel.com>,
	Clark Williams <williams@redhat.com>,
	Karim Yaghmour <karim.yaghmour@opersys.com>,
	Brendan Gregg <bgregg@netflix.com>,
	Joel Fernandes <joel@joelfernandes.org>,
	Namhyung Kim <namhyung@kernel.org>,
	Yann Ylavic <ylavic.dev@gmail.com>,
	linux-rt-users@vger.kernel.org
Subject: Re: [PATCH v2 11/14] ftrace/selftest: Have the reset_trigger code be a bit more careful
Date: Thu, 17 May 2018 08:15:04 +0900	[thread overview]
Message-ID: <20180517081504.119ed2cd0fedc2a43199d86a@kernel.org> (raw)
In-Reply-To: <20180516100004.1e9c774c@gandalf.local.home>

On Wed, 16 May 2018 10:00:04 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Wed, 16 May 2018 21:53:50 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > On Mon, 14 May 2018 16:58:56 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> > 
> > > From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
> > > 
> > > The trigger code is picky in how it can be disabled as there may be
> > > dependencies between different events and synthetic events. Change the order
> > > on how triggers are reset.
> > > 
> > >  1) Reset triggers of all synthetic events first
> > >  2) Remove triggers with actions attached to them
> > >  3) Remove all other triggers
> > > 
> > > If this order isn't followed, then some triggers will not be reset, and an
> > > error may happen because a trigger is busy.  
> > 
> > Ah, right!
> > 
> > Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
> 
> Thanks!
> 
> > 
> > I think this should go into stable tree too.
> 
> I wonder if I should break this into two patches then.
> 
> One for the actions before attached, and one for synthetic events?
> 
> Hmm, maybe not. As it can handle not having synthetic events, it should
> be OK to let the update go to a time when they were not there.
> 
> Thoughts?

I think the latest test-set can be run on the any stable kernel,
and this correctly checks existence of the knob, so you don't need
to split it.

Thank you, 

> 
> -- Steve
> 
> > 
> > Thank you!
> > 
> > > 
> > > Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
> > > ---
> > >  .../testing/selftests/ftrace/test.d/functions | 21 ++++++++++++++++---
> > >  1 file changed, 18 insertions(+), 3 deletions(-)
> > > 
> > > diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> > > index 2a4f16fc9819..8393b1c06027 100644
> > > --- a/tools/testing/selftests/ftrace/test.d/functions
> > > +++ b/tools/testing/selftests/ftrace/test.d/functions
> > > @@ -15,14 +15,29 @@ reset_tracer() { # reset the current tracer
> > >      echo nop > current_tracer
> > >  }
> > >  
> > > -reset_trigger() { # reset all current setting triggers
> > > -    grep -v ^# events/*/*/trigger |
> > > +reset_trigger_file() {
> > > +    # remove action triggers first
> > > +    grep -H ':on[^:]*(' $@ |
> > > +    while read line; do
> > > +        cmd=`echo $line | cut -f2- -d: | cut -f1 -d" "`
> > > +	file=`echo $line | cut -f1 -d:`
> > > +	echo "!$cmd" >> $file
> > > +    done
> > > +    grep -Hv ^# $@ |
> > >      while read line; do
> > >          cmd=`echo $line | cut -f2- -d: | cut -f1 -d" "`
> > > -	echo "!$cmd" > `echo $line | cut -f1 -d:`
> > > +	file=`echo $line | cut -f1 -d:`
> > > +	echo "!$cmd" > $file
> > >      done
> > >  }
> > >  
> > > +reset_trigger() { # reset all current setting triggers
> > > +    if [ -d events/synthetic ]; then
> > > +        reset_trigger_file events/synthetic/*/trigger
> > > +    fi
> > > +    reset_trigger_file events/*/*/trigger
> > > +}
> > > +
> > >  reset_events_filter() { # reset all current setting filters
> > >      grep -v ^none events/*/*/filter |
> > >      while read line; do
> > > -- 
> > > 2.17.0
> > > 
> > >   
> > 
> > 
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2018-05-16 23:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-14 20:58 [PATCH v2 00/14] tracing: Add triggers to trace_marker writes Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 01/14] tracing: Do not reference event data in post call triggers Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 02/14] tracing: Add __find_event_file() to find event files without restrictions Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 03/14] tracing: Have event_trace_init() called by trace_init_tracefs() Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 04/14] tracing: Add brackets in ftrace event dynamic arrays Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 05/14] tracing: Do not show filter file for ftrace internal events Steven Rostedt
2018-05-16  9:10   ` Namhyung Kim
2018-05-16 10:44     ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 06/14] tracing: Add trigger file for trace_markers tracefs/ftrace/print Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 07/14] tracing: Have zero size length in filter logic be full string Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 08/14] tracing: Prevent further users of zero size static arrays in trace events Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 09/14] tracing: Allow histogram triggers to access ftrace internal events Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 10/14] tracing: Document trace_marker triggers Steven Rostedt
2018-05-14 21:47   ` Tom Zanussi
2018-05-16 13:55     ` Steven Rostedt
2018-05-16 15:22       ` Tom Zanussi
2018-05-16 15:26         ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 11/14] ftrace/selftest: Have the reset_trigger code be a bit more careful Steven Rostedt
2018-05-16 12:53   ` Masami Hiramatsu
2018-05-16 14:00     ` Steven Rostedt
2018-05-16 23:15       ` Masami Hiramatsu [this message]
2018-05-14 20:58 ` [PATCH v2 12/14] ftrace/selftest: Fix reset_trigger() to handle triggers with filters Steven Rostedt
2018-05-16 12:56   ` Masami Hiramatsu
2018-05-16 14:04     ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 13/14] tracing/selftest: Add selftests to test trace_marker histogram triggers Steven Rostedt
2018-05-16 13:07   ` Masami Hiramatsu
2018-05-16 14:06     ` Steven Rostedt
2018-05-14 20:58 ` [PATCH v2 14/14] tracing/selftest: Add test to test hist trigger between kernel event and trace_marker Steven Rostedt
2018-05-16  9:11   ` Namhyung Kim
2018-05-16 14:09     ` Steven Rostedt

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=20180517081504.119ed2cd0fedc2a43199d86a@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=bgregg@netflix.com \
    --cc=joel@joelfernandes.org \
    --cc=karim.yaghmour@opersys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    --cc=williams@redhat.com \
    --cc=ylavic.dev@gmail.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).