Aya lets Rust programs load and run eBPF inside the Linux kernel without libbpf, BCC, or a C toolchain.
Overview
Aya is an eBPF library for Rust focused on operability and developer experience. eBPF allows user-supplied programs to run inside the Linux kernel; Aya implements loading and management in Rust, using libc only for syscalls rather than depending on libbpf or bcc.
When the kernel supports BTF, programs can use compile-once-run-everywhere behavior so a binary built against one kernel version may run on others without rebuilding. The library supports function relocation, global data maps, and async integration with tokio and async-std. Release builds are described as fast and free of kernel headers or a C toolchain.
Documentation and guides explain constraints of the eBPF VM, sharing code between user space and kernel programs, and tooling such as aya-tool for kernel type bindings. The project targets observability, security, and custom kernel-side logic written entirely in Rust.
Aya is distributed under MIT or Apache 2.0 at the developer’s choice.
Key features
- Pure Rust, no libbpf dependency
- BTF and CO-RE when available
- Function calls and global maps
- Async tokio and async-std support
- Fast release builds
- No C toolchain required
- Large eBPF API coverage
- Dual MIT and Apache licensing
Use cases
- Rust eBPF observability tools
- Kernel network or cgroup programs
- Security tracing on Linux
- Portable eBPF binaries with musl