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
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 of BPF_MAP_TYPE_RINGBUF to send events to userspace since we need to support huge throughputs of events. What we usually do with the libbpf C library is:
create the BPF_MAP_TYPE_ARRAY_OF_MAPS
set an inner map inside it before the loading phase, using the libbpf API bpf_map__set_inner_map_fd
create all the BPF_MAP_TYPE_RINGBUF we need and add them into BPF_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:
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.
The text was updated successfully, but these errors were encountered:
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 #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 :)
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
.sudo bpftrace -e 'fexit:fd_array_map_alloc_check /comm == "aya_example" / { printf("ret value: %ld, attr_value: %d\n", retval, args->attr->value_size); }' ret value: -22, attr_value: 0
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.The text was updated successfully, but these errors were encountered: