pub struct Btf { /* private fields */ }
Expand description
BPF Type Format metadata.
BTF is a kind of debug metadata that allows eBPF programs compiled against one kernel version to be loaded into different kernel versions.
Aya automatically loads BTF metadata if you use Ebpf::load_file
. You
only need to explicitly use this type if you want to load BTF from a non-standard
location or if you are using Ebpf::load
.
Implementations§
Source§impl Btf
impl Btf
Sourcepub fn add_string(&mut self, name: &str) -> u32
pub fn add_string(&mut self, name: &str) -> u32
Adds a string to BTF metadata, returning an offset
Sourcepub fn add_type(&mut self, btf_type: BtfType) -> u32
pub fn add_type(&mut self, btf_type: BtfType) -> u32
Adds a type to BTF metadata, returning a type id
Sourcepub fn from_sys_fs() -> Result<Btf, BtfError>
pub fn from_sys_fs() -> Result<Btf, BtfError>
Loads BTF metadata from /sys/kernel/btf/vmlinux
.
Sourcepub fn parse_file<P>(path: P, endianness: Endianness) -> Result<Btf, BtfError>
pub fn parse_file<P>(path: P, endianness: Endianness) -> Result<Btf, BtfError>
Loads BTF metadata from the given path
.
Sourcepub fn parse(data: &[u8], endianness: Endianness) -> Result<Btf, BtfError>
pub fn parse(data: &[u8], endianness: Endianness) -> Result<Btf, BtfError>
Parses BTF from binary data of the given endianness
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Btf
impl RefUnwindSafe for Btf
impl Send for Btf
impl Sync for Btf
impl Unpin for Btf
impl UnwindSafe for Btf
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more