Commit Graph

2232 Commits (d1f2e99e6a74737448b0183ac96db819241a0392)
 

Author SHA1 Message Date
Tamir Duberstein d1f2e99e6a
xtask: release mode
Since a7cfc694bd we are unpacking dpkg
archives in native Rust and since ... we are downloading and unpacking
debug archives which are around 10x larger than kernel archives for the
same version. Thus build with optimizations so we spend less time in
archive extraction.
7 days ago
Tamir Duberstein 0484ab5c57
xtask: use `-cpu host` iff host == guest 7 days ago
Tamir Duberstein fd18c3f4ab
.github: shard arm64 virtualized integration
Github arm64 runners don't support nested virtualization and they broke
nested virtualization on macos-15-intel so we must go nuclear.
7 days ago
Tamir Duberstein e2f09ac62f
.github: move comments to Brewfile
This is where the dependencies are.
7 days ago
Tamir Duberstein 7288a2b8da
.github: remove stale comment
GNU tar is not needed since 5f046899b5.
7 days ago
JPaja d8f5497884
feat: add `Ebpf::maps_disjoint_mut`
Implemented using `HashMap::get_disjoint_mut` introduced in Rust 1.86.0.
7 days ago
Tamir Duberstein 65865e8dfc
.github: disable macos-15-intel
These builds are timing out, see
https://github.com/actions/runner-images/issues/13277.
7 days ago
Tamir Duberstein 989a465f0c
xtask: avoid extracting complete archives
Now that we're no longer shelling out to do this, we can avoid most of
the work. Operate directly on the archive, unpacking only what we need.
7 days ago
Tamir Duberstein 2b8cd557aa
xtask: drop build script logging prefix
This code doesn't run under cargo.
1 week ago
Tamir Duberstein 112ab47fcd
Add clippy coverage for doctests 1 week ago
Tamir Duberstein 18c7f7ccd6
perf_event: push down type safety
This makes it more difficult to mishandle callers of `perf_event_open`.

Change `wakeup_events = 0` to 1; per `man 2 perf_event_open`:

  Prior to Linux 3.0, setting wakeup_events to 0 resulted in
  no overflow notifications; more recent kernels treat 0 the
  same as 1.
1 week ago
Tamir Duberstein 7e405c216e
perf_event: simplify PerfEventScope 1 week ago
Tamir Duberstein 866cbe4837
all: bump MSRV to 1.87.0
Use newly stabilized `is_multiple_of`.
1 week ago
Tamir Duberstein 468b9b73db
xtask: use `-cpu host` on x86
We have started to see errors in CI:

  qemu-system-x86_64: warning: host doesn't support requested feature: CPUID[eax=80000001h].ECX.svm [bit 2]

The internet says this is the remedy.
1 week ago
swananan 4fbce44b6a aya: tolerate proc map trailing newline
Proc maps terminate with a newline so split(b'\n') yields an empty
slice at the end. Filter it out before parsing so the absolute-path
fallback for pid-scoped attach doesn't get short-circuited by a
ProcMap::ParseLine error.
2 weeks ago
Tim W 17573e0e47 aya-build: plumb features of ebpf crates
This allows callers to select features of the ebpf crate.
2 weeks ago
Tamir Duberstein 948b8553ee
aya-build: guess `bpf_target_arch` from `HOST`
Remove the use of `CARGO_CFG_TARGET_ARCH` in ebpf crate build scripts,
moving it back only to `aya_build::build_ebpf` where it refers to the
userspace crate's target. In the ebpf crates restore the use of `HOST`
as the default compilation target when neither `--cfg bpf_target_arch`
nor `AYA_BPF_TARGET_ARCH` are provided.
3 weeks ago
Tamir Duberstein fe3f5c4e7d
aya-build: read AYA_BPF_TARGET_ARCH
This allows users to set `bpf_target_arch` from the environment without
touching RUSTFLAGS.
3 weeks ago
Tamir Duberstein 4b0ddfc2b0
aya-build: simplify
Cargo sets `CARGO_CFG_BPF_TARGET_ARCH` so we don't have to inspect
`CARGO_ENCODED_RUSTFLAGS`.
3 weeks ago
Tamir Duberstein 0c7c8097b2
aya-build: clarify naming 3 weeks ago
Tamir Duberstein e2c50ac221
aya-build: use OsString::into_string 3 weeks ago
Tamir Duberstein 4dc4a6ce08
.github: exercise targets for real 3 weeks ago
Alessandro Decina 3a3c451009 aya: restore must_exist argument to set_global
In
03e8487177
we deprecated set_global but accidentally broke its API by deleting the
must_exist argument.
3 weeks ago
Tamir Duberstein 03fea9e304
aya-ebpf: reduce duplication 3 weeks ago
Tamir Duberstein b4bcf52ef1
aya-build: pass bpf_target_arch with cfg
Retire the use of `CARGO_CFG_BPF_TARGET_ARCH` -- using a `cfg` allows
cargo to properly use a cache per cfg, making `./clippy.sh` much faster.

