]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf bpf_counter: Fix opening of "any"(-1) CPU events
authorIan Rogers <irogers@google.com>
Thu, 9 Oct 2025 13:29:11 +0000 (06:29 -0700)
committerNamhyung Kim <namhyung@kernel.org>
Mon, 13 Oct 2025 08:58:51 +0000 (01:58 -0700)
commit2a67955de13624ec17d1c2504d2c9eeb37933b77
tree5b169c1a9e2be0518d87a5d0cb03742cabb21b9e
parent6090e612cf24393335e709105db31b6d6e36d6ef
perf bpf_counter: Fix opening of "any"(-1) CPU events

The bperf BPF counter code doesn't handle "any"(-1) CPU events, always
wanting to aggregate a count against a CPU, which avoids the need for
atomics so let's not change that. Force evsels used for BPF counters
to require a CPU when not in system-wide mode so that the "any"(-1)
value isn't used during map propagation and evsel's CPU map matches
that of the PMU.

Fixes: b91917c0c6fa ("perf bpf_counter: Fix handling of cpumap fixing hybrid")
Signed-off-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/builtin-stat.c
tools/perf/util/bpf_counter.c