Struct bcc::USDTContext [−][src]
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]
path: P,
pid: pid_t
) -> Result<Self, BccError>
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]
&mut self,
probe: impl Into<String>,
fn_name: impl Into<String>
) -> Result<(), BccError>
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
impl RefUnwindSafe for USDTContext
impl !Send for USDTContext
impl !Sync for USDTContext
impl Unpin for USDTContext
impl UnwindSafe for USDTContext
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>,