summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-11-12 11:53:11 -0800
committerNamhyung Kim <namhyung@kernel.org>2025-11-17 17:31:59 -0800
commit289815011c91dc6532d3fff7ca1c5f0bea08b474 (patch)
treeca5b18563a76e48d2b5dc42449781acff80c94e9 /tools/perf
parentefee18981aeebc14d6fa06f7556a6df1bd1acf92 (diff)
perf stat: Display metric-only for 0 counters
0 counters may occur in hypervisor settings but metric-only output is always expected. This resolves an issue in the "perf stat STD output linter" test. Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Thomas Falcon <thomas.falcon@intel.com> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/stat-display.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/stat-display.c b/tools/perf/util/stat-display.c
index 5ac9854f8c58..6d02f84c5691 100644
--- a/tools/perf/util/stat-display.c
+++ b/tools/perf/util/stat-display.c
@@ -913,6 +913,9 @@ static bool should_skip_zero_counter(struct perf_stat_config *config,
if (verbose == 0 && counter->skippable && !counter->supported)
return true;
+ /* Metric only counts won't be displayed but the metric wants to be computed. */
+ if (config->metric_only)
+ return false;
/*
* Skip value 0 when enabling --per-thread globally,
* otherwise it will have too many 0 output.