[−][src]Struct libbpf_rs::Program
Represents a loaded Program
.
This struct is not safe to clone because the underlying libbpf resource cannot currently be protected from data races.
If you attempt to attach a Program
with the wrong attach method, the attach_*
method will fail with the appropriate error.
Implementations
impl Program
[src]
pub fn name(&self) -> &str
[src]
pub fn section(&self) -> &str
[src]
Name of the section this Program
belongs to.
pub fn prog_type(&self) -> ProgramType
[src]
pub fn fd(&self) -> i32
[src]
Returns a file descriptor to the underlying program.
pub fn attach_type(&self) -> ProgramAttachType
[src]
pub fn pin<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Pin this program to bpffs.
pub fn unpin<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
[src]
Unpin this program from bpffs
pub fn attach(&mut self) -> Result<Link>
[src]
Auto-attach based on prog section
pub fn attach_cgroup(&mut self, cgroup_fd: i32) -> Result<Link>
[src]
Attach this program to a cgroup.
pub fn attach_perf_event(&mut self, pfd: i32) -> Result<Link>
[src]
Attach this program to a perf event.
pub fn attach_uprobe<T: AsRef<str>>(
&mut self,
retprobe: bool,
pid: i32,
binary_path: T,
func_offset: usize
) -> Result<Link>
[src]
&mut self,
retprobe: bool,
pid: i32,
binary_path: T,
func_offset: usize
) -> Result<Link>
Attach this program to a userspace probe.
pub fn attach_kprobe<T: AsRef<str>>(
&mut self,
retprobe: bool,
func_name: T
) -> Result<Link>
[src]
&mut self,
retprobe: bool,
func_name: T
) -> Result<Link>
Attach this program to a kernel probe.
pub fn attach_tracepoint<T: AsRef<str>>(
&mut self,
tp_category: T,
tp_name: T
) -> Result<Link>
[src]
&mut self,
tp_category: T,
tp_name: T
) -> Result<Link>
Attach this program to a kernel tracepoint.
pub fn attach_raw_tracepoint<T: AsRef<str>>(
&mut self,
tp_name: T
) -> Result<Link>
[src]
&mut self,
tp_name: T
) -> Result<Link>
Attach this program to a raw kernel tracepoint.
pub fn attach_lsm(&mut self) -> Result<Link>
[src]
Attach to an LSM hook
pub fn attach_trace(&mut self) -> Result<Link>
[src]
Attach to a fentry/fexit kernel probe
pub fn attach_sockmap(&self, map_fd: i32) -> Result<()>
[src]
Attach a verdict/parser to a sockmap/sockhash
Auto Trait Implementations
impl RefUnwindSafe for Program
[src]
impl !Send for Program
[src]
impl !Sync for Program
[src]
impl Unpin for Program
[src]
impl UnwindSafe for Program
[src]
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>,