Commit Graph

8 Commits (3a7d1bebb45fb8fdb7117592524921285c94595c)

Author SHA1 Message Date
Michal R 3a7d1bebb4 aya-ebpf: Reduce repetition and improve documentation of `maps::hash_map`
* The methods of all structs are almost identical, use a macro to reduce
  code repetition.
* Use the third person in all docstrings..
* Make use of `#[doc]` and split out the most repetetive chunks into
  separate files.
* Make the `Safety` comment for `get*` operations more clear, provide
  context and inks.
2 weeks ago
Michal R 98e8c78376 aya-ebpf: Make use of `Borrow` and `BorrowMut` in map methods
Let callers pass either owned objects or references. We do that already
in the user-space methods.
1 month ago
Tamir Duberstein 5f5305c2a8
lint all crates; enable strict pointer lints 1 month ago
Michal R 3569c9afc3 aya-ebpf: Take `c_void` instead of `bpf_map_def` in map helpers
`bpf_map_def` is a legacy map definition. To be able to introduce BTF
map definitions, make the `lookup` and `remove` helpers work with
`c_void` and let the callers cast the map types to it.
2 months ago
Tamir Duberstein f0a9f19ddc Bump edition to 2024
Change FromRawTracepointArgs::arg to return T rather than *const T which
seems to have been returning a dangling pointer.

Arguably this is not strictly necessary; edition 2024 seems to be
focused on increased strictness around unsafe code which doesn't unlock
new functionality for our users. That said, this work revealed an
apparent bug (see above) that we wouldn't otherwise catch due to
allow-by-default lints.
8 months ago
Tamir Duberstein ea5f7e3015 Reduce the scope of expected warnings
This fixes a few safety comments to avoid the warnings.
8 months ago
Tamir Duberstein 601c89dd23 aya-ebpf: extract insert,remove,lookup
These functions (and more) are duplicated all over the place.
8 months ago
Dave Tucker 41c61560ea chore(aya-ebpf): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
2 years ago