Struct bcc::BPFBuilder [−][src]
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
impl RefUnwindSafe for BPFBuilder
impl !Send for BPFBuilder
impl !Sync for BPFBuilder
impl Unpin for BPFBuilder
impl UnwindSafe for BPFBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,