[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAP-5=fXH1tP_x22_YXi3F3POjjTxc8216o6=F+19XSYEWGwgOA@mail.gmail.com>
Date: Sat, 7 Feb 2026 17:30:42 -0800
From: Ian Rogers <irogers@...gle.com>
To: Arnaldo Carvalho de Melo <acme@...nel.org>
Cc: Chun-Tse Shao <ctshao@...gle.com>, linux-kernel@...r.kernel.org, peterz@...radead.org,
mingo@...hat.com, namhyung@...nel.org, mark.rutland@....com,
alexander.shishkin@...ux.intel.com, jolsa@...nel.org, adrian.hunter@...el.com,
james.clark@...aro.org, kan.liang@...ux.intel.com, yang.lee@...ux.alibaba.com,
linux-perf-users@...r.kernel.org
Subject: Re: [PATCH] perf stat: Ensure metrics are displayed even with failed events
On Fri, Feb 6, 2026 at 1:17 PM Arnaldo Carvalho de Melo <acme@...nel.org> wrote:
>
> On Tue, Feb 03, 2026 at 03:41:30PM -0800, Ian Rogers wrote:
> > On Tue, Feb 3, 2026 at 3:07 PM Chun-Tse Shao <ctshao@...gle.com> wrote:
>
> > > $ ./perf stat -M CPUs_utilized -a --metric-only -j -- sleep 1
> > > {"CPUs CPUs_utilized" : "none"}
>
> > > Signed-off-by: ctshao@...gle.com
>
> > Reviewed-by: Ian Rogers <irogers@...gle.com>
>
> Thanks, applied to perf-tools-next,
I've started seeing this test failure following this change:
```
$ perf test -v 59
--- start ---
test child forked, pid 2316256
metric expr inst_retired.any / cpu_clk_unhalted.thread for IPC
Using CPUID GenuineIntel-6-8D-1
found event inst_retired.any
found event cpu_clk_unhalted.thread
Parsing metric events
'{inst_retired.any/metric-id=inst_retired.any/,cpu_clk_unhalted.thread/metric-id=cpu_clk_unhalted.thread/}:W'
Matched metric-id inst_retired.any to inst_retired.any
Matched metric-id cpu_clk_unhalted.thread to cpu_clk_unhalted.thread
FAILED tests/parse-metric.c:142 IPC failed, wrong ratio
FAILED tests/parse-metric.c:293 IPC failed
---- end(-1) ----
59: Parse and process metrics : FAILED!
```
The following fixes it for me:
```
diff --git a/tools/perf/tests/parse-metric.c b/tools/perf/tests/parse-metric.c
index 6bbc209a5c6a..7c7f489a5eb0 100644
--- a/tools/perf/tests/parse-metric.c
+++ b/tools/perf/tests/parse-metric.c
@@ -41,6 +41,8 @@ static void load_runtime_stat(struct evlist *evlist,
struct value *vals)
count = find_value(evsel->name, vals);
evsel->supported = true;
evsel->stats->aggr->counts.val = count;
+ evsel->stats->aggr->counts.ena = 1;
+ evsel->stats->aggr->counts.run = 1;
}
}
```
I'll mail it out as a fix.
Thanks,
Ian
> - Arnaldo
Powered by blists - more mailing lists