All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Athira Rajeev <atrajeev@linux.vnet.ibm.com>
Cc: Namhyung Kim <namhyung@kernel.org>, Jiri Olsa <jolsa@kernel.org>,
	Ingo Molnar <mingo@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	linux-perf-users@vger.kernel.org,
	Kan Liang <kan.liang@linux.intel.com>,
	Leo Yan <leo.yan@linaro.org>, Andi Kleen <ak@linux.intel.com>,
	James Clark <james.clark@arm.com>,
	Xing Zhengjun <zhengjun.xing@linux.intel.com>,
	Michael Petlan <mpetlan@redhat.com>
Subject: Re: [PATCH] perf stat: Update event skip condition
Date: Tue, 6 Dec 2022 13:05:39 -0300	[thread overview]
Message-ID: <Y49oU5fJCNjAdh3S@kernel.org> (raw)
In-Reply-To: <ED791914-FA30-410A-8BD8-735248940A72@linux.vnet.ibm.com>

Em Tue, Dec 06, 2022 at 07:45:29PM +0530, Athira Rajeev escreveu:
> 
> 
> > On 06-Dec-2022, at 4:46 AM, Namhyung Kim <namhyung@kernel.org> 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 <atrajeev@linux.vnet.ibm.com>
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> > 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 <atrajeev@linux.vnet.ibm.com>
> 
> > 
> > 	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

      reply	other threads:[~2022-12-06 16:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 23:16 [PATCH] perf stat: Update event skip condition Namhyung Kim
2022-12-06 14:15 ` Athira Rajeev
2022-12-06 16:05   ` Arnaldo Carvalho de Melo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y49oU5fJCNjAdh3S@kernel.org \
    --to=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=leo.yan@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=mpetlan@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=zhengjun.xing@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.