[−][src]Struct redbpf::UProbe
Type to work with uprobes
or uretprobes
.
Implementations
impl UProbe
[src]
pub fn attach_uprobe(
&mut self,
fn_name: Option<&str>,
offset: u64,
target: &str,
pid: Option<pid_t>
) -> Result<()>
[src]
&mut self,
fn_name: Option<&str>,
offset: u64,
target: &str,
pid: Option<pid_t>
) -> Result<()>
Attach the uprobe
or uretprobe
.
Attach the probe to the function fn_name
defined in the library or
binary at path
. If an offset
is given, the probe will be attached at
that byte offset inside the function. If fn_name
is None
, then
offset
is treated as an absolute address.
If a pid
is passed, only the corresponding process is traced.
Example
use redbpf::Module; let mut module = Module::parse(&std::fs::read("file.elf").unwrap()).unwrap(); for uprobe in module.uprobes_mut() { uprobe.attach_uprobe(Some(&uprobe.name()), 0, "/lib/x86_64-linux-gnu/libc-2.30.so", None).unwrap(); }
pub fn name(&self) -> String
[src]
Auto Trait Implementations
impl RefUnwindSafe for UProbe
impl Send for UProbe
impl Sync for UProbe
impl Unpin for UProbe
impl UnwindSafe for UProbe
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,
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.
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>,