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.
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>
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
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.
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.
Add guardrails for when setting event type and config for perf_event
programs. The `PerfEventConfig` enum now defines the event `type` and
`config` of interest.
Remove public re-exports, and add idiomatic Rust types for:
- perf_hw_id => HardwareEvent
- perf_sw_ids => SoftwareEvent
- perf_hw_cache_id => HwCacheEvent
- perf_hw_cache_op_id => HwCacheOp
- perf_hw_cache_op_result_id => HwCacheResult
The motivation behind this is mainly for the `type` and `config` fields
of `bpf_link_info.perf_event.event`. The newly added enums are planned
to also be used in the `bpf_link_info` metadata.
Although `Breakpoint`/`PERF_TYPE_BREAKPOINT` variant exists, it is not
fully implemented. It's only usage at the moment is in link info.
`git submodule update` fails when running in a codex sandbox:
```
error: could not lock config file /Users/tamird/src/aya/.git/modules/libbpf/config: Operation not permitted
```
so just avoid it when not necessary.
When preparing the VM initramfs detect the `config-*` file that ships alongside
the vmlinuz/modules in each kernel archive and install it under `/boot` (both
as `/boot/config` and `/boot/config-<version>`). This makes the running
kernel’s configuration available inside the guest for the integration tests.
Bundle handling of Debian kernel archives into xtask so callers can pipe
the raw `.deb` paths straight into `cargo xtask integration-test vm …`.
The driver now extracts each archive into `<cache>/kernel-archives`,
locates the matching `vmlinuz-*`, `lib/modules/*`, and config files, and
feeds those into the initramfs build without requiring the user to
pre-run dpkg/tar. With this in place we drop
`.github/scripts/find_kernels.py`, simplify AGENTS.md/CI instructions to
use `find test/.tmp -name '*.deb'`, remove the gnu-tar requirement we no
longer need, and add `tar` as a workspace dependency for the extractor.