lkml.org 
[lkml]   [2021]   [Oct]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/3] tracing/kselftests: Remove triggers with references before their definitions
On Wed, Oct 27, 2021 at 2:58 PM Masami Hiramatsu <mhiramat@kernel.org> wrote:
>
> Hi Kalesh,
>
> On Wed, 27 Oct 2021 13:59:09 -0700
> Kalesh Singh <kaleshsingh@google.com> wrote:
>
> > If an event trigger references a variable defined in another trigger, it
> > has to be removed before the trigger that defines the variable is
> > removed.
> >
> > Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
> > ---
> > tools/testing/selftests/ftrace/test.d/functions | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/tools/testing/selftests/ftrace/test.d/functions b/tools/testing/selftests/ftrace/test.d/functions
> > index 000fd05e84b1..bd9e85f4d626 100644
> > --- a/tools/testing/selftests/ftrace/test.d/functions
> > +++ b/tools/testing/selftests/ftrace/test.d/functions
> > @@ -22,6 +22,15 @@ reset_trigger_file() {
> > file=`echo $line | cut -f1 -d:`
> > echo "!$cmd" >> $file
> > done
> > +
> > + # remove triggers with references next
> > + grep -H '\$' $@ |
> > + while read line; do
> > + cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["`
> > + file=`echo $line | cut -f1 -d:`
> > + echo "!$cmd" >> $file
> > + done
> > +
>
> Why don't you use 'tac'? I love that idea :)
> Did you find any issue?

Hi Masami,

Thanks for the reviews. As with the first set of patches using tac
gives a regression here, though I'm not sure why it doesn't work -- I
also thought reversing the order would handle any dependencies
correctly.

- Kalesh
>
> I think the function which cleaning up the tracing file should use
> the 'tac' rollback method, because it is natural, simple and robust.
> Then the first loop for removing action triggers is not needed anymore.
>
> Thank you,
>
> > grep -Hv ^# $@ |
> > while read line; do
> > cmd=`echo $line | cut -f2- -d: | cut -f1 -d"["`
> > --
> > 2.33.0.1079.g6e70778dc9-goog
> >
>
>
> --
> Masami Hiramatsu <mhiramat@kernel.org>

\
 
 \ /
  Last update: 2021-10-28 01:27    [W:0.080 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site