Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1800793pxb; Thu, 28 Oct 2021 10:15:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwvh7jWGFsAbgs0EM1CyGFBUCje8AbPBcxXvZV2FsCGIToADoGUiI5KRmx3Dvfhbodl3uo X-Received: by 2002:a17:906:4818:: with SMTP id w24mr7131360ejq.473.1635441303565; Thu, 28 Oct 2021 10:15:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635441303; cv=none; d=google.com; s=arc-20160816; b=iur/3SCTobXVh/dfsRzkOn7kx+9FSJ1AtYPlfwwexFVkcscI3J1v2XM3/ZKS+0FmeK lf5IQnugMCP1Z2xIruytk4JOPsPVg5J3FQ9OKVTBEpvG6FhJTrr6YCwuAIQeN8DxnpQP yXfPVbden74C5ans4b0uBC7avfBtkZMHJjRWdrDAGtKQZSw/3wEzubY9oEUadEl9xekd 4hxTSLB6M+Q/qrLAiNk1UR5//I49dzW3dGHXvWCbTB+jE2sbGO4K9bQidxyGsKsF5if3 GBETEq26W7bsYpSv38QXV+m24vf4VBDTj2ak2Q8Zm+VWS+MwZ8jvvY/Pa1GoN4OZkrn+ zw0g== 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=wVbViCn1zYbA5LR9hUnHBdFFQuE21UCca59RgZWVkdQ=; b=nOlXXI7JPTfQUqfgV/XcfTduA7HqrfYb6TxvQnti4ayTcjP5UDeb8+HKHLHn72mM/E CBOpE4rhOhvw4W69pQk78UKEi5JvH9ZupvVZ4FvSUcRwAAYDApCrL2M9kRbSP9r4RX2o Cf60sdeuWspTCP/lj0xDHEV7cH5HlAVp5g7HLjjAYlcq9QKf/Gjz8gNJRLx9G+InygUi 0LCo75mJ0laaD9dtr8qs5+cjTk+KntRz2TPO1kPYdsf2YESvjkKKfhCDyDSt0kinno6r J3Txk3oHArPzUTkZCSn9sprWIZpLi66ujGC6e6XSJRMzkfic9XETBRmpvDDjgVtW+McF 4A1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZmxQ221Q; 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 f2si4733620edu.189.2021.10.28.10.14.38; Thu, 28 Oct 2021 10:15:03 -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=ZmxQ221Q; 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 S230397AbhJ1RM7 (ORCPT + 99 others); Thu, 28 Oct 2021 13:12:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230223AbhJ1RM5 (ORCPT ); Thu, 28 Oct 2021 13:12:57 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12BC4C061570 for ; Thu, 28 Oct 2021 10:10:30 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id v193so6594344pfc.4 for ; Thu, 28 Oct 2021 10:10:30 -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=wVbViCn1zYbA5LR9hUnHBdFFQuE21UCca59RgZWVkdQ=; b=ZmxQ221QAXQlBqomXh/jJx3T/qgB6VeZAITESiEDx41zyszYMJYFPhzSkj1HRjnS68 tqRxsomNfKtM5G+/jt9jWm9zvdRa3KTRbQ2pgE+UmALC+nWKvygh19cXIp47lNZVkydE B+d9j8kDp5L+zsONN+v39v6f+hkonMaH/WNJHjCXS4vuXJ8MsWHVWMQsSxgDGVVGWph3 88VfOuJw2EbJfkumIEw13O0h5We0qrmtcz1Mt7mmb8argl6kg4ZtZB3ylI1sr9tfedfD deh1BjXCahsnK5CMhCsOsbpZzOeqdQocrhOlOShrf3E3RXVFGTodxa30TG8dv1TJfs3W PVFg== 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=wVbViCn1zYbA5LR9hUnHBdFFQuE21UCca59RgZWVkdQ=; b=P6t9q9soWQwdRFpam+/ItiLxYPseq4qZYlvjD62qg2psZ4AMLUwY7HYvHHHZNuTguE R8nWLjffNwaWox1Xz4LftsKXUhqe8xL3qbwWDXjAC99CJWnyqQhulEXz50eKZ5vsEkXy WBFyWxn8VSgtXFq2pySfrqc/TiyfvYzxg2mTe0F4/O/XBb1auILDIvX9ELlC4eA95WBP D/OTNSTa4sMbueDfIBGiUebRl6tPRGGGuyAAP6RQ1MV9Yy1z8HdR9E3ozysujbAlK3vz RYJGhctr1MFVkwrFtzLrhAuFBAOH28Oo99Ye4QomkVhqFG441+95EPQLRZTGjAZUw1hg M02Q== X-Gm-Message-State: AOAM531ZUimDGxiJzJ+sPJVGc6k+7oy4LElhBcRZZanza8D8fFprqe+S PuCE4lpnzXFdEkidUzyhgSuwIhkvgIxwtK7QCr6roQ== X-Received: by 2002:a63:618d:: with SMTP id v135mr4170958pgb.79.1635441029064; Thu, 28 Oct 2021 10:10:29 -0700 (PDT) MIME-Version: 1.0 References: <20211027205919.1648553-1-kaleshsingh@google.com> <20211027205919.1648553-3-kaleshsingh@google.com> <20211028065849.76b1bd7151e440881298b523@kernel.org> <20211027195454.60993c83@rorschach.local.home> <20211028094351.617b7c2ea7c56055ee68d909@kernel.org> In-Reply-To: From: Kalesh Singh Date: Thu, 28 Oct 2021 10:10:17 -0700 Message-ID: Subject: Re: [PATCH 2/3] tracing/kselftests: Remove triggers with references before their definitions To: Masami Hiramatsu Cc: Steven Rostedt , surenb@google.com, hridya@google.com, namhyung@kernel.org, kernel-team@android.com, 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 7:58 PM Kalesh Singh wrote: > > On Wed, Oct 27, 2021 at 5:43 PM Masami Hiramatsu wrote: > > > > On Wed, 27 Oct 2021 19:54:54 -0400 > > Steven Rostedt wrote: > > > > > On Wed, 27 Oct 2021 16:26:00 -0700 > > > Kalesh Singh wrote: > > > > > > > > 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. > > > > > > Right, because are triggers not added by list_add_rcu() which adds to > > > the head of the list. > > > > Oops, so are the triggers shown in the reverse order? > > (newer entry is top, older one is bottom) > > Then do we need this patch, because we don't care about the > > dependency. > > In the case of the hist expression tests. they create a variable: > echo 'hist:keys=common_pid:x=1+2' >> trigger > > Then print its value in another histogram: > echo 'hist:keys=common_pid:vals=$x' >> trigger > > At least in this case, the triggers are listed from oldest (top) to > newest (bottom): > cat trigger > hist:keys=common_pid:vals=hitcount:x=3:sort=hitcount:size=2048 [active] I realized the result of the expression can be read directly from the trigger info, now that expressions of constants are squashed to a single constant. So we wouldn't need the second trigger to see the value and can drop this patch. I'll resend a new version. Thanks, Kalesh > hist:keys=common_pid:vals=hitcount,$x:sort=hitcount:size=2048 [active] > > So we need to remove the trigger with the var ref first. > > - Kalesh > > > > > If anything, shouldn't things be removed in order? > > > > Hmm, I think the trigger itself might better to be changed. If any dependency in > > the trigger list, it can not be restored from the copied file, like > > below may fail. > > > > cat events/foo/bar/trigger > /tmp/foo.bar.trigger > > cat /tmp/foo.bar.trigger > events/foo/bar/trigger > > > > (of course we can use 'tac' to restore it ...) > > > > This is > > > > Thank you, > > > > > > -- > > Masami Hiramatsu