aya: support non-UTF8 probing

Fixes #751.
reviewable/pr765/r1
Tamir Duberstein 2 years ago
parent 8ffd9bb236
commit eccb84a2cf
No known key found for this signature in database

@ -71,8 +71,12 @@ impl KProbe {
/// target function. /// target function.
/// ///
/// The returned value can be used to detach from the given function, see [KProbe::detach]. /// The returned value can be used to detach from the given function, see [KProbe::detach].
pub fn attach(&mut self, fn_name: &str, offset: u64) -> Result<KProbeLinkId, ProgramError> { pub fn attach<T: AsRef<Path>>(
attach(&mut self.data, self.kind, Path::new(fn_name), offset, None) &mut self,
fn_name: T,
offset: u64,
) -> Result<KProbeLinkId, ProgramError> {
attach(&mut self.data, self.kind, fn_name.as_ref(), offset, None)
} }
/// Detaches the program. /// Detaches the program.

@ -2896,7 +2896,7 @@ impl<T> core::convert::From<T> for aya::programs::kprobe::KProbeError
pub fn aya::programs::kprobe::KProbeError::from(t: T) -> T pub fn aya::programs::kprobe::KProbeError::from(t: T) -> T
pub struct aya::programs::kprobe::KProbe pub struct aya::programs::kprobe::KProbe
impl aya::programs::kprobe::KProbe impl aya::programs::kprobe::KProbe
pub fn aya::programs::kprobe::KProbe::attach(&mut self, fn_name: &str, offset: u64) -> core::result::Result<aya::programs::kprobe::KProbeLinkId, aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::attach<T: core::convert::AsRef<std::path::Path>>(&mut self, fn_name: T, offset: u64) -> core::result::Result<aya::programs::kprobe::KProbeLinkId, aya::programs::ProgramError>
pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError>
pub fn aya::programs::kprobe::KProbe::from_pin<P: core::convert::AsRef<std::path::Path>>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result<Self, aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::from_pin<P: core::convert::AsRef<std::path::Path>>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result<Self, aya::programs::ProgramError>
pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind
@ -5997,7 +5997,7 @@ impl<T> core::convert::From<T> for aya::programs::fexit::FExit
pub fn aya::programs::fexit::FExit::from(t: T) -> T pub fn aya::programs::fexit::FExit::from(t: T) -> T
pub struct aya::programs::KProbe pub struct aya::programs::KProbe
impl aya::programs::kprobe::KProbe impl aya::programs::kprobe::KProbe
pub fn aya::programs::kprobe::KProbe::attach(&mut self, fn_name: &str, offset: u64) -> core::result::Result<aya::programs::kprobe::KProbeLinkId, aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::attach<T: core::convert::AsRef<std::path::Path>>(&mut self, fn_name: T, offset: u64) -> core::result::Result<aya::programs::kprobe::KProbeLinkId, aya::programs::ProgramError>
pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::detach(&mut self, link_id: aya::programs::kprobe::KProbeLinkId) -> core::result::Result<(), aya::programs::ProgramError>
pub fn aya::programs::kprobe::KProbe::from_pin<P: core::convert::AsRef<std::path::Path>>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result<Self, aya::programs::ProgramError> pub fn aya::programs::kprobe::KProbe::from_pin<P: core::convert::AsRef<std::path::Path>>(path: P, kind: aya::programs::ProbeKind) -> core::result::Result<Self, aya::programs::ProgramError>
pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind pub fn aya::programs::kprobe::KProbe::kind(&self) -> aya::programs::ProbeKind

Loading…
Cancel
Save