|
|
@ -12,7 +12,7 @@ use thiserror::Error;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::{
|
|
|
|
use crate::{
|
|
|
|
generated::bpf_prog_type::BPF_PROG_TYPE_KPROBE,
|
|
|
|
generated::bpf_prog_type::BPF_PROG_TYPE_KPROBE,
|
|
|
|
programs::{load_program, perf_attach, Link, ProgramData, ProgramError},
|
|
|
|
programs::{load_program, perf_attach, LinkRef, ProgramData, ProgramError},
|
|
|
|
sys::perf_event_open_probe,
|
|
|
|
sys::perf_event_open_probe,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -45,7 +45,7 @@ impl KProbe {
|
|
|
|
fn_name: &str,
|
|
|
|
fn_name: &str,
|
|
|
|
offset: u64,
|
|
|
|
offset: u64,
|
|
|
|
pid: Option<pid_t>,
|
|
|
|
pid: Option<pid_t>,
|
|
|
|
) -> Result<impl Link, ProgramError> {
|
|
|
|
) -> Result<LinkRef, ProgramError> {
|
|
|
|
attach(&mut self.data, ProbeKind::KProbe, fn_name, offset, pid)
|
|
|
|
attach(&mut self.data, ProbeKind::KProbe, fn_name, offset, pid)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -65,7 +65,7 @@ impl UProbe {
|
|
|
|
offset: u64,
|
|
|
|
offset: u64,
|
|
|
|
target: T,
|
|
|
|
target: T,
|
|
|
|
pid: Option<pid_t>,
|
|
|
|
pid: Option<pid_t>,
|
|
|
|
) -> Result<impl Link, ProgramError> {
|
|
|
|
) -> Result<LinkRef, ProgramError> {
|
|
|
|
let target = target.as_ref();
|
|
|
|
let target = target.as_ref();
|
|
|
|
let target_str = &*target.as_os_str().to_string_lossy();
|
|
|
|
let target_str = &*target.as_os_str().to_string_lossy();
|
|
|
|
|
|
|
|
|
|
|
@ -128,7 +128,7 @@ fn attach(
|
|
|
|
name: &str,
|
|
|
|
name: &str,
|
|
|
|
offset: u64,
|
|
|
|
offset: u64,
|
|
|
|
pid: Option<pid_t>,
|
|
|
|
pid: Option<pid_t>,
|
|
|
|
) -> Result<impl Link, ProgramError> {
|
|
|
|
) -> Result<LinkRef, ProgramError> {
|
|
|
|
use ProbeKind::*;
|
|
|
|
use ProbeKind::*;
|
|
|
|
|
|
|
|
|
|
|
|
let perf_ty = read_sys_fs_perf_type(match kind {
|
|
|
|
let perf_ty = read_sys_fs_perf_type(match kind {
|
|
|
|