Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1189524rwb; Wed, 14 Dec 2022 07:32:48 -0800 (PST) X-Google-Smtp-Source: AA0mqf4NeHERp5HsTcJagSeW2RwiNBklFfQ3KxVyuJQ/Ef3h9bBemvIoQyHyRmhzDXXKlXR4xe5z X-Received: by 2002:a17:906:a157:b0:7ae:83f4:3bf5 with SMTP id bu23-20020a170906a15700b007ae83f43bf5mr20969009ejb.68.1671031967925; Wed, 14 Dec 2022 07:32:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671031967; cv=none; d=google.com; s=arc-20160816; b=llbg5yXtBkmTchLz6wmE6YYZEZB2hobTOfqh65QuXfoSRBsqplL5BrcxI2mOrh/ktE oEgn8vIIqI9LK7Zwe/yTil1gPpv/nPwSavJYtfwE94tyWJgP1milpFPznMLyBMzLIEMy pk4PyuQUwtvMI8YjG02FIbv3oMy4ivGjZ/PK7UJ1jNwGz84swb06ukG9zR6jdOrkb7Do LTh1GLUiZAl1nokfKJoOER/C9ok66KlHn8vAfpSgj4XRMQL62w4HTQwAxM9M623BE5cI D62iQc5/5764MwM7KruduH+T/P7kaW5RtwoOYKGnN1IsFR2MRoPVqE2FZnZeiaf0u9cY 3uNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=sAl6k73b0Wy4ug9g2YuLH7ClUuzXCQnrfdU1XpA3hD8=; b=vQ12AJMtiDaVC6QM5HO0nbfGhpnkxM7sQStVbXHxbNyRYN/F2aBtKHeooM+oNu3H5T neRdLexUA7vX9KRWLDfeCvOX27g5ri9Kt2gZ8Ug5nI2YkMcQG18F253IbDu9pIkxqk+f llWs69iqsXnJTlB/Bpa+RmrPz7anjg8v62E6YqaLTVBEozep3IGBLvcTPcN5DH9qKJZI UnukXUR7TFAzH6K5ncWakE6A2QfSaCgzl5UsKO2SIOlsZ0kBbHt7ObI9nArTG+a6vLkB eBAPwsPTaN/veun81ipok+zsb8HkEp6gEfz1+3ZXYAvLTwlcSWnbEcs/wl+k672ZEyR8 1zUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww2-20020a170907084200b007bdfe3a6d8bsi11364795ejb.611.2022.12.14.07.32.27; Wed, 14 Dec 2022 07:32:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238482AbiLNO0w (ORCPT + 69 others); Wed, 14 Dec 2022 09:26:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbiLNO0u (ORCPT ); Wed, 14 Dec 2022 09:26:50 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0F20120355; Wed, 14 Dec 2022 06:26:48 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 38235FEC; Wed, 14 Dec 2022 06:27:29 -0800 (PST) Received: from [10.57.10.207] (unknown [10.57.10.207]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 460FE3F73B; Wed, 14 Dec 2022 06:26:46 -0800 (PST) Message-ID: Date: Wed, 14 Dec 2022 14:26:44 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH 2/2] perf stat: fix unexpected delay behaviour Content-Language: en-US To: Namhyung Kim , Arnaldo Carvalho de Melo Cc: =?UTF-8?Q?Adri=c3=a1n_Herrera_Arcila?= , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, leo.yan@linaro.org, songliubraving@fb.com, peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org References: <20220729161244.10522-1-adrian.herrera@arm.com> <20220729161244.10522-2-adrian.herrera@arm.com> From: James Clark In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/12/2022 16:40, Namhyung Kim wrote: > Hi, > > On Tue, Dec 13, 2022 at 6:44 AM Arnaldo Carvalho de Melo > wrote: >> >> Em Mon, Aug 01, 2022 at 09:20:37AM +0100, James Clark escreveu: >>> >>> >>> On 29/07/2022 17:12, Adrián Herrera Arcila wrote: >>>> The described --delay behaviour is to delay the enablement of events, but >>>> not the execution of the command, if one is passed, which is incorrectly >>>> the current behaviour. >>>> >>>> This patch decouples the enablement from the delay, and enables events >>>> before or after launching the workload dependent on the options passed >>>> by the user. This code structure is inspired by that in perf-record, and >>>> tries to be consistent with it. >>>> >>>> Link: https://lore.kernel.org/linux-perf-users/7BFD066E-B0A8-49D4-B635-379328F0CF4C@fb.com >>>> Fixes: d0a0a511493d ("perf stat: Fix forked applications enablement of counters") >>>> Signed-off-by: Adrián Herrera Arcila >>>> --- >>>> tools/perf/builtin-stat.c | 56 ++++++++++++++++++++++----------------- >>>> 1 file changed, 32 insertions(+), 24 deletions(-) >>> >>> Looks good to me. Fixes the counter delay issue and the code is pretty >>> similar to perf record now. Although I would wait for Leo's or Song's >>> comment as well because they were involved. >> >> I think I didn't notice Leo's ack, it still applies, so I'm doing it >> now. > > I think the BPF counters should be enabled/disabled together. I did notice that difference between the two, but I wasn't sure of the exact reason that it was done that way on Adrián's version. It seems like it's not separated in perf record so maybe you are right. > > Thanks, > Namhyung