Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1117623pxb; Wed, 27 Oct 2021 20:00:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwaLqjt3leWgoQKf//tRwVyr98ahpcrl3Fd3VwsttFy8+iLM7MSTKHJ9F/6fNyXQC8rS847 X-Received: by 2002:a62:61c3:0:b0:44d:2518:cdf1 with SMTP id v186-20020a6261c3000000b0044d2518cdf1mr1643959pfb.31.1635390013455; Wed, 27 Oct 2021 20:00:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635390013; cv=none; d=google.com; s=arc-20160816; b=ogWrl1DhHu22KB5owhn5zOo6/x6NvNpx4Nfoj43MKlRMn97EztFUWpMK24jI4RW2Hi cH2bD1jfCUnbhmxRLdOpwgFA8rgznMI0um0xghaEpw/xk64CmZEp75xwrX7AmrFdkKFk 80Uk6RBgB9iCpMBhA8C9upUYS0xoICWD8sNJztCy9PZM5iHtWerXJErepgnrX/SXMCeV vPCQ9TlAFlFk0gdDoKZ5bSjoVSBM0qnimTf/BAHESEB4joXk0rKm5I7OYfRLmMs4F3DM pm1+j+1UkZHyCjQn5f5Gvd9ySa7K1PCshl+IgHMYX4cd4uBj1Lbc6bdKkXPuggOuO+Hq zpRg== 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=3qcGlXwseyhQvDxLjOR5ajAV6VxNHCsQF0+nodus9VQ=; b=IPA4gXsK8nAmIlQK0XXY6LA/v6rHKGRE0wJmSkcQt+aubsHpfInicOYPm11J0Oq6Kg OiEKpFtAAuCZK/SDKX0eE+BuofzVCcMR4bnb2vzLNPlvee4livU1OK4csj3ymVtmvj5K wY0T9dQusDIJlg7k6PaDsoezv1AxIysdDyd4VuwxUQn8DgcuQhTgs7isMWOY3MZTjZhJ +pitzoCmu0JN+LCi8ih0R68CziRg3iu/7OiOSLGS2FBfI+IZk7qHgxG0cw+8hxkhCfgA DNfsdqBkrTXg8wtMYO7qrdsvsLgQJFOgzpk8SZdQNxt6ICCT3+yHPv4V89eUQDiJKiVJ dBeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=n911yFUN; 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 h1si1989914pjg.93.2021.10.27.20.00.00; Wed, 27 Oct 2021 20:00:13 -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=n911yFUN; 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 S229675AbhJ1DB3 (ORCPT + 99 others); Wed, 27 Oct 2021 23:01:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbhJ1DB2 (ORCPT ); Wed, 27 Oct 2021 23:01:28 -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 9D804C061570 for ; Wed, 27 Oct 2021 19:59:02 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id f11so4570168pfc.12 for ; Wed, 27 Oct 2021 19:59:02 -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=3qcGlXwseyhQvDxLjOR5ajAV6VxNHCsQF0+nodus9VQ=; b=n911yFUNLpyC7fYO2MLdIAmD5pOTKRgjP3CUghSF3cxrpv4/jRNUHSilbGMZIYsQNa okuTcxZnouwUvdFIeBYNtp7a0F4FSjufGY/c6YC8mDZYgv4fZAx6DWvBnQmcQiQ9scO6 1HZE90E/8AlrGD5cYqgV7ohdnzYCwMBrAVx2/0veOr0zQ6WIH5Elqmh6tNNAL1UdBPJG vdS5jHxiIPem++trLFW+YqX9CV1Ed8u6qk5JGu6Vc5Pa7wmkt8BruyewYvHskbEHfA2s Vt223zhuX/WlC6aRrr/hyHcuV/IqXMazlU/0hSwFrnvVIj4S+/eIQSIi6WLuU3KkRaeE HrGQ== 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=3qcGlXwseyhQvDxLjOR5ajAV6VxNHCsQF0+nodus9VQ=; b=noH1v4Vs667b3dguVq2/5WLeJjEi6Ifw0XT04TUeGPQL26sQpvbY/t6nJQTOQUzxGz aZ3vuneDa/nIgTz857Yu8ddnKEzSTT4cLdO9dIWqsnnXM9pwkKinZgpWgZbgNllwzcHW 01SY2RgYBZdZO3rb8qB1ATJFKIN4rhLtyrYMEvlPSWnXfG+TOcTQ3Vb+7XLfgOeowLFg fsInuLH3c1Oo9ezDD7LCNVFNvoVQgoRKjb+KkAJHR8Cy2r/z9nff5PD+4HeA1uN4TIus VNLoO3jDS4jTDflYw2ygU7P1ITg4YL/UJu/q6cTcfKQbpesfMfXBs0pyrkIRx02N49Ne Tk/A== X-Gm-Message-State: AOAM532EkpGH6uhAn7hC7kc/ggWJ7gEA3z5w1wY+5vLZSS3CIvCP+vEG rulmzB1E79ukKsFUVz67qfs5JyMin++1R/oAw0MkdA== X-Received: by 2002:a63:618d:: with SMTP id v135mr1249184pgb.79.1635389941763; Wed, 27 Oct 2021 19:59:01 -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: <20211028094351.617b7c2ea7c56055ee68d909@kernel.org> From: Kalesh Singh Date: Wed, 27 Oct 2021 19:58:50 -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 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] 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