aya-rs/aya

Automatically set max_elements for perf_event_arrays

astoycos opened this issue · 0 comments

The problem is that when the map size is larger than the total number of possible CPUs in the system, i.e the system probably has 16 cores / 32 hyperthreads numbered from 0-31, hence the error when trying to create a perf ring for CPU 32.

The fix is to not specify max_elems for perf event arrays, which makes the loader determine the correct size for the current system. This is supported both by cilium/ebpf and newer libbpf / iproute2 versions.

cilium/ebpf#1029

We need to support the same behavior in aya