This seems to reveal that the way we generated BPF programs (with
mutable statics) is always going to trip `static_mut_refs`, which is now
deny-by-default. See [static-mut-references].
Change FromRawTracepointArgs::arg to return T rather than *const T which
seems to have been returning a dangling pointer.
[static-mut-references]: https://doc.rust-lang.org/nightly/edition-guide/rust-2024/static-mut-references.html
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>