Struct bcc::USDTContext[][src]

pub struct USDTContext { /* fields omitted */ }

A USDT context.

A context represents a collection of probes – tracepoint to function mappings – for either a given PID and/or a given binary path.

Tracepoints which are already statically defined are mapped to a specific function, such that when the tracepoint is hit, the given function – a function that must be defined in the BPF program – is called, with all of the arguments passed to the tracepoint itself.

Implementations

impl USDTContext[src]

pub fn from_pid(pid: pid_t) -> Result<Self, BccError>[src]

Create a new USDT context from a PID.

pub fn from_binary_path<T: AsRef<Path>>(path: T) -> Result<Self, BccError>[src]

Create a new USDT context from a path to the binary.

pub fn from_binary_path_and_pid<P: AsRef<Path>>(
    path: P,
    pid: pid_t
) -> Result<Self, BccError>
[src]

Create a new USDT context from a path to the binary and a specific PID.

pub fn enable_probe(
    &mut self,
    probe: impl Into<String>,
    fn_name: impl Into<String>
) -> Result<(), BccError>
[src]

Enables a probe, calling a function in the BPF program whenever the tracepoint is hit.

The probe argument is the name of tracepoint to enable. The probe name can either be in the generic form – simply the name of the tracepoint itself – or the prefixed form of <provider>:<name>.

The fn_name argument is the name of the function in the BPF program to call when the given tracepoint is hit. This function will be called with the given arguments for the tracepoint.

Trait Implementations

impl Drop for USDTContext[src]

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.