```
Cold: ./clippy.sh --target x86_64-unknown-linux-gnu -p aya-build  75.38s user 137.28s system 211% cpu 1:40.43 total
Warm: ./clippy.sh --target x86_64-unknown-linux-gnu -p aya-build   4.46s user   3.41s system  71% cpu   11.01 total
```
3 weeks ago
Tamir Duberstein d73c65caae
Add some type ascription 3 weeks ago
Tamir Duberstein 17c7c7951c
lints: enable clippy::as_underscore 3 weeks ago
Tamir Duberstein 778b447e3b
lints: enable unsafe_op_in_unsafe_fn 3 weeks ago
Tamir Duberstein d9704be77d
aya-build: remove cargo_metadata from public API 3 weeks ago
Tamir Duberstein a18e283e2a
clippy: lint all bpf target archs 3 weeks ago
Tamir Duberstein f610453ec2
ebpf: extract CARGO_CFG_BPF_TARGET_ARCH logic 3 weeks ago
Tamir Duberstein e5eb3058aa
.github: save CI time
These jobs take 18 seconds of machine time and 21 seconds of setup;
consolidate them into one job to cut down on the overhead.
3 weeks ago
Tamir Duberstein 05250da20b
aya-ebpf: reduce repetition and excessive traits
The traits `FromBtfArgument`, `FromRawTracepointArgs`, `FromPtRegs` are
all fancy ways of saying `Argument` - so replace these traits with it.

This also removes the use of `bpf_probe_read` which was introduced in
05c1586202 because I can't reproduce the
need for it.
3 weeks ago
Godones 4b4b9f83bd
enable bpf_target_arch = loongarch64
Signed-off-by: Godones <chenlinfeng25@outlook.com>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
3 weeks ago
Tamir Duberstein 9e577f60b5
integration-test: remove `netns-rs`
This crate uses a very old version of `nix` which is preventing us from
adding support for loongarch64.

Make panic-in-panic more uniform while I'm here.
3 weeks ago
Tamir Duberstein 12d963ddfd
brewfile: remove dpkg
This is unused since a7cfc694bd.
3 weeks ago
Michal R a7cfc694bd xtask: Allow to run VM integration tests without dpkg
Debian packages are just nested archives, where the outer one is ar
and the inner one is lzma2 tarball. Use Rust crates to unpack them.

Co-authored-by: Tamir Duberstein <tamird@gmail.com>
4 weeks ago
Andrew Werner 03e8487177 aya: rename `set_` methods on `EbpfLoader`
This loader is more of a builder, so these `set_` methods didn't
quite fit. See [this discussion][1] for the motivation.

[1]: https://reviewable.io/reviews/aya-rs/aya/1318#gh-2384180366
4 weeks ago
Andrew Werner 17171647f7 aya/maps/ring_buf: fix producer position initialization
The RingBuf caches the last value it read of the producer so it doesn't
need to constantly contend on the actual producer cache line if lots of
messages have yet to be consumed. It was bogus to initialize this cache
at 0. This patch initializes it properly and adds testing.

Fixes: #1309
4 weeks ago
Andrew Werner 5802dc7a23 aya: allow specifying a pin path for a named map
This commit extends the EbpfLoader with set_map_pin_path that allows the
caller to associate a named map with a pin path.

One note is that this path is an absolute path, not relative to
`map_pin_path`, and it forces the map to be loaded from that path.
4 weeks ago
Andrew Werner 1c924bb421 aya: rename map_pin_path to default_map_pin_path
This is the path in which pinned maps are created or resolved. It
isn't actually the path for any specific map itself. This rename
makes way for a method `set_map_pin_path` that actually specifies
the pin path for a specific map.
4 weeks ago
Tamir Duberstein 0144c0eb22
integration-test: defer cleanup to ensure unpin 1 month ago
Tamir Duberstein e3f69829de
.github: run old kernels first 1 month ago
Tamir Duberstein c7d4cd3943
ci: test against 5.10
This is the earliest LTS that still exists on debian mirrors.
1 month ago
Tamir Duberstein 907920a629
Skip `cpumap_chain` when attachment fails 1 month ago
Tamir Duberstein 54bd3ac202
Skip `lsm_cgroup` when loading fails
squash into proper check
1 month ago
Tamir Duberstein 2e5f5efbf1
aya: make ProgramInfo a proper enum
This allows us to distinguish between LSM and LSM_CGROUP programs and do
the proper capability check in is_program_supported.
1 month ago
Tamir Duberstein 3d0b53111f
integration-test: remove skips 1 month ago
Tamir Duberstein 8e9404ecd4
aya-obj: apply enum64-to-union fixup in reloc
This code is just awful.
1 month ago
Tamir Duberstein 7224efcad8
aya-obj: patch up 0-size datasec
Use OnceCell for ENUM64 while I'm here as well.
1 month ago