From: Ian Rogers <irogers@google.com>
To: irogers@google.com, acme@kernel.org, ctshao@google.com,
namhyung@kernel.org
Cc: adrian.hunter@intel.com, alexander.shishkin@linux.intel.com,
james.clark@linaro.org, jolsa@kernel.org,
linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org,
mingo@redhat.com, peterz@infradead.org,
yang.lee@linux.alibaba.com
Subject: [PATCH v1] perf test parse-metric: Ensure aggregate counts appear to have run
Date: Sat, 7 Feb 2026 21:54:55 -0800 [thread overview]
Message-ID: <20260208055455.2437197-1-irogers@google.com> (raw)
In-Reply-To: <CAP-5=fXH1tP_x22_YXi3F3POjjTxc8216o6=F+19XSYEWGwgOA@mail.gmail.com>
Commit bb5a920b9099 ("perf stat: Ensure metrics are displayed even
with failed events") made it so that counters which weren't enabled in
the kernel were handled as NaN in metrics. This cased the "Parse and
process metrics" test to start failing as it wasn't putting a non-zero
value in these variables. Add arbitrary values of 1 to fix the test.
Fixes: bb5a920b9099 ("perf stat: Ensure metrics are displayed even with failed events")
Signed-off-by: Ian Rogers <irogers@google.com>
---
tools/perf/tests/parse-metric.c | 2 ++
1 file changed, 2 insertions(+)
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;
}
}
--
2.53.0.239.g8d8fc8a987-goog
next prev parent reply other threads:[~2026-02-08 5:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 23:06 [PATCH] perf stat: Ensure metrics are displayed even with failed events Chun-Tse Shao
2026-02-03 23:41 ` Ian Rogers
2026-02-06 21:17 ` Arnaldo Carvalho de Melo
2026-02-08 1:30 ` Ian Rogers
2026-02-08 5:54 ` Ian Rogers [this message]
2026-02-08 14:29 ` [PATCH v1] perf test parse-metric: Ensure aggregate counts appear to have run Arnaldo Carvalho de Melo
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=20260208055455.2437197-1-irogers@google.com \
--to=irogers@google.com \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ctshao@google.com \
--cc=james.clark@linaro.org \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=yang.lee@linux.alibaba.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox