Before this change, Aya supported only legacy BPF map definitions, which
are instances of the `bpf_map_def` struct and end up in the `maps` ELF
section. This change introduces BTF maps, with custom structs indicating
the metadata of the map, which end up in the `.maps` section.
Legacy maps are not supported by libbpf anymore and not even by the
kernel for newer types of maps like inode/task storage.
Add support of BTF maps in aya-ebpf under the `btf-maps` feature flag.
Usage of this feature requires emitting debug info for the eBPF crate
and passing the `--btf` flag to bpf-linker.
Provide an `arg()` method in `RawTracepointArgs` wrapper of
`bpf_raw_tracepoint_args` and also in `RawTracepointContext`, so
it's directly available in raw tracepoint programs.
The methods and traits implemented here are unsafe. There is no
way to reliably check the number of available arguments, so
requesting a non-existing one leads to undefined behavior.
The const-assert crate doesn't even compile with stable rust, so we
shouldn't depend on it. Instead we replicate its functionality behind
cfg(unstable) which is set at build time based on the toolchain in use.
This API doesn't make sense as the max_entries needs to be set to the
number of online CPUs by the loader.
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>