pub struct FExit { /* private fields */ }
Expand description
A program that can be attached to the exit point of (almost) anny kernel function.
FExit
programs are similar to kretprobes,
but the difference is that fexit has practically zero overhead to call
before kernel function. Fexit programs can be also attached to other eBPF
programs.
Minimum kernel version
The minimum kernel version required to use this feature is 5.5.
Examples
use aya::{Bpf, programs::FExit, BtfError, Btf};
use std::convert::TryInto;
let btf = Btf::from_sys_fs()?;
let program: &mut FExit = bpf.program_mut("filename_lookup").unwrap().try_into()?;
program.load("filename_lookup", &btf)?;
program.attach()?;
Implementations
sourceimpl FExit
impl FExit
sourcepub fn load(&mut self, fn_name: &str, btf: &Btf) -> Result<(), ProgramError>
pub fn load(&mut self, fn_name: &str, btf: &Btf) -> Result<(), ProgramError>
Loads the program inside the kernel.
See also Program::load
.
Loads the program so it’s executed when the kernel function fn_name
is exited. The btf
argument must contain the BTF info for the running
kernel.
sourcepub fn attach(&mut self) -> Result<LinkRef, ProgramError>
pub fn attach(&mut self) -> Result<LinkRef, ProgramError>
Attaches the program
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for FExit
impl !Send for FExit
impl !Sync for FExit
impl Unpin for FExit
impl !UnwindSafe for FExit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more