Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp975721pxb; Wed, 27 Oct 2021 16:30:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyT1iyUfMgnH9nUxMgqCHQpP77e3I1uaUXyHfSyb+rEoRyLr8zxvz4ceT2swMQI1+fqq/Hy X-Received: by 2002:a17:906:4301:: with SMTP id j1mr734800ejm.551.1635377419044; Wed, 27 Oct 2021 16:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635377419; cv=none; d=google.com; s=arc-20160816; b=NAMj33KnXR52Wa3nv5/CXPkQj7QlUTGPsjFpS/TbZR3L2Tr70CO19wHNNpFBzl3/JR EnVAu1+PIXSxUJSAqt1C6eqZfpdKOiycui4Pd2nCW9OKBoT9non1L/OImu5s7/BjYDmQ 6zN5a3rhrDLe5W0OFbM7ivWamEe4BYIBdZEZ8Tg1W5Q1Xv7raZtWMpBLmmIxCh7m1NEX YydgazJzsk0Pkc+erg/3si6fu/AmGjYlYtNPexDeCsMS4mhPMMh3oMl89hIQaEquU9x5 F4K5ie1isYjSjrTFbzjcf3rNP/GBAs/O/uYtW65dFDOKKG8heI38I7I4NHkTQ9xv/aRh YzPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HR5ARO7Si6PfX/dXB3BRQw0tF8C5aOImPzmLbJKRS68=; b=cNE5GmFy5ANushOjp5PFKVbTSxS3x/+M4snhZbPBQdLzOQzXnIckQg6PukZVkpDByv 2/qAv2HcOuP1oHkaLHw5Q164D1+W8s4284yKBnH2sYwSryh0I24rlubnVpjoabIdiAqw xnASqctRxoNfoak695Ifq0cdUPwU3hD67TUU8U7+gwZi6524TrvGDzfKKKY1y1Rdaibq hdZMiSIu+JWRiKDGAJmYzpzD7dn+8ZNwxrratvw5GFeMhZeKiUrd/G57C1q36ZCjFALm IUSY67W13pkG/UCk+joPXGQOxEcqP5PJDAOBiTkDvaFlQMBt0l/1ns3MnBZGfeo+BbrY DrrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nlQf8zO6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b13si2014530edz.405.2021.10.27.16.29.54; Wed, 27 Oct 2021 16:30:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=nlQf8zO6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229447AbhJ0X2i (ORCPT + 99 others); Wed, 27 Oct 2021 19:28:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbhJ0X2h (ORCPT ); Wed, 27 Oct 2021 19:28:37 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0752DC061745 for ; Wed, 27 Oct 2021 16:26:12 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id g184so4506954pgc.6 for ; Wed, 27 Oct 2021 16:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HR5ARO7Si6PfX/dXB3BRQw0tF8C5aOImPzmLbJKRS68=; b=nlQf8zO6uI78TN/hHMKb4DnvQiQs1Zqc2reSwopjutNX0yfjbEw6qik2pMeiX83ka5 ylRD3FiR9K6hAEgIgkUvu0EYtzJErtq9hPHzWUKbsSffmmZ4DmvNmjA4GqYxfm7WHSIz l94jCNt64Gty/sN+mxarPNIF3v/eH4K5zUMy4kHd/xViS89PYubqR+uy7Gb0XYf99lEA tyHdUh8DQzUdMYGk+vq1hrg12YHdWyq8deci/s7ThJI8wA2VncC+wlT/FgZuCo1vpsSD jFHEAsUA0jP18aQroBoee5STB/78XdltT7LhaC9juU5qec3oB+jlQVyXAvLlXK6P9MKD cggA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HR5ARO7Si6PfX/dXB3BRQw0tF8C5aOImPzmLbJKRS68=; b=N/Q4IbdTqM41F3cF+QBdCY6NaLkmo18NJyGxTeTlhjOeqPDK/ZebuwICjW5yzd4HIp q46MWPYVHsB4OS8igNWfSfm+XN9Da/ZRxtI37J8XqOobpVHZXbYac7Ky38SO6AduG/85 l5h+1X/f46bVNe+UFhKh5cmz3JDYuDIoJSGn0Kj+H+M08w0t8ECKs30/6t52JCR8juko mTHlhSZUUQ2j3hQHediw1fGiHnwpyTsxkRogrOz6YnuRp0i94we2aiup/qU/J85h1btP 738I+xkER/uADnqmpuBKi6oGBqAi993H6p3nmJw/VY+WRCDg1G6aGk8oqAC+MQ7Hn8r2 aonQ== X-Gm-Message-State: AOAM531KvDVxshn7RwhLvORXkuIy9VfpcLV07ehxjAO/fk9QI+mA4X2D h5zJS9aIox+N3O7+2OTwlo1F0jaqkpY5EAYHJywVMQ== X-Received: by 2002:a63:b212:: with SMTP id x18mr553740pge.345.1635377171205; Wed, 27 Oct 2021 16:26:11 -0700 (PDT) MIME-Version: 1.0 References: <20211027205919.1648553-1-kaleshsingh@google.com> <20211027205919.1648553-3-kaleshsingh@google.com> <20211028065849.76b1bd7151e440881298b523@kernel.org> In-Reply-To: <20211028065849.76b1bd7151e440881298b523@kernel.org> From: Kalesh Singh Date: Wed, 27 Oct 2021 16:26:00 -0700 Message-ID: Subject: Re: [PATCH 2/3] tracing/kselftests: Remove triggers with references before their definitions To: Masami Hiramatsu Cc: surenb@google.com, hridya@google.com, namhyung@kernel.org, kernel-team@android.com, rostedt@goodmis.org, Ingo Molnar , Shuah Khan , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 2:58 PM Masami Hiramatsu wrote: > > Hi Kalesh, > > On Wed, 27 Oct 2021 13:59:09 -0700 > Kalesh Singh 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 > > --- > > 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