You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using Ubuntu 64-bit with Linux kernel 5.0.0-37-generic. I'm running a BPF program which uses a perf_event_array whose id on the BPF VM is 14. When trying to inspect it using bpftool map event_pipe id 14 i get the following error: libbpf: failed to open perf buffer event on cpu #4: No such device Error: failed to create perf buffer: Unknown error -19 (-19)
My machine has 4 cpus online, but 128 possible (e.g /sys/devices/system/cpu/possible contains "0-127")
I guess the problem is that libbpf reads from /sys/devices/system/cpu/possible instead of /sys/devices/system/cpu/online and thus thinks that it needs to attach to 128 cpus instead of just 4.
Yes, thanks for reporting. It's a known libbpf problem (BCC has the same problem as well). I'm going to post a fix for this in next few days. The idea is that we still need to allocate buffers per each of possible CPU, because that's what kernel expects and how kernel operates. But we should be attaching those buffers only for CPUs that are online.
I'm using Ubuntu 64-bit with Linux kernel 5.0.0-37-generic. I'm running a BPF program which uses a perf_event_array whose id on the BPF VM is 14. When trying to inspect it using
bpftool map event_pipe id 14
i get the following error:libbpf: failed to open perf buffer event on cpu #4: No such device Error: failed to create perf buffer: Unknown error -19 (-19)
My machine has 4 cpus online, but 128 possible (e.g /sys/devices/system/cpu/possible contains "0-127")
I guess the problem is that libbpf reads from /sys/devices/system/cpu/possible instead of /sys/devices/system/cpu/online and thus thinks that it needs to attach to 128 cpus instead of just 4.
libbpf/src/libbpf.c
Line 6137 in 9ef191e
The text was updated successfully, but these errors were encountered: