Skip to contentSkip to conversation

perf stat bperf cgroup: Increase MAX_EVENTS from 32 to 1024

PATCH Applied Ian Rogers 2 participants 2 messages Oct 16, 2025 – Oct 20, 2025

Subsystems (2)
lore
Share & tools
lore

Ian Rogers

author reviewer
#0 lore raw

PATCH 1/1 perf stat bperf cgroup: Increase MAX_EVENTS from 32 to 1024

The MAX_EVENTS value ensured a counted loop presumably to satisfy the BPF verifier. It is possible to go past 32 events when gathering uncore events. Increase the amount to 1024 as that should provide some amount of headroom.

---
 tools/perf/util/bpf_skel/bperf_cgroup.bpf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/bpf_skel/bperf_cgroup.bpf.c +1 -1
index 57cab7647a9a..18ab4d9b49ff 100644
@@ -7,7 +7,7 @@
 #include <bpf/bpf_core_read.h>
 
 #define MAX_LEVELS  10  // max cgroup hierarchy level: arbitrary
-#define MAX_EVENTS  32  // max events per cgroup: arbitrary
+#define MAX_EVENTS  1024  // max events per cgroup: arbitrary
 
 // NOTE: many of map and global data will be modified before loading
 //       from the userspace (perf tool) using the skeleton helpers.
Signature · 1 line
2.51.0.788.g6d19910ace-goog
maintainer Applied
#1 lore raw
Quoted 6 lines · Ian Rogers

The MAX_EVENTS value ensured a counted loop presumably to satisfy the BPF verifier. It is possible to go past 32 events when gathering uncore events. Increase the amount to 1024 as that should provide some amount of headroom.

Applied to perf-tools-next, thanks!

Best regards,
Namhyung