Open MatteoNardi opened 2 years ago
In order to take full advantage of BTF/CORE and support a large variety of systems with the same static build, it is useful for the eBPF program to know the kernel version.
libbpf exports this information alongside the host system Kconfig variables. https://nakryiko.com/posts/bpf-core-reference-guide/#linux-kernel-version
It would be useful to have the same feature in aya.
For context, we're currently using aya only for the userspace and sticking to C for the eBPF program.
One can use a workaround using loader's set_global function such as:
set_global
BpfLoader::new().set_global("LINUX_KERNEL_VERSION", version).load(...)
In order to take full advantage of BTF/CORE and support a large variety of systems with the same static build, it is useful for the eBPF program to know the kernel version.
libbpf exports this information alongside the host system Kconfig variables. https://nakryiko.com/posts/bpf-core-reference-guide/#linux-kernel-version
It would be useful to have the same feature in aya.
For context, we're currently using aya only for the userspace and sticking to C for the eBPF program.