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

Loads the program inside the kernel.

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.

Attaches the program.

The returned value can be used to detach, see FExit::detach.

Detaches the program.

See FExit::attach.

Takes ownership of the link referenced by the provided link_id.

The link will be detached on Drop and the caller is now responsible for managing its lifetime.

Unloads the program from the kernel.

Links will be detached before unloading the program. Note that owned links obtained using take_link() will not be detached.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the RawFd of the program if it has been loaded, or None

Returns the RawFd of the program if it has been loaded, or None

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.