Struct libbpf_rs::Program [−][src]
pub struct Program { /* fields omitted */ }
Expand description
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]
impl Program
[src]pub fn name(&self) -> &str
[src]
pub fn prog_type(&self) -> ProgramType
[src]
pub fn attach_type(&self) -> ProgramAttachType
[src]
pub fn attach_cgroup(&mut self, cgroup_fd: i32) -> Result<Link>
[src]
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]
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<Path>>(
&mut self,
retprobe: bool,
pid: i32,
binary_path: T,
func_offset: usize
) -> Result<Link>
[src]
pub fn attach_uprobe<T: AsRef<Path>>(
&mut self,
retprobe: bool,
pid: i32,
binary_path: T,
func_offset: usize
) -> Result<Link>
[src]Attach this program to a userspace probe.
pub fn attach_kprobe<T: AsRef<str>>(
&mut self,
retprobe: bool,
func_name: T
) -> Result<Link>
[src]
pub fn attach_kprobe<T: AsRef<str>>(
&mut self,
retprobe: bool,
func_name: T
) -> Result<Link>
[src]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]
pub fn attach_tracepoint<T: AsRef<str>>(
&mut self,
tp_category: T,
tp_name: T
) -> Result<Link>
[src]Attach this program to a kernel tracepoint.
pub fn attach_raw_tracepoint<T: AsRef<str>>(
&mut self,
tp_name: T
) -> Result<Link>
[src]
pub fn attach_raw_tracepoint<T: AsRef<str>>(
&mut self,
tp_name: T
) -> Result<Link>
[src]Attach this program to a raw kernel tracepoint.
pub fn attach_lsm(&mut self) -> Result<Link>
[src]
pub fn attach_lsm(&mut self) -> Result<Link>
[src]Attach to an LSM hook
pub fn attach_trace(&mut self) -> Result<Link>
[src]
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]
pub fn attach_sockmap(&self, map_fd: i32) -> Result<()>
[src]Attach a verdict/parser to a sockmap/sockhash