Commit Graph

28 Commits (main)

Author SHA1 Message Date
Zero King 95e1763e30 aya-ebpf: Add set_reply accessor to SockOpsContext 2 weeks ago
Billy McFall b513af12e8 aya: add archs powerpc64 and s390x to aya
bpfman, a project using aya, has a requirement to support powerpc64 and
s390x architectures. Adding these two architectures to aya.

Signed-off-by: Billy McFall <22157057+Billy99@users.noreply.github.com>
3 weeks ago
Tamir Duberstein bce3c4fb1d Appease nightly clippy
```
error: first doc comment paragraph is too long
  --> aya/src/programs/raw_trace_point.rs:12:1
   |
12 | / /// A program that can be attached at a pre-defined kernel trace point, but also
13 | | /// has an access to kernel internal arguments of trace points, which
14 | | /// differentiates them from traditional tracepoint eBPF programs.
15 | | ///
16 | | /// The kernel provides a set of pre-defined trace points that eBPF programs can
   | |_
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph

error: first doc comment paragraph is too long
  --> ebpf/aya-ebpf/src/helpers.rs:1:1
   |
1  | / //! This module contains kernel helper functions that may be exposed to specific BPF
2  | | //! program types. These helpers can be used to perform common tasks, query and operate on
3  | | //! data exposed by the kernel, and perform some operations that would normally be denied
4  | | //! by the BPF verifier.
5  | | //!
6  | | //! Here, we provide some higher-level wrappers around the underlying kernel helpers, but
   | |_
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_long_first_doc_paragraph
```
3 weeks ago
dave-tucker e2177278ae [codegen] Update libbpf to b07dfe3b2a6cb0905e883510f22f9f7c0bb66d0dUpdate libbpf to b07dfe3b2a6cb0905e883510f22f9f7c0bb66d0d
Files changed:
M	ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/armv7/bindings.rs
M	ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/s390x/bindings.rs
M	ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs
1 month ago
Dave Tucker ef0d1253ef fix(ebpf): Remove PerfEventArray::with_max_entries
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>
2 months ago
Wouter Dullaert 7ad3926d99 feat(aya-ebpf): Implement memmove
The compiler will emit this function for certain operations, but aya
currently does not provide an implementation.
This leads to ebpf loading failures as the kernel can't find the symbol when
loading the program.

The implementation is based on https://github.com/rust-lang/compiler-builtins/blob/master/src/mem/mod.rs#L29-L40
and https://github.com/rust-lang/compiler-builtins/blob/master/src/mem/impls.rs#L128-L135
Only the simplest case has been implemented, none of the word optimizations,
since memcpy also doesn't seem to have them.
3 months ago
dave-tucker 8b50a6a573 [codegen] Update libbpf to c1a6c770c46c6e78ad6755bf596c23a4e6f6b216
Update libbpf to c1a6c770c46c6e78ad6755bf596c23a4e6f6b216

Files changed:
M	aya-obj/src/generated/linux_bindings_aarch64.rs
M	aya-obj/src/generated/linux_bindings_armv7.rs
A	aya-obj/src/generated/linux_bindings_powerpc64.rs
M	aya-obj/src/generated/linux_bindings_riscv64.rs
A	aya-obj/src/generated/linux_bindings_s390x.rs
M	aya-obj/src/generated/linux_bindings_x86_64.rs
M	ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs
M	ebpf/aya-ebpf-bindings/src/armv7/bindings.rs
A	ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs
A	ebpf/aya-ebpf-bindings/src/powerpc64/helpers.rs
M	ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs
A	ebpf/aya-ebpf-bindings/src/s390x/bindings.rs
A	ebpf/aya-ebpf-bindings/src/s390x/helpers.rs
M	ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
3 months ago
Tamir Duberstein e4f9ed8d79 Allowlist expected cfgs
See https://doc.rust-lang.org/nightly/cargo/reference/build-scripts.html#rustc-check-cfg.
5 months ago
Tamir Duberstein b603c665a9 Deny warnings 5 months ago
tyrone-wu 2d38b23b99 aya-ebpf/programs: moved ret from ProbeContext into new RetProbeContext
Created retprobe.rs to hold RetProbeContext and moved the ret from
ProbeContext in probe.rs into RetProbeContext. Now, only kprobe (which
uses ProbeContext) can access args, and kretprobe (which uses
RetProbeContext) can access ret.

Fixes: #700
5 months ago
Tamir Duberstein 57cd35172f Appease clippy
```
  warning: casting `u8` to `u64` may become silently lossy if you later change the type
  warning: casting `u16` to `u64` may become silently lossy if you later change the type
  warning: casting `u32` to `u64` may become silently lossy if you later change the type
  warning: casting `i64` to `u64` may lose the sign of the value
  warning: casting `i8` to `i64` may become silently lossy if you later change the type
  warning: casting `i64` to `u64` may lose the sign of the value
  warning: casting `i16` to `i64` may become silently lossy if you later change the type
  warning: casting `i32` to `i64` may become silently lossy if you later change the type
     --> ebpf/aya-ebpf/src/helpers.rs:753:27
      |
  753 |                   PrintkArg(x as $via as u64)
      |                             ^
  ...
  759 | / impl_integer_promotion!(
  760 | |   char:  via u64,
  761 | |   u8:    via u64,
  762 | |   u16:   via u64,
  ...   |
  770 | |   isize: via i64,
  771 | | );
      | |_- in this macro invocation
      |
      = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
      = note: this warning originates in the macro `impl_integer_promotion` (in Nightly builds, run with -Z macro-backtrace for more info)
```

Pass an array of bytes instead of u64 to avoid clippy sign warnings.
5 months ago
Alessandro Decina 843f4a6cc6 Release aya-log-ebpf v0.1.0 5 months ago
Alessandro Decina 2eac95f6d9 Release aya-log-ebpf-macros v0.1.0 5 months ago
Alessandro Decina 1d515fe810 chore: add missing changelogs 5 months ago
Alessandro Decina c3ae6f90d8 Release aya-ebpf v0.1.0 6 months ago
Alessandro Decina eb3947bf14 Release aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Alessandro Decina a34c5e43b8 Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Alessandro Decina a4ae8adb0d chore: add version keys to Cargo.toml(s) 6 months ago
Alessandro Decina b8964d3fd2 Release aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Alessandro Decina c7fe60d47e chore: add changelogs 6 months ago
Alessandro Decina e372fcf653 Release aya-ebpf-cty v0.2.1, aya-ebpf-bindings v0.1.0, aya-ebpf-macros v0.1.0, aya-ebpf v0.1.0 6 months ago
Kevin Ji b06ff40278 xtask: Generate new bindings 6 months ago
Dave Tucker d7af6acb42 chore(aya-ebpf): Rename BpfContext -> EbpfContext
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker ea8073793e chore(aya-ebpf-macros): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 41c61560ea chore(aya-ebpf): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 70ac91dc1e chore(aya-ebpf-bindings): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 21f570a19c chore(aya-ebpf-cty): Rename bpf -> ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago
Dave Tucker 022aff96aa chore: Rename bpf dir to ebpf
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
7 months ago