From 8051b83ba28b6a02219a15e47792d62136d0c0d8 Mon Sep 17 00:00:00 2001 From: Dave Tucker Date: Thu, 6 Mar 2025 17:01:18 +0000 Subject: [PATCH] feat: Allow conversions to Program from ProgramInfo Allow for a ProgramInfo to be converted into one of the program types that we support. This allows for a user of Aya access to reattach, pin or unload a program that was either, previously loaded, or was loaded by another process. Signed-off-by: Dave Tucker --- aya/src/bpf.rs | 6 +- aya/src/programs/cgroup_device.rs | 5 +- aya/src/programs/cgroup_skb.rs | 21 +-- aya/src/programs/cgroup_sock.rs | 5 +- aya/src/programs/cgroup_sock_addr.rs | 5 +- aya/src/programs/cgroup_sockopt.rs | 5 +- aya/src/programs/cgroup_sysctl.rs | 5 +- aya/src/programs/extension.rs | 6 +- aya/src/programs/fentry.rs | 5 +- aya/src/programs/fexit.rs | 5 +- aya/src/programs/iter.rs | 5 +- aya/src/programs/kprobe.rs | 6 +- aya/src/programs/lirc_mode2.rs | 7 +- aya/src/programs/lsm.rs | 5 +- aya/src/programs/mod.rs | 166 +++++++++++++++++++----- aya/src/programs/perf_event.rs | 5 +- aya/src/programs/raw_trace_point.rs | 5 +- aya/src/programs/sk_lookup.rs | 7 +- aya/src/programs/sk_msg.rs | 5 +- aya/src/programs/sk_skb.rs | 5 +- aya/src/programs/sock_ops.rs | 5 +- aya/src/programs/socket_filter.rs | 5 +- aya/src/programs/tc.rs | 7 +- aya/src/programs/tp_btf.rs | 5 +- aya/src/programs/trace_point.rs | 6 +- aya/src/programs/uprobe.rs | 6 +- aya/src/programs/xdp.rs | 7 +- test/integration-test/src/tests/info.rs | 27 +++- xtask/public-api/aya.txt | 88 +++++++++++++ 29 files changed, 365 insertions(+), 75 deletions(-) diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs index 4bd590bb..790e637f 100644 --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -609,15 +609,15 @@ impl<'a> EbpfLoader<'a> { } ProgramSection::CgroupSkb => Program::CgroupSkb(CgroupSkb { data: ProgramData::new(prog_name, obj, btf_fd, *verifier_log_level), - expected_attach_type: None, + attach_type: None, }), ProgramSection::CgroupSkbIngress => Program::CgroupSkb(CgroupSkb { data: ProgramData::new(prog_name, obj, btf_fd, *verifier_log_level), - expected_attach_type: Some(CgroupSkbAttachType::Ingress), + attach_type: Some(CgroupSkbAttachType::Ingress), }), ProgramSection::CgroupSkbEgress => Program::CgroupSkb(CgroupSkb { data: ProgramData::new(prog_name, obj, btf_fd, *verifier_log_level), - expected_attach_type: Some(CgroupSkbAttachType::Egress), + attach_type: Some(CgroupSkbAttachType::Egress), }), ProgramSection::CgroupSockAddr { attach_type, .. } => { Program::CgroupSockAddr(CgroupSockAddr { diff --git a/aya/src/programs/cgroup_device.rs b/aya/src/programs/cgroup_device.rs index d2b12946..666fdc26 100644 --- a/aya/src/programs/cgroup_device.rs +++ b/aya/src/programs/cgroup_device.rs @@ -9,7 +9,7 @@ use aya_obj::generated::{ use crate::{ programs::{ CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, ProgramFd, - bpf_prog_get_fd_by_id, define_link_wrapper, id_as_key, load_program, query, + ProgramType, bpf_prog_get_fd_by_id, define_link_wrapper, id_as_key, load_program, query, }, sys::{LinkTarget, ProgQueryTarget, SyscallError, bpf_link_create}, util::KernelVersion, @@ -56,6 +56,9 @@ pub struct CgroupDevice { } impl CgroupDevice { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::CgroupDevice; + /// Loads the program inside the kernel pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_CGROUP_DEVICE, &mut self.data) diff --git a/aya/src/programs/cgroup_skb.rs b/aya/src/programs/cgroup_skb.rs index 26f5490d..7ce1b681 100644 --- a/aya/src/programs/cgroup_skb.rs +++ b/aya/src/programs/cgroup_skb.rs @@ -10,7 +10,7 @@ use aya_obj::generated::{ use crate::{ VerifierLogLevel, programs::{ - CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, + CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, ProgramType, define_link_wrapper, id_as_key, load_program, }, sys::{LinkTarget, SyscallError, bpf_link_create}, @@ -57,18 +57,19 @@ use crate::{ #[doc(alias = "BPF_PROG_TYPE_CGROUP_SKB")] pub struct CgroupSkb { pub(crate) data: ProgramData, - pub(crate) expected_attach_type: Option, + pub(crate) attach_type: Option, } impl CgroupSkb { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::CgroupSkb; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { - self.data.expected_attach_type = - self.expected_attach_type - .map(|attach_type| match attach_type { - CgroupSkbAttachType::Ingress => BPF_CGROUP_INET_INGRESS, - CgroupSkbAttachType::Egress => BPF_CGROUP_INET_EGRESS, - }); + self.data.expected_attach_type = self.attach_type.map(|attach_type| match attach_type { + CgroupSkbAttachType::Ingress => BPF_CGROUP_INET_INGRESS, + CgroupSkbAttachType::Egress => BPF_CGROUP_INET_EGRESS, + }); load_program(BPF_PROG_TYPE_CGROUP_SKB, &mut self.data) } @@ -79,7 +80,7 @@ impl CgroupSkb { /// method returns `None` for programs defined with the generic section /// `cgroup/skb`. pub fn expected_attach_type(&self) -> &Option { - &self.expected_attach_type + &self.attach_type } /// Attaches the program to the given cgroup. @@ -138,7 +139,7 @@ impl CgroupSkb { let data = ProgramData::from_pinned_path(path, VerifierLogLevel::default())?; Ok(Self { data, - expected_attach_type: Some(expected_attach_type), + attach_type: Some(expected_attach_type), }) } } diff --git a/aya/src/programs/cgroup_sock.rs b/aya/src/programs/cgroup_sock.rs index fad1ac76..df2d03ba 100644 --- a/aya/src/programs/cgroup_sock.rs +++ b/aya/src/programs/cgroup_sock.rs @@ -8,7 +8,7 @@ pub use aya_obj::programs::CgroupSockAttachType; use crate::{ VerifierLogLevel, programs::{ - CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, + CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, ProgramType, define_link_wrapper, id_as_key, load_program, }, sys::{LinkTarget, SyscallError, bpf_link_create}, @@ -58,6 +58,9 @@ pub struct CgroupSock { } impl CgroupSock { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::CgroupSock; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { self.data.expected_attach_type = Some(self.attach_type.into()); diff --git a/aya/src/programs/cgroup_sock_addr.rs b/aya/src/programs/cgroup_sock_addr.rs index 61da9a31..1dbb7074 100644 --- a/aya/src/programs/cgroup_sock_addr.rs +++ b/aya/src/programs/cgroup_sock_addr.rs @@ -8,7 +8,7 @@ pub use aya_obj::programs::CgroupSockAddrAttachType; use crate::{ VerifierLogLevel, programs::{ - CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, + CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, ProgramType, define_link_wrapper, id_as_key, load_program, }, sys::{LinkTarget, SyscallError, bpf_link_create}, @@ -59,6 +59,9 @@ pub struct CgroupSockAddr { } impl CgroupSockAddr { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::CgroupSockAddr; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { self.data.expected_attach_type = Some(self.attach_type.into()); diff --git a/aya/src/programs/cgroup_sockopt.rs b/aya/src/programs/cgroup_sockopt.rs index 67515d06..b93fdf65 100644 --- a/aya/src/programs/cgroup_sockopt.rs +++ b/aya/src/programs/cgroup_sockopt.rs @@ -8,7 +8,7 @@ pub use aya_obj::programs::CgroupSockoptAttachType; use crate::{ VerifierLogLevel, programs::{ - CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, + CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, ProgramType, define_link_wrapper, id_as_key, load_program, }, sys::{LinkTarget, SyscallError, bpf_link_create}, @@ -56,6 +56,9 @@ pub struct CgroupSockopt { } impl CgroupSockopt { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::CgroupSockopt; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { self.data.expected_attach_type = Some(self.attach_type.into()); diff --git a/aya/src/programs/cgroup_sysctl.rs b/aya/src/programs/cgroup_sysctl.rs index 503bcf9d..5f6e8bc9 100644 --- a/aya/src/programs/cgroup_sysctl.rs +++ b/aya/src/programs/cgroup_sysctl.rs @@ -8,7 +8,7 @@ use aya_obj::generated::{ use crate::{ programs::{ - CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, + CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, ProgramType, define_link_wrapper, id_as_key, load_program, }, sys::{LinkTarget, SyscallError, bpf_link_create}, @@ -55,6 +55,9 @@ pub struct CgroupSysctl { } impl CgroupSysctl { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::CgroupSysctl; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_CGROUP_SYSCTL, &mut self.data) diff --git a/aya/src/programs/extension.rs b/aya/src/programs/extension.rs index 0033206f..ada87f6c 100644 --- a/aya/src/programs/extension.rs +++ b/aya/src/programs/extension.rs @@ -12,7 +12,8 @@ use thiserror::Error; use crate::{ Btf, programs::{ - FdLink, FdLinkId, ProgramData, ProgramError, ProgramFd, define_link_wrapper, load_program, + FdLink, FdLinkId, ProgramData, ProgramError, ProgramFd, ProgramType, define_link_wrapper, + load_program, }, sys::{self, BpfLinkCreateArgs, LinkTarget, SyscallError, bpf_link_create}, }; @@ -58,6 +59,9 @@ pub struct Extension { } impl Extension { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::Extension; + /// Loads the extension inside the kernel. /// /// Prepares the code included in the extension to replace the code of the function diff --git a/aya/src/programs/fentry.rs b/aya/src/programs/fentry.rs index 8f550f7a..437f630b 100644 --- a/aya/src/programs/fentry.rs +++ b/aya/src/programs/fentry.rs @@ -6,7 +6,7 @@ use aya_obj::{ }; use crate::programs::{ - FdLink, FdLinkId, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, FdLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, utils::attach_raw_tracepoint, }; @@ -51,6 +51,9 @@ pub struct FEntry { } impl FEntry { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::Tracing; + /// Loads the program inside the kernel. /// /// Loads the program so it's executed when the kernel function `fn_name` diff --git a/aya/src/programs/fexit.rs b/aya/src/programs/fexit.rs index 3b70c7ec..9a8ced2a 100644 --- a/aya/src/programs/fexit.rs +++ b/aya/src/programs/fexit.rs @@ -6,7 +6,7 @@ use aya_obj::{ }; use crate::programs::{ - FdLink, FdLinkId, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, FdLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, utils::attach_raw_tracepoint, }; @@ -51,6 +51,9 @@ pub struct FExit { } impl FExit { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::Tracing; + /// Loads the program inside the kernel. /// /// Loads the program so it's executed when the kernel function `fn_name` diff --git a/aya/src/programs/iter.rs b/aya/src/programs/iter.rs index 564115da..62ecd610 100644 --- a/aya/src/programs/iter.rs +++ b/aya/src/programs/iter.rs @@ -14,7 +14,7 @@ use aya_obj::{ use crate::{ programs::{ - FdLink, LinkError, PerfLinkIdInner, PerfLinkInner, ProgramData, ProgramError, + FdLink, LinkError, PerfLinkIdInner, PerfLinkInner, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, }, sys::{LinkTarget, SyscallError, bpf_create_iter, bpf_link_create, bpf_link_get_info_by_fd}, @@ -60,6 +60,9 @@ pub struct Iter { } impl Iter { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::Tracing; + /// Loads the program inside the kernel. pub fn load(&mut self, iter_type: &str, btf: &Btf) -> Result<(), ProgramError> { self.data.expected_attach_type = Some(BPF_TRACE_ITER); diff --git a/aya/src/programs/kprobe.rs b/aya/src/programs/kprobe.rs index 95ef6a24..8a02ab13 100644 --- a/aya/src/programs/kprobe.rs +++ b/aya/src/programs/kprobe.rs @@ -12,7 +12,8 @@ use thiserror::Error; use crate::{ VerifierLogLevel, programs::{ - FdLink, LinkError, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, LinkError, ProgramData, ProgramError, ProgramType, define_link_wrapper, + load_program, perf_attach::{PerfLinkIdInner, PerfLinkInner}, probe::{ProbeKind, attach}, }, @@ -50,6 +51,9 @@ pub struct KProbe { } impl KProbe { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::KProbe; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_KPROBE, &mut self.data) diff --git a/aya/src/programs/lirc_mode2.rs b/aya/src/programs/lirc_mode2.rs index 9bd9a11f..31b77db4 100644 --- a/aya/src/programs/lirc_mode2.rs +++ b/aya/src/programs/lirc_mode2.rs @@ -7,8 +7,8 @@ use aya_obj::generated::{ use crate::{ programs::{ - CgroupAttachMode, Link, ProgramData, ProgramError, ProgramFd, ProgramInfo, id_as_key, - load_program, query, + CgroupAttachMode, Link, ProgramData, ProgramError, ProgramFd, ProgramInfo, ProgramType, + id_as_key, load_program, query, }, sys::{ProgQueryTarget, bpf_prog_attach, bpf_prog_detach, bpf_prog_get_fd_by_id}, }; @@ -56,6 +56,9 @@ pub struct LircMode2 { } impl LircMode2 { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::LircMode2; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_LIRC_MODE2, &mut self.data) diff --git a/aya/src/programs/lsm.rs b/aya/src/programs/lsm.rs index ae6912ca..afa53ccc 100644 --- a/aya/src/programs/lsm.rs +++ b/aya/src/programs/lsm.rs @@ -6,7 +6,7 @@ use aya_obj::{ }; use crate::programs::{ - FdLink, FdLinkId, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, FdLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, utils::attach_raw_tracepoint, }; @@ -54,6 +54,9 @@ pub struct Lsm { } impl Lsm { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::Lsm; + /// Loads the program inside the kernel. /// /// # Arguments diff --git a/aya/src/programs/mod.rs b/aya/src/programs/mod.rs index 013d91bc..62536bf9 100644 --- a/aya/src/programs/mod.rs +++ b/aya/src/programs/mod.rs @@ -83,6 +83,7 @@ use aya_obj::{ VerifierLog, btf::BtfError, generated::{bpf_attach_type, bpf_link_info, bpf_prog_info, bpf_prog_type}, + programs::XdpAttachType, }; use info::impl_info; pub use info::{ProgramInfo, ProgramType, loaded_programs}; @@ -327,38 +328,31 @@ impl Program { /// Returns the program type. pub fn prog_type(&self) -> ProgramType { match self { - Self::KProbe(_) | Self::UProbe(_) => ProgramType::KProbe, - Self::TracePoint(_) => ProgramType::TracePoint, - Self::SocketFilter(_) => ProgramType::SocketFilter, - Self::Xdp(_) => ProgramType::Xdp, - Self::SkMsg(_) => ProgramType::SkMsg, - Self::SkSkb(_) => ProgramType::SkSkb, - Self::SockOps(_) => ProgramType::SockOps, - Self::SchedClassifier(_) => ProgramType::SchedClassifier, - Self::CgroupSkb(_) => ProgramType::CgroupSkb, - Self::CgroupSysctl(_) => ProgramType::CgroupSysctl, - Self::CgroupSockopt(_) => ProgramType::CgroupSockopt, - Self::LircMode2(_) => ProgramType::LircMode2, - Self::PerfEvent(_) => ProgramType::PerfEvent, - Self::RawTracePoint(_) => ProgramType::RawTracePoint, - Self::Lsm(_) => ProgramType::Lsm, - // The following program types are a subset of `TRACING` programs: - // - // - `BPF_TRACE_RAW_TP` (`BtfTracePoint`) - // - `BTF_TRACE_FENTRY` (`FEntry`) - // - `BPF_MODIFY_RETURN` (not supported yet in Aya) - // - `BPF_TRACE_FEXIT` (`FExit`) - // - `BPF_TRACE_ITER` (`Iter`) - // - // https://github.com/torvalds/linux/blob/v6.12/kernel/bpf/syscall.c#L3935-L3940 - Self::BtfTracePoint(_) | Self::FEntry(_) | Self::FExit(_) | Self::Iter(_) => { - ProgramType::Tracing - } - Self::Extension(_) => ProgramType::Extension, - Self::CgroupSockAddr(_) => ProgramType::CgroupSockAddr, - Self::SkLookup(_) => ProgramType::SkLookup, - Self::CgroupSock(_) => ProgramType::CgroupSock, - Self::CgroupDevice(_) => ProgramType::CgroupDevice, + Self::KProbe(_) => KProbe::PROGRAM_TYPE, + Self::UProbe(_) => UProbe::PROGRAM_TYPE, + Self::TracePoint(_) => TracePoint::PROGRAM_TYPE, + Self::SocketFilter(_) => SocketFilter::PROGRAM_TYPE, + Self::Xdp(_) => Xdp::PROGRAM_TYPE, + Self::SkMsg(_) => SkMsg::PROGRAM_TYPE, + Self::SkSkb(_) => SkSkb::PROGRAM_TYPE, + Self::SockOps(_) => SockOps::PROGRAM_TYPE, + Self::SchedClassifier(_) => SchedClassifier::PROGRAM_TYPE, + Self::CgroupSkb(_) => CgroupSkb::PROGRAM_TYPE, + Self::CgroupSysctl(_) => CgroupSysctl::PROGRAM_TYPE, + Self::CgroupSockopt(_) => CgroupSockopt::PROGRAM_TYPE, + Self::LircMode2(_) => LircMode2::PROGRAM_TYPE, + Self::PerfEvent(_) => PerfEvent::PROGRAM_TYPE, + Self::RawTracePoint(_) => RawTracePoint::PROGRAM_TYPE, + Self::Lsm(_) => Lsm::PROGRAM_TYPE, + Self::BtfTracePoint(_) => BtfTracePoint::PROGRAM_TYPE, + Self::FEntry(_) => FEntry::PROGRAM_TYPE, + Self::FExit(_) => FExit::PROGRAM_TYPE, + Self::Extension(_) => Extension::PROGRAM_TYPE, + Self::CgroupSockAddr(_) => CgroupSockAddr::PROGRAM_TYPE, + Self::SkLookup(_) => SkLookup::PROGRAM_TYPE, + Self::CgroupSock(_) => CgroupSock::PROGRAM_TYPE, + Self::CgroupDevice(_) => CgroupDevice::PROGRAM_TYPE, + Self::Iter(_) => Iter::PROGRAM_TYPE, } } @@ -991,6 +985,114 @@ impl_from_pin!( Iter, ); +macro_rules! impl_from_prog_info { + ( + $(#[$doc:meta])* + @safety + [$($safety:tt)?] + @rest + $struct_name:ident $($var:ident : $var_ty:ty)? + ) => { + impl $struct_name { + /// Constructs an instance of a [`Self`] from a [`ProgramInfo`]. + /// + /// This allows the caller to get a handle to an already loaded + /// program from the kernel without having to load it again. + /// + /// # Errors + /// + /// - If the program type reported by the kernel does not match + /// [`Self::PROGRAM_TYPE`]. + /// - If the file descriptor of the program cannot be cloned. + $(#[$doc])* + pub $($safety)? + fn from_program_info( + info: ProgramInfo, + name: Cow<'static, str>, + $($var: $var_ty,)? + ) -> Result { + if info.program_type()? != Self::PROGRAM_TYPE { + return Err(ProgramError::UnexpectedProgramType {}); + } + let ProgramInfo(bpf_progam_info) = info; + let fd = info.fd()?; + let fd = fd.as_fd().try_clone_to_owned()?; + + Ok(Self { + data: ProgramData::from_bpf_prog_info( + Some(name), + crate::MockableFd::from_fd(fd), + Path::new(""), + bpf_progam_info, + VerifierLogLevel::default(), + )?, + $($var,)? + }) + } + } + }; + + // Handle unsafe cases and pass a safety doc section + ( + unsafe $struct_name:ident $($var:ident : $var_ty:ty)? $(, $($rest:tt)*)? + ) => { + impl_from_prog_info! { + /// + /// # Safety + /// + /// The runtime type of this program, as used by the kernel, is + /// overloaded. We assert the program type matches the runtime type + /// but we're unable to perform further checks. Therefore, the caller + /// must ensure that the program type is correct or the behavior is + /// undefined. + @safety [unsafe] + @rest $struct_name $($var : $var_ty)? + } + $( impl_from_prog_info!($($rest)*); )? + }; + + // Handle non-unsafe cases and omit safety doc section + ( + $struct_name:ident $($var:ident : $var_ty:ty)? $(, $($rest:tt)*)? + ) => { + impl_from_prog_info! { + @safety [] + @rest $struct_name $($var : $var_ty)? + } + $( impl_from_prog_info!($($rest)*); )? + }; + + // Handle trailing comma + ( + $(,)? + ) => {}; +} + +impl_from_prog_info!( + unsafe KProbe kind : ProbeKind, + unsafe UProbe kind : ProbeKind, + TracePoint, + Xdp attach_type : XdpAttachType, + SkMsg, + SkSkb kind : SkSkbKind, + SockOps, + SchedClassifier, + CgroupSkb attach_type : Option, + CgroupSysctl, + CgroupSockopt attach_type : CgroupSockoptAttachType, + LircMode2, + PerfEvent, + Lsm, + RawTracePoint, + unsafe BtfTracePoint, + unsafe FEntry, + unsafe FExit, + Extension, + SkLookup, + CgroupDevice, + Iter, +); + macro_rules! impl_try_from_program { ($($ty:ident),+ $(,)?) => { $( diff --git a/aya/src/programs/perf_event.rs b/aya/src/programs/perf_event.rs index b8bda2e8..6ff70229 100644 --- a/aya/src/programs/perf_event.rs +++ b/aya/src/programs/perf_event.rs @@ -16,7 +16,7 @@ pub use aya_obj::generated::{ use crate::{ programs::{ - FdLink, LinkError, ProgramData, ProgramError, + FdLink, LinkError, ProgramData, ProgramError, ProgramType, links::define_link_wrapper, load_program, perf_attach, perf_attach::{PerfLinkIdInner, PerfLinkInner}, @@ -127,6 +127,9 @@ pub struct PerfEvent { } impl PerfEvent { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::PerfEvent; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_PERF_EVENT, &mut self.data) diff --git a/aya/src/programs/raw_trace_point.rs b/aya/src/programs/raw_trace_point.rs index 193e5aee..2abb6b51 100644 --- a/aya/src/programs/raw_trace_point.rs +++ b/aya/src/programs/raw_trace_point.rs @@ -4,7 +4,7 @@ use std::ffi::CString; use aya_obj::generated::bpf_prog_type::BPF_PROG_TYPE_RAW_TRACEPOINT; use crate::programs::{ - FdLink, FdLinkId, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, FdLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, utils::attach_raw_tracepoint, }; @@ -39,6 +39,9 @@ pub struct RawTracePoint { } impl RawTracePoint { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::RawTracePoint; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_RAW_TRACEPOINT, &mut self.data) diff --git a/aya/src/programs/sk_lookup.rs b/aya/src/programs/sk_lookup.rs index 5b741615..5a4c8d7c 100644 --- a/aya/src/programs/sk_lookup.rs +++ b/aya/src/programs/sk_lookup.rs @@ -5,7 +5,9 @@ use aya_obj::generated::{bpf_attach_type::BPF_SK_LOOKUP, bpf_prog_type::BPF_PROG use super::links::FdLink; use crate::{ - programs::{FdLinkId, ProgramData, ProgramError, define_link_wrapper, load_program}, + programs::{ + FdLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, + }, sys::{LinkTarget, SyscallError, bpf_link_create}, }; @@ -52,6 +54,9 @@ pub struct SkLookup { } impl SkLookup { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::SkLookup; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { self.data.expected_attach_type = Some(BPF_SK_LOOKUP); diff --git a/aya/src/programs/sk_msg.rs b/aya/src/programs/sk_msg.rs index c2df61a5..d97ee116 100644 --- a/aya/src/programs/sk_msg.rs +++ b/aya/src/programs/sk_msg.rs @@ -9,7 +9,7 @@ use aya_obj::generated::{ use crate::{ maps::sock::SockMapFd, programs::{ - CgroupAttachMode, ProgAttachLink, ProgAttachLinkId, ProgramData, ProgramError, + CgroupAttachMode, ProgAttachLink, ProgAttachLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, }, }; @@ -72,6 +72,9 @@ pub struct SkMsg { } impl SkMsg { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::SkLookup; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_SK_MSG, &mut self.data) diff --git a/aya/src/programs/sk_skb.rs b/aya/src/programs/sk_skb.rs index ee115657..f91ca7e0 100644 --- a/aya/src/programs/sk_skb.rs +++ b/aya/src/programs/sk_skb.rs @@ -11,7 +11,7 @@ use crate::{ VerifierLogLevel, maps::sock::SockMapFd, programs::{ - CgroupAttachMode, ProgAttachLink, ProgAttachLinkId, ProgramData, ProgramError, + CgroupAttachMode, ProgAttachLink, ProgAttachLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, }, }; @@ -74,6 +74,9 @@ pub struct SkSkb { } impl SkSkb { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::SkSkb; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_SK_SKB, &mut self.data) diff --git a/aya/src/programs/sock_ops.rs b/aya/src/programs/sock_ops.rs index 89bc864c..b0b96185 100644 --- a/aya/src/programs/sock_ops.rs +++ b/aya/src/programs/sock_ops.rs @@ -7,7 +7,7 @@ use aya_obj::generated::{ use crate::{ programs::{ - CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, + CgroupAttachMode, FdLink, Link, ProgAttachLink, ProgramData, ProgramError, ProgramType, define_link_wrapper, id_as_key, load_program, }, sys::{LinkTarget, SyscallError, bpf_link_create}, @@ -54,6 +54,9 @@ pub struct SockOps { } impl SockOps { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::SkSkb; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_SOCK_OPS, &mut self.data) diff --git a/aya/src/programs/socket_filter.rs b/aya/src/programs/socket_filter.rs index 0af018a4..a7c5faed 100644 --- a/aya/src/programs/socket_filter.rs +++ b/aya/src/programs/socket_filter.rs @@ -10,7 +10,7 @@ use aya_obj::generated::{ use libc::{SOL_SOCKET, setsockopt}; use thiserror::Error; -use crate::programs::{Link, ProgramData, ProgramError, id_as_key, load_program}; +use crate::programs::{Link, ProgramData, ProgramError, ProgramType, id_as_key, load_program}; /// The type returned when attaching a [`SocketFilter`] fails. #[derive(Debug, Error)] @@ -64,6 +64,9 @@ pub struct SocketFilter { } impl SocketFilter { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::SocketFilter; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_SOCKET_FILTER, &mut self.data) diff --git a/aya/src/programs/tc.rs b/aya/src/programs/tc.rs index e2925914..9ee15703 100644 --- a/aya/src/programs/tc.rs +++ b/aya/src/programs/tc.rs @@ -18,8 +18,8 @@ use super::{FdLink, ProgramInfo}; use crate::{ VerifierLogLevel, programs::{ - Link, LinkError, LinkOrder, ProgramData, ProgramError, define_link_wrapper, id_as_key, - load_program, query, + Link, LinkError, LinkOrder, ProgramData, ProgramError, ProgramType, define_link_wrapper, + id_as_key, load_program, query, }, sys::{ BpfLinkCreateArgs, LinkTarget, NetlinkError, ProgQueryTarget, SyscallError, @@ -156,6 +156,9 @@ pub struct NlOptions { } impl SchedClassifier { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::SchedClassifier; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_SCHED_CLS, &mut self.data) diff --git a/aya/src/programs/tp_btf.rs b/aya/src/programs/tp_btf.rs index 6bba718e..45de7d28 100644 --- a/aya/src/programs/tp_btf.rs +++ b/aya/src/programs/tp_btf.rs @@ -6,7 +6,7 @@ use aya_obj::{ }; use crate::programs::{ - FdLink, FdLinkId, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, FdLinkId, ProgramData, ProgramError, ProgramType, define_link_wrapper, load_program, utils::attach_raw_tracepoint, }; @@ -52,6 +52,9 @@ pub struct BtfTracePoint { } impl BtfTracePoint { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::Tracing; + /// Loads the program inside the kernel. /// /// # Arguments diff --git a/aya/src/programs/trace_point.rs b/aya/src/programs/trace_point.rs index ea3fe565..e096f56d 100644 --- a/aya/src/programs/trace_point.rs +++ b/aya/src/programs/trace_point.rs @@ -10,7 +10,8 @@ use thiserror::Error; use crate::{ programs::{ - FdLink, LinkError, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, LinkError, ProgramData, ProgramError, ProgramType, define_link_wrapper, + load_program, perf_attach::{PerfLinkIdInner, PerfLinkInner, perf_attach}, utils::find_tracefs_path, }, @@ -59,6 +60,9 @@ pub struct TracePoint { } impl TracePoint { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::TracePoint; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_TRACEPOINT, &mut self.data) diff --git a/aya/src/programs/uprobe.rs b/aya/src/programs/uprobe.rs index 72844899..e234a515 100644 --- a/aya/src/programs/uprobe.rs +++ b/aya/src/programs/uprobe.rs @@ -18,7 +18,8 @@ use thiserror::Error; use crate::{ VerifierLogLevel, programs::{ - FdLink, LinkError, ProgramData, ProgramError, define_link_wrapper, load_program, + FdLink, LinkError, ProgramData, ProgramError, ProgramType, define_link_wrapper, + load_program, perf_attach::{PerfLinkIdInner, PerfLinkInner}, probe::{OsStringExt as _, ProbeKind, attach}, }, @@ -71,6 +72,9 @@ impl From for UProbeAttachLocation<'static> { } impl UProbe { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::KProbe; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { load_program(BPF_PROG_TYPE_KPROBE, &mut self.data) diff --git a/aya/src/programs/xdp.rs b/aya/src/programs/xdp.rs index a7777eee..30cf9304 100644 --- a/aya/src/programs/xdp.rs +++ b/aya/src/programs/xdp.rs @@ -20,8 +20,8 @@ use thiserror::Error; use crate::{ VerifierLogLevel, programs::{ - FdLink, Link, LinkError, ProgramData, ProgramError, define_link_wrapper, id_as_key, - load_program, + FdLink, Link, LinkError, ProgramData, ProgramError, ProgramType, define_link_wrapper, + id_as_key, load_program, }, sys::{ LinkTarget, NetlinkError, SyscallError, bpf_link_create, bpf_link_get_info_by_fd, @@ -84,6 +84,9 @@ pub struct Xdp { } impl Xdp { + /// The type of the program according to the kernel. + pub const PROGRAM_TYPE: ProgramType = ProgramType::Xdp; + /// Loads the program inside the kernel. pub fn load(&mut self) -> Result<(), ProgramError> { self.data.expected_attach_type = Some(self.attach_type.into()); diff --git a/test/integration-test/src/tests/info.rs b/test/integration-test/src/tests/info.rs index 05b7a849..2c769f65 100644 --- a/test/integration-test/src/tests/info.rs +++ b/test/integration-test/src/tests/info.rs @@ -10,7 +10,7 @@ use std::{fs, panic, path::Path, time::SystemTime}; use aya::{ Ebpf, maps::{Array, HashMap, IterableMap as _, MapError, MapType, loaded_maps}, - programs::{ProgramError, ProgramType, SocketFilter, TracePoint, loaded_programs}, + programs::{ProgramError, ProgramType, SocketFilter, TracePoint, UProbe, loaded_programs}, sys::enable_stats, util::KernelVersion, }; @@ -25,8 +25,8 @@ const BPF_STATS_ENABLED: &str = "/proc/sys/kernel/bpf_stats_enabled"; fn test_loaded_programs() { // Load a program. // Since we are only testing the programs for their metadata, there is no need to "attach" them. - let mut bpf = Ebpf::load(crate::SIMPLE_PROG).unwrap(); - let prog: &mut SocketFilter = bpf.program_mut("simple_prog").unwrap().try_into().unwrap(); + let mut bpf = Ebpf::load(crate::TEST).unwrap(); + let prog: &mut UProbe = bpf.program_mut("test_uprobe").unwrap().try_into().unwrap(); prog.load().unwrap(); let test_prog = prog.info().unwrap(); @@ -55,6 +55,27 @@ fn test_loaded_programs() { programs.any(|prog| prog.id() == test_prog.id()), KernelVersion::new(4, 13, 0) ); + + // Iterate through loaded programs to exercise `from_program_info()`. + for program in loaded_programs() { + let program = program.unwrap(); + let mut p: UProbe = unsafe { + UProbe::from_program_info( + program, + "test_uprobe".into(), + aya::programs::ProbeKind::UProbe, + ) + .unwrap() + }; + + // Ensure we can perform basic operations on the re-created program. + let res = p + .attach("uprobe_function", "/proc/self/exe", None, None) + .unwrap(); + + // Ensure the program can be detached + p.detach(res).unwrap(); + } } #[test] diff --git a/xtask/public-api/aya.txt b/xtask/public-api/aya.txt index 6ed2a959..16a8ff2c 100644 --- a/xtask/public-api/aya.txt +++ b/xtask/public-api/aya.txt @@ -2539,6 +2539,8 @@ pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::result::Re impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice +pub fn aya::programs::cgroup_device::CgroupDevice::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::info(&self) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -2701,6 +2703,8 @@ pub fn aya::programs::cgroup_skb::CgroupSkb::take_link(&mut self, link_id: aya:: impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::cgroup_skb::CgroupSkb +pub fn aya::programs::cgroup_skb::CgroupSkb::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, attach_type: core::option::Option) -> core::result::Result +impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::info(&self) -> core::result::Result impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -3079,6 +3083,8 @@ pub fn aya::programs::cgroup_sockopt::CgroupSockopt::take_link(&mut self, link_i impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::cgroup_sockopt::CgroupSockopt +pub fn aya::programs::cgroup_sockopt::CgroupSockopt::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, attach_type: aya_obj::programs::cgroup_sockopt::CgroupSockoptAttachType) -> core::result::Result +impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::info(&self) -> core::result::Result impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -3205,6 +3211,8 @@ pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::result::Re impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl +pub fn aya::programs::cgroup_sysctl::CgroupSysctl::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::info(&self) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -3365,6 +3373,8 @@ pub fn aya::programs::extension::Extension::fd(&self) -> core::result::Result<&a impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::from_pin>(path: P) -> core::result::Result impl aya::programs::extension::Extension +pub fn aya::programs::extension::Extension::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::info(&self) -> core::result::Result impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -3495,6 +3505,8 @@ pub fn aya::programs::fentry::FEntry::fd(&self) -> core::result::Result<&aya::pr impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::from_pin>(path: P) -> core::result::Result impl aya::programs::fentry::FEntry +pub unsafe fn aya::programs::fentry::FEntry::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::info(&self) -> core::result::Result impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -3625,6 +3637,8 @@ pub fn aya::programs::fexit::FExit::fd(&self) -> core::result::Result<&aya::prog impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::from_pin>(path: P) -> core::result::Result impl aya::programs::fexit::FExit +pub unsafe fn aya::programs::fexit::FExit::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::info(&self) -> core::result::Result impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -3952,6 +3966,8 @@ pub fn aya::programs::kprobe::KProbe::take_link(&mut self, link_id: aya::program impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::kprobe::KProbe +pub unsafe fn aya::programs::kprobe::KProbe::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, kind: aya::programs::ProbeKind) -> core::result::Result +impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::info(&self) -> core::result::Result impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -4649,6 +4665,8 @@ pub fn aya::programs::lirc_mode2::LircMode2::fd(&self) -> core::result::Result<& impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::from_pin>(path: P) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 +pub fn aya::programs::lirc_mode2::LircMode2::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::info(&self) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -4700,6 +4718,8 @@ pub fn aya::programs::lsm::Lsm::fd(&self) -> core::result::Result<&aya::programs impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::from_pin>(path: P) -> core::result::Result impl aya::programs::lsm::Lsm +pub fn aya::programs::lsm::Lsm::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::info(&self) -> core::result::Result impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -5026,6 +5046,8 @@ pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::result::Result<& impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::from_pin>(path: P) -> core::result::Result impl aya::programs::perf_event::PerfEvent +pub fn aya::programs::perf_event::PerfEvent::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::info(&self) -> core::result::Result impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -5158,6 +5180,8 @@ pub fn aya::programs::raw_trace_point::RawTracePoint::fd(&self) -> core::result: impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::raw_trace_point::RawTracePoint +pub fn aya::programs::raw_trace_point::RawTracePoint::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::info(&self) -> core::result::Result impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -5288,6 +5312,8 @@ pub fn aya::programs::sk_lookup::SkLookup::fd(&self) -> core::result::Result<&ay impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::from_pin>(path: P) -> core::result::Result impl aya::programs::sk_lookup::SkLookup +pub fn aya::programs::sk_lookup::SkLookup::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::info(&self) -> core::result::Result impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -5418,6 +5444,8 @@ pub fn aya::programs::sk_msg::SkMsg::fd(&self) -> core::result::Result<&aya::pro impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::from_pin>(path: P) -> core::result::Result impl aya::programs::sk_msg::SkMsg +pub fn aya::programs::sk_msg::SkMsg::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::info(&self) -> core::result::Result impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -5583,6 +5611,8 @@ pub fn aya::programs::sk_skb::SkSkb::take_link(&mut self, link_id: aya::programs impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::sk_skb::SkSkb +pub fn aya::programs::sk_skb::SkSkb::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, kind: aya::programs::sk_skb::SkSkbKind) -> core::result::Result +impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::info(&self) -> core::result::Result impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -5713,6 +5743,8 @@ pub fn aya::programs::sock_ops::SockOps::fd(&self) -> core::result::Result<&aya: impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::from_pin>(path: P) -> core::result::Result impl aya::programs::sock_ops::SockOps +pub fn aya::programs::sock_ops::SockOps::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::info(&self) -> core::result::Result impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -5873,6 +5905,8 @@ pub fn aya::programs::socket_filter::SocketFilter::fd(&self) -> core::result::Re impl aya::programs::socket_filter::SocketFilter pub fn aya::programs::socket_filter::SocketFilter::from_pin>(path: P) -> core::result::Result impl aya::programs::socket_filter::SocketFilter +pub fn aya::programs::socket_filter::SocketFilter::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::socket_filter::SocketFilter pub fn aya::programs::socket_filter::SocketFilter::info(&self) -> core::result::Result impl aya::programs::socket_filter::SocketFilter pub fn aya::programs::socket_filter::SocketFilter::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -6151,6 +6185,8 @@ pub fn aya::programs::tc::SchedClassifier::take_link(&mut self, link_id: aya::pr impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::tc::SchedClassifier +pub fn aya::programs::tc::SchedClassifier::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::info(&self) -> core::result::Result impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -6297,6 +6333,8 @@ pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::result::Result<& impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint +pub unsafe fn aya::programs::tp_btf::BtfTracePoint::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::info(&self) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -6463,6 +6501,8 @@ pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::result::Result impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::trace_point::TracePoint +pub fn aya::programs::trace_point::TracePoint::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::info(&self) -> core::result::Result impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -6707,6 +6747,8 @@ pub fn aya::programs::uprobe::UProbe::take_link(&mut self, link_id: aya::program impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::uprobe::UProbe +pub unsafe fn aya::programs::uprobe::UProbe::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, kind: aya::programs::ProbeKind) -> core::result::Result +impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::info(&self) -> core::result::Result impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -6874,6 +6916,8 @@ pub fn aya::programs::xdp::Xdp::take_link(&mut self, link_id: aya::programs::xdp impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::xdp::Xdp +pub fn aya::programs::xdp::Xdp::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, attach_type: aya_obj::programs::xdp::XdpAttachType) -> core::result::Result +impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::info(&self) -> core::result::Result impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8053,6 +8097,8 @@ pub fn aya::programs::tp_btf::BtfTracePoint::fd(&self) -> core::result::Result<& impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint +pub unsafe fn aya::programs::tp_btf::BtfTracePoint::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::info(&self) -> core::result::Result impl aya::programs::tp_btf::BtfTracePoint pub fn aya::programs::tp_btf::BtfTracePoint::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8104,6 +8150,8 @@ pub fn aya::programs::cgroup_device::CgroupDevice::fd(&self) -> core::result::Re impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice +pub fn aya::programs::cgroup_device::CgroupDevice::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::info(&self) -> core::result::Result impl aya::programs::cgroup_device::CgroupDevice pub fn aya::programs::cgroup_device::CgroupDevice::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8154,6 +8202,8 @@ pub fn aya::programs::cgroup_skb::CgroupSkb::take_link(&mut self, link_id: aya:: impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::cgroup_skb::CgroupSkb +pub fn aya::programs::cgroup_skb::CgroupSkb::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, attach_type: core::option::Option) -> core::result::Result +impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::info(&self) -> core::result::Result impl aya::programs::cgroup_skb::CgroupSkb pub fn aya::programs::cgroup_skb::CgroupSkb::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8301,6 +8351,8 @@ pub fn aya::programs::cgroup_sockopt::CgroupSockopt::take_link(&mut self, link_i impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::cgroup_sockopt::CgroupSockopt +pub fn aya::programs::cgroup_sockopt::CgroupSockopt::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, attach_type: aya_obj::programs::cgroup_sockopt::CgroupSockoptAttachType) -> core::result::Result +impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::info(&self) -> core::result::Result impl aya::programs::cgroup_sockopt::CgroupSockopt pub fn aya::programs::cgroup_sockopt::CgroupSockopt::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8351,6 +8403,8 @@ pub fn aya::programs::cgroup_sysctl::CgroupSysctl::fd(&self) -> core::result::Re impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::from_pin>(path: P) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl +pub fn aya::programs::cgroup_sysctl::CgroupSysctl::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::info(&self) -> core::result::Result impl aya::programs::cgroup_sysctl::CgroupSysctl pub fn aya::programs::cgroup_sysctl::CgroupSysctl::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8402,6 +8456,8 @@ pub fn aya::programs::extension::Extension::fd(&self) -> core::result::Result<&a impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::from_pin>(path: P) -> core::result::Result impl aya::programs::extension::Extension +pub fn aya::programs::extension::Extension::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::info(&self) -> core::result::Result impl aya::programs::extension::Extension pub fn aya::programs::extension::Extension::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8452,6 +8508,8 @@ pub fn aya::programs::fentry::FEntry::fd(&self) -> core::result::Result<&aya::pr impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::from_pin>(path: P) -> core::result::Result impl aya::programs::fentry::FEntry +pub unsafe fn aya::programs::fentry::FEntry::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::info(&self) -> core::result::Result impl aya::programs::fentry::FEntry pub fn aya::programs::fentry::FEntry::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8502,6 +8560,8 @@ pub fn aya::programs::fexit::FExit::fd(&self) -> core::result::Result<&aya::prog impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::from_pin>(path: P) -> core::result::Result impl aya::programs::fexit::FExit +pub unsafe fn aya::programs::fexit::FExit::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::info(&self) -> core::result::Result impl aya::programs::fexit::FExit pub fn aya::programs::fexit::FExit::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8602,6 +8662,8 @@ pub fn aya::programs::kprobe::KProbe::take_link(&mut self, link_id: aya::program impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::kprobe::KProbe +pub unsafe fn aya::programs::kprobe::KProbe::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, kind: aya::programs::ProbeKind) -> core::result::Result +impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::info(&self) -> core::result::Result impl aya::programs::kprobe::KProbe pub fn aya::programs::kprobe::KProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8688,6 +8750,8 @@ pub fn aya::programs::lirc_mode2::LircMode2::fd(&self) -> core::result::Result<& impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::from_pin>(path: P) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 +pub fn aya::programs::lirc_mode2::LircMode2::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::info(&self) -> core::result::Result impl aya::programs::lirc_mode2::LircMode2 pub fn aya::programs::lirc_mode2::LircMode2::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8738,6 +8802,8 @@ pub fn aya::programs::lsm::Lsm::fd(&self) -> core::result::Result<&aya::programs impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::from_pin>(path: P) -> core::result::Result impl aya::programs::lsm::Lsm +pub fn aya::programs::lsm::Lsm::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::info(&self) -> core::result::Result impl aya::programs::lsm::Lsm pub fn aya::programs::lsm::Lsm::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8788,6 +8854,8 @@ pub fn aya::programs::perf_event::PerfEvent::fd(&self) -> core::result::Result<& impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::from_pin>(path: P) -> core::result::Result impl aya::programs::perf_event::PerfEvent +pub fn aya::programs::perf_event::PerfEvent::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::info(&self) -> core::result::Result impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8936,6 +9004,8 @@ pub fn aya::programs::raw_trace_point::RawTracePoint::fd(&self) -> core::result: impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::raw_trace_point::RawTracePoint +pub fn aya::programs::raw_trace_point::RawTracePoint::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::info(&self) -> core::result::Result impl aya::programs::raw_trace_point::RawTracePoint pub fn aya::programs::raw_trace_point::RawTracePoint::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -8988,6 +9058,8 @@ pub fn aya::programs::tc::SchedClassifier::take_link(&mut self, link_id: aya::pr impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::tc::SchedClassifier +pub fn aya::programs::tc::SchedClassifier::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::info(&self) -> core::result::Result impl aya::programs::tc::SchedClassifier pub fn aya::programs::tc::SchedClassifier::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9040,6 +9112,8 @@ pub fn aya::programs::sk_lookup::SkLookup::fd(&self) -> core::result::Result<&ay impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::from_pin>(path: P) -> core::result::Result impl aya::programs::sk_lookup::SkLookup +pub fn aya::programs::sk_lookup::SkLookup::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::info(&self) -> core::result::Result impl aya::programs::sk_lookup::SkLookup pub fn aya::programs::sk_lookup::SkLookup::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9090,6 +9164,8 @@ pub fn aya::programs::sk_msg::SkMsg::fd(&self) -> core::result::Result<&aya::pro impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::from_pin>(path: P) -> core::result::Result impl aya::programs::sk_msg::SkMsg +pub fn aya::programs::sk_msg::SkMsg::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::info(&self) -> core::result::Result impl aya::programs::sk_msg::SkMsg pub fn aya::programs::sk_msg::SkMsg::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9139,6 +9215,8 @@ pub fn aya::programs::sk_skb::SkSkb::take_link(&mut self, link_id: aya::programs impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::sk_skb::SkSkb +pub fn aya::programs::sk_skb::SkSkb::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, kind: aya::programs::sk_skb::SkSkbKind) -> core::result::Result +impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::info(&self) -> core::result::Result impl aya::programs::sk_skb::SkSkb pub fn aya::programs::sk_skb::SkSkb::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9189,6 +9267,8 @@ pub fn aya::programs::sock_ops::SockOps::fd(&self) -> core::result::Result<&aya: impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::from_pin>(path: P) -> core::result::Result impl aya::programs::sock_ops::SockOps +pub fn aya::programs::sock_ops::SockOps::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::info(&self) -> core::result::Result impl aya::programs::sock_ops::SockOps pub fn aya::programs::sock_ops::SockOps::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9238,6 +9318,8 @@ pub fn aya::programs::socket_filter::SocketFilter::fd(&self) -> core::result::Re impl aya::programs::socket_filter::SocketFilter pub fn aya::programs::socket_filter::SocketFilter::from_pin>(path: P) -> core::result::Result impl aya::programs::socket_filter::SocketFilter +pub fn aya::programs::socket_filter::SocketFilter::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::socket_filter::SocketFilter pub fn aya::programs::socket_filter::SocketFilter::info(&self) -> core::result::Result impl aya::programs::socket_filter::SocketFilter pub fn aya::programs::socket_filter::SocketFilter::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9288,6 +9370,8 @@ pub fn aya::programs::trace_point::TracePoint::fd(&self) -> core::result::Result impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::from_pin>(path: P) -> core::result::Result impl aya::programs::trace_point::TracePoint +pub fn aya::programs::trace_point::TracePoint::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo) -> core::result::Result +impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::info(&self) -> core::result::Result impl aya::programs::trace_point::TracePoint pub fn aya::programs::trace_point::TracePoint::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9338,6 +9422,8 @@ pub fn aya::programs::uprobe::UProbe::take_link(&mut self, link_id: aya::program impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::uprobe::UProbe +pub unsafe fn aya::programs::uprobe::UProbe::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, kind: aya::programs::ProbeKind) -> core::result::Result +impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::info(&self) -> core::result::Result impl aya::programs::uprobe::UProbe pub fn aya::programs::uprobe::UProbe::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError> @@ -9389,6 +9475,8 @@ pub fn aya::programs::xdp::Xdp::take_link(&mut self, link_id: aya::programs::xdp impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::fd(&self) -> core::result::Result<&aya::programs::ProgramFd, aya::programs::ProgramError> impl aya::programs::xdp::Xdp +pub fn aya::programs::xdp::Xdp::from_program_info(name: core::option::Option<&'static str>, info: aya::programs::ProgramInfo, attach_type: aya_obj::programs::xdp::XdpAttachType) -> core::result::Result +impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::info(&self) -> core::result::Result impl aya::programs::xdp::Xdp pub fn aya::programs::xdp::Xdp::pin>(&mut self, path: P) -> core::result::Result<(), aya::pin::PinError>