]> www.infradead.org Git - users/jedix/linux-maple.git/commit
perf stat: Use counter cpumask to skip zero values
authorIan Rogers <irogers@google.com>
Thu, 3 Apr 2025 19:43:35 +0000 (12:43 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 12 May 2025 17:18:16 +0000 (14:18 -0300)
commitf60c3f44689ac2bc33340f37adbc837a4fb79c91
treea94898eb0927c57617bb5a9c5365ffd878bf4afb
parent2e7a2f7f3c6e3a991948f04b6fbc376d98ee019c
perf stat: Use counter cpumask to skip zero values

When a counter is 0 it may or may not be skipped.

For uncore counters it is common they are only valid on 1 logical CPU
and all other CPUs should be skipped.

The PMU's cpumask was used for the skip calculation, but that cpumask
may not reflect user overrides.

Similarly a counter on a core PMU may explicitly not request a CPU be
gathered.

If the counter on this CPU's value is 0 then the counter should be
skipped as it wasn't requested.

Switch from using the PMU cpumask to that associated with the evsel to
support these cases.

Avoid potential crash with --per-thread mode where config->aggr_get_id
is NULL. Add some examples for the tool event 0 counter skipping.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: Kan Liang <kan.liang@linux.intel.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Dominique Martinet <asmadeus@codewreck.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Leo Yan <leo.yan@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Weilin Wang <weilin.wang@intel.com>
Cc: Yicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20250403194337.40202-3-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/stat-display.c