Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7665549rwb; Tue, 6 Dec 2022 08:24:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf45tVgu99saBGiaeOy6d+53O5nSj5C3BM/5NVR2Jkf/5NvadHOkAPsNogPtbHU+/LcAqTR4 X-Received: by 2002:a17:90a:6c8f:b0:219:661f:9916 with SMTP id y15-20020a17090a6c8f00b00219661f9916mr32230416pjj.200.1670343870323; Tue, 06 Dec 2022 08:24:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670343870; cv=none; d=google.com; s=arc-20160816; b=b/Nr2/TSeKd19oIZdB3SpxNNrCr3TAR7lZUP3j1tjRqMAUQfAx7TXzSzqXGVv7zBFa HnGxl4jm9iIPvRUgSCaHBCyzvS2S7as1/3MJkJUb9qzu5UnnDbs+5d6ca47vKlZ23hvA SAZBokzDYqbZWx1lggikE+0RLTSOUONm3tY2PQjVCIxL3HoAGV1cBrvedUYUDNUHSXnj cAOg5PXFkskhLom20UuARD0pBlIEV2GPqk8faTpyCqPT8aWzqAROQslaGF6dkZp6HwnH MZRkVqqaCGoIC9w8w7dj7FknYzoCKDXQS9rPNXGqVJDdefNtvBg7D6fUhccIW436Vno2 aCyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AAbScs15nqqaR9D6cw/WqSu4qln2zkRtlWEHaZoFf+Y=; b=D4dRKqN01Fh9MF49+HcA7y7cl2G7at6llMHBdy1lWuZ/vS0WIWguaWTpaidcnUbGRe oPvQDFJdNXmX6sDTsdH4KDjyALrahb7LOgE9bZfFLPXWe92I+tbKwzcpbO03HVnSFYie 5PqlNSmlvPlYud+awMDJYBP/aW9S8Z8k/tafIGrP6yYHjcHhahucQPP5ZAXpWyYGx4tB kkOAfO9VGhX1mf0dmgAIo1q8g6duNGMIg+ybqqO0Oq3tTzebFwVf/2+vQ073X4aRqzIK ud6O5C/W2S+53ez92U5TZzEMuGaJVg4liMk4bSv9dFUe1D7be1GS6VurSoL+QQrEEMae 0fzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aASCFaFX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 189-20020a6309c6000000b00478731f1451si14393202pgj.670.2022.12.06.08.24.16; Tue, 06 Dec 2022 08:24:30 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aASCFaFX; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235398AbiLFQLc (ORCPT + 78 others); Tue, 6 Dec 2022 11:11:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235518AbiLFQLD (ORCPT ); Tue, 6 Dec 2022 11:11:03 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E3B93C6F5; Tue, 6 Dec 2022 08:05:45 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 01293B81A10; Tue, 6 Dec 2022 16:05:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 637FAC433D6; Tue, 6 Dec 2022 16:05:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670342742; bh=dhu2N+fEW5LFXReqHPaIbjnwpjqZjO1Gm9ovtwKYHj4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aASCFaFX/41rDkHGOe4s8/Szn3fOhbUbO0PzyjQK17UbveQ/fODkG9W21MpOLYCEL zdOPglkViYxEIBDYBkmPAD20rti/LWZ9Z5WFRfo5otIFAeQKTyn2G1zMXk5gbYX/VU JxoPxZdR5R8naILz191DccbzKbwGD0+fOBQOB/r+enn9TS/ojPQt3BlKETiIqmhnzN PETmVcKDusM2qOE9dT8R6lh+SXWme02Wolp9ciEgX3TKwjZS8Ye4JcSHP61QTHb4xs WYpLmiPvkelKA8XakdeX2Ehqy58uTPoqw1qSeBCX5kMJxwSmXT0N4PAewigpK8xb6V 6wGxUfnNAQbFA== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 662F040404; Tue, 6 Dec 2022 13:05:39 -0300 (-03) Date: Tue, 6 Dec 2022 13:05:39 -0300 From: Arnaldo Carvalho de Melo To: Athira Rajeev Cc: Namhyung Kim , Jiri Olsa , Ingo Molnar , Peter Zijlstra , LKML , Ian Rogers , Adrian Hunter , linux-perf-users@vger.kernel.org, Kan Liang , Leo Yan , Andi Kleen , James Clark , Xing Zhengjun , Michael Petlan Subject: Re: [PATCH] perf stat: Update event skip condition Message-ID: References: <20221205231630.319759-1-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Url: http://acmel.wordpress.com X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 Em Tue, Dec 06, 2022 at 07:45:29PM +0530, Athira Rajeev escreveu: > > > > On 06-Dec-2022, at 4:46 AM, Namhyung Kim wrote: > > > > In print_counter_aggrdata(), it skips some events that has no aggregate > > count. It's actually for system-wide per-thread mode and merged uncore > > and hybrid events. > > > > Let's update the condition to check them explicitly. > > > > Fixes: 91f85f98da7a ("Display event stats using aggr counts") > > Reported-by: Athira Rajeev > > Signed-off-by: Namhyung Kim > > --- > > Athira, could you please check this fixes the problem? > > > > tools/perf/util/stat-display.c | 16 +++++++++------- > > 1 file changed, 9 insertions(+), 7 deletions(-) > > > > diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c > > index 847acdb5dc40..6c0de52ac4be 100644 > > --- a/tools/perf/util/stat-display.c > > +++ b/tools/perf/util/stat-display.c > > @@ -814,7 +814,8 @@ static void print_counter_aggrdata(struct perf_stat_config *config, > > os->nr = aggr->nr; > > os->evsel = counter; > > > > - if (counter->supported && aggr->nr == 0) > > + /* Skip already merged uncore/hybrid events */ > > + if (counter->merged_stat) > > return; > > Hi Namhyung, > > Thanks for the fix. > > This patch removes the merged_stat checks from print_aggr and print_aggr_cgroup. > We also have this check in print_counter which needs to be removed. > > With that change, Waiting for v2 then. - Arnaldo > Acked-by: Athira Rajeev > > > > > uniquify_counter(config, counter); > > @@ -823,6 +824,13 @@ static void print_counter_aggrdata(struct perf_stat_config *config, > > ena = aggr->counts.ena; > > run = aggr->counts.run; > > > > + /* > > + * Skip value 0 when enabling --per-thread globally, otherwise it will > > + * have too many 0 output. > > + */ > > + if (val == 0 && config->aggr_mode == AGGR_THREAD && config->system_wide) > > + return; > > + > > if (!metric_only) { > > if (config->json_output) > > fputc('{', output); > > @@ -899,9 +907,6 @@ static void print_aggr(struct perf_stat_config *config, > > print_metric_begin(config, evlist, os, s); > > > > evlist__for_each_entry(evlist, counter) { > > - if (counter->merged_stat) > > - continue; > > - > > print_counter_aggrdata(config, counter, s, os); > > } > > print_metric_end(config, os); > > @@ -928,9 +933,6 @@ static void print_aggr_cgroup(struct perf_stat_config *config, > > print_metric_begin(config, evlist, os, s); > > > > evlist__for_each_entry(evlist, counter) { > > - if (counter->merged_stat) > > - continue; > > - > > if (counter->cgrp != os->cgrp) > > continue; > > > > -- > > 2.39.0.rc0.267.gcb52ba06e7-goog > > -- - Arnaldo