pub struct TracePoint { /* private fields */ }
Expand description

A program that can be attached at a pre-defined kernel trace point.

The kernel provides a set of pre-defined trace points that eBPF programs can be attached to. See /sys/kernel/debug/tracing/events for a list of which events can be traced.

Minimum kernel version

The minimum kernel version required to use this feature is 4.7.

Examples

use std::convert::TryInto;
use aya::programs::TracePoint;

let prog: &mut TracePoint = bpf.program_mut("trace_context_switch").unwrap().try_into()?;
prog.load()?;
prog.attach("sched", "sched_switch")?;

Implementations

Loads the program inside the kernel.

Attaches to a given trace point.

For a list of the available event categories and names, see /sys/kernel/debug/tracing/events.

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

Detaches from a trace point.

See TracePoint::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.