Closed Andreagit97 closed 7 months ago
We support ringbuf but we don't support array/hash of maps yet. We have a PR for it, but it needs to be rebased https://github.com/aya-rs/aya/pull/70
I need this too exactly for the same purpose (a profiler that sends a lot of ringbuf records), so this is close to the top of my todo list, but feel free to take it from me if you want :)
Oh, I see, thank you for the quick feedback! I think i can close this :)
Hi all, I was playing with
aya
library and I faced an error.Context
In Falco we create an
BPF_MAP_TYPE_ARRAY_OF_MAPS
ofBPF_MAP_TYPE_RINGBUF
to send events to userspace since we need to support huge throughputs of events. What we usually do with thelibbpf
C library is:BPF_MAP_TYPE_ARRAY_OF_MAPS
bpf_map__set_inner_map_fd
BPF_MAP_TYPE_RINGBUF
we need and add them intoBPF_MAP_TYPE_ARRAY_OF_MAPS
Issue
I'm not familiar with
aya
APIs so I tried something very simple to check what is supported. First I created a simple C file with the ebpf code:I compiled it:
then i built a very simple loader in Rust to check that everything works:
The initial code was bigger but the issue seems in
Bpf::load_file
. This is the error I faced:Looking around the kernel with
bpftrace
the error seems related to thevalue_size
of the map to be0
.It's the first time that I have used this library so maybe I'm missing something obvious... The same ebpf code I provided here works great with
libbpf
C library, so the issue seems in the loader.