[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8510a140-e2e2-39ce-b344-b456f069a9d0@intel.com>
Date: Mon, 2 May 2022 19:09:08 +0300
From: Adrian Hunter <adrian.hunter@...el.com>
To: Ian Rogers <irogers@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Jiri Olsa <jolsa@...nel.org>,
Namhyung Kim <namhyung@...nel.org>,
Mathieu Poirier <mathieu.poirier@...aro.org>,
Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach <mike.leach@...aro.org>,
Leo Yan <leo.yan@...aro.org>,
John Garry <john.garry@...wei.com>,
Will Deacon <will@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...nel.org>,
Kajol Jain <kjain@...ux.ibm.com>,
James Clark <james.clark@....com>,
German Gomez <german.gomez@....com>,
Riccardo Mancini <rickyman7@...il.com>,
Andi Kleen <ak@...ux.intel.com>,
Alexey Bayduraev <alexey.v.bayduraev@...ux.intel.com>,
Alexander Antonov <alexander.antonov@...ux.intel.com>,
linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Cc: Stephane Eranian <eranian@...gle.com>
Subject: Re: [PATCH v4 3/6] perf stat: Avoid printing cpus with no counters
On 30/04/22 09:23, Ian Rogers wrote:
> perf_evlist's user_requested_cpus can contain CPUs not present in any
> evsel's cpus, for example uncore counters. Avoid printing the prefix and
> trailing \n until the first valid counter is encountered.
>
> Signed-off-by: Ian Rogers <irogers@...gle.com>
Reviewed-by: Adrian Hunter <adrian.hunter@...el.com>
> ---
> tools/perf/util/stat-display.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
> index d9629a83aa78..13f705737367 100644
> --- a/tools/perf/util/stat-display.c
> +++ b/tools/perf/util/stat-display.c
> @@ -948,8 +948,6 @@ static void print_no_aggr_metric(struct perf_stat_config *config,
> struct evsel *counter;
> bool first = true;
>
> - if (prefix)
> - fputs(prefix, config->output);
> evlist__for_each_entry(evlist, counter) {
> u64 ena, run, val;
> double uval;
> @@ -961,6 +959,8 @@ static void print_no_aggr_metric(struct perf_stat_config *config,
>
> id = aggr_cpu_id__cpu(cpu, /*data=*/NULL);
> if (first) {
> + if (prefix)
> + fputs(prefix, config->output);
> aggr_printout(config, counter, id, 0);
> first = false;
> }
> @@ -972,7 +972,8 @@ static void print_no_aggr_metric(struct perf_stat_config *config,
> printout(config, id, 0, counter, uval, prefix,
> run, ena, 1.0, &rt_stat);
> }
> - fputc('\n', config->output);
> + if (!first)
> + fputc('\n', config->output);
> }
> }
>
Powered by blists - more mailing lists