]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Dec 2025 13:02:27 +0000 (14:02 +0100)
commitb5b479a13b90a1684f54835e61617d9e1f2f312d
tree3c04c2f4fe042f192658abc66b1c5bccf41347dd
parentcaceff35c24ad8daad32cc96294d65a4c5bb1b8d
perf bpf_counter: Fix opening of "any"(-1) CPU events

[ Upstream commit 2a67955de13624ec17d1c2504d2c9eeb37933b77 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/perf/builtin-stat.c
tools/perf/util/bpf_counter.c