Struct bcc::BPFBuilder[][src]

pub struct BPFBuilder { /* fields omitted */ }

A builder struct which allows one to initialize a BPF module with additional options.

Implementations

impl BPFBuilder[src]

pub fn new(code: &str) -> Result<Self, BccError>[src]

Create a new builder with the given code

pub fn cflags<T: AsRef<str>>(self, cflags: &[T]) -> Result<Self, BccError>[src]

Set CFLAGS to be used

pub fn device<T: AsRef<str>>(self, device: T) -> Result<Self, BccError>[src]

Set the device to load the BPF program on, if applicable. For example a network device if running XDP in hardware mode.

pub fn debug(self, debug: BccDebug) -> Self[src]

Set BCC’s debug level

pub fn attach_usdt_ignore_pid(self, ignore: bool) -> Result<Self, BccError>[src]

Sets whether or not to ignore the specified PID in a given USDT context when attaching this BPF program.

If set to true, then any running process that matched the USDT probes would be captured, regardless of whether or not a specific PID was used to create the USDT context. This can be useful in some cases where a user might want to specify the PID of a parent process as the target, but also hit the same tracepoints in the child processes they spawn i.e. daemon worker strategies based on fork(2).

Defaults to false.

pub fn add_usdt_context(self, context: USDTContext) -> Result<Self, BccError>[src]

Adds a USDT context to this program.

pub fn build(self) -> Result<BPF, BccError>[src]

Try constructing a BPF module from the builder

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.