From mboxrd@z Thu Jan 1 00:00:00 1970 From: Masami Hiramatsu 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 Message-ID: <20180517081504.119ed2cd0fedc2a43199d86a@kernel.org> References: <20180514205845.017925650@goodmis.org> <20180514205958.915494639@goodmis.org> <20180516215350.4fb775e101bc6a122bfe3282@kernel.org> <20180516100004.1e9c774c@gandalf.local.home> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: linux-kernel@vger.kernel.org, Ingo Molnar , Andrew Morton , Thomas Gleixner , Tom Zanussi , Clark Williams , Karim Yaghmour , Brendan Gregg , Joel Fernandes , Namhyung Kim , Yann Ylavic , linux-rt-users@vger.kernel.org To: Steven Rostedt Return-path: In-Reply-To: <20180516100004.1e9c774c@gandalf.local.home> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-rt-users.vger.kernel.org On Wed, 16 May 2018 10:00:04 -0400 Steven Rostedt wrote: > On Wed, 16 May 2018 21:53:50 +0900 > Masami Hiramatsu wrote: > > > On Mon, 14 May 2018 16:58:56 -0400 > > Steven Rostedt wrote: > > > > > From: "Steven Rostedt (VMware)" > > > > > > 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 > > 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) > > > --- > > > .../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