From f7a9d73d42ff5859d14d63ab67c1a3257d04bb50 Mon Sep 17 00:00:00 2001 From: Friday Ortiz Date: Fri, 10 Oct 2025 18:03:00 +0000 Subject: [PATCH 1/6] aya-obj,aya,ebpf,xtask: support perf_event hardware breakpoints - aya-obj: Generate userspace bindings for HW_BREAKPOINT_* options - aya: Support PERF_TYPE_BREAKPOINT by adding an optional hardware breakpoint configuration to PerfEvent::attach() and perf_event_open functions. - ebpf: Generate bindings for `struct bpf_perf_event_data` and update the PerfEventContext to use them instead of a void pointer. - xtask: Update codegen for constified anonymous HW_BREAKPOINT_* enums --- aya-obj/include/linux_wrapper.h | 3 +- .../src/generated/linux_bindings_aarch64.rs | 124 +++++++++-------- aya-obj/src/generated/linux_bindings_armv7.rs | 124 +++++++++-------- .../generated/linux_bindings_loongarch64.rs | 124 +++++++++-------- aya-obj/src/generated/linux_bindings_mips.rs | 124 +++++++++-------- .../src/generated/linux_bindings_powerpc64.rs | 124 +++++++++-------- .../src/generated/linux_bindings_riscv64.rs | 124 +++++++++-------- aya-obj/src/generated/linux_bindings_s390x.rs | 124 +++++++++-------- .../src/generated/linux_bindings_x86_64.rs | 124 +++++++++-------- aya/src/programs/mod.rs | 4 + aya/src/programs/perf_event.rs | 79 +++++++++-- aya/src/sys/perf_event.rs | 17 +++ ebpf/aya-ebpf-bindings/include/bindings.h | 1 + .../aya-ebpf-bindings/src/aarch64/bindings.rs | 13 +- ebpf/aya-ebpf-bindings/src/armv7/bindings.rs | 13 +- .../src/loongarch64/bindings.rs | 13 +- ebpf/aya-ebpf-bindings/src/mips/bindings.rs | 13 +- .../src/powerpc64/bindings.rs | 13 +- .../aya-ebpf-bindings/src/riscv64/bindings.rs | 13 +- ebpf/aya-ebpf-bindings/src/s390x/bindings.rs | 13 +- ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs | 13 +- ebpf/aya-ebpf/src/programs/perf_event.rs | 8 +- xtask/public-api/aya-ebpf-bindings.txt | 4 + xtask/public-api/aya-ebpf.txt | 2 + xtask/public-api/aya-obj.txt | 124 +++++++++-------- xtask/public-api/aya.txt | 125 +++++++++++++++++- xtask/src/codegen/aya.rs | 3 + 27 files changed, 926 insertions(+), 540 deletions(-) diff --git a/aya-obj/include/linux_wrapper.h b/aya-obj/include/linux_wrapper.h index fe9498f8..7bb1e679 100644 --- a/aya-obj/include/linux_wrapper.h +++ b/aya-obj/include/linux_wrapper.h @@ -1,9 +1,10 @@ #include #include +#include #include #include #include #include #include #include -#include +#include \ No newline at end of file diff --git a/aya-obj/src/generated/linux_bindings_aarch64.rs b/aya-obj/src/generated/linux_bindings_aarch64.rs index b76ed850..aff50e13 100644 --- a/aya-obj/src/generated/linux_bindings_aarch64.rs +++ b/aya-obj/src/generated/linux_bindings_aarch64.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya-obj/src/generated/linux_bindings_armv7.rs b/aya-obj/src/generated/linux_bindings_armv7.rs index 08b3a162..ae0a1da4 100644 --- a/aya-obj/src/generated/linux_bindings_armv7.rs +++ b/aya-obj/src/generated/linux_bindings_armv7.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya-obj/src/generated/linux_bindings_loongarch64.rs b/aya-obj/src/generated/linux_bindings_loongarch64.rs index b76ed850..aff50e13 100644 --- a/aya-obj/src/generated/linux_bindings_loongarch64.rs +++ b/aya-obj/src/generated/linux_bindings_loongarch64.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya-obj/src/generated/linux_bindings_mips.rs b/aya-obj/src/generated/linux_bindings_mips.rs index 349653d7..f3ae9b95 100644 --- a/aya-obj/src/generated/linux_bindings_mips.rs +++ b/aya-obj/src/generated/linux_bindings_mips.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya-obj/src/generated/linux_bindings_powerpc64.rs b/aya-obj/src/generated/linux_bindings_powerpc64.rs index 50d01b86..7d8294f7 100644 --- a/aya-obj/src/generated/linux_bindings_powerpc64.rs +++ b/aya-obj/src/generated/linux_bindings_powerpc64.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya-obj/src/generated/linux_bindings_riscv64.rs b/aya-obj/src/generated/linux_bindings_riscv64.rs index b76ed850..aff50e13 100644 --- a/aya-obj/src/generated/linux_bindings_riscv64.rs +++ b/aya-obj/src/generated/linux_bindings_riscv64.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya-obj/src/generated/linux_bindings_s390x.rs b/aya-obj/src/generated/linux_bindings_s390x.rs index b76ed850..aff50e13 100644 --- a/aya-obj/src/generated/linux_bindings_s390x.rs +++ b/aya-obj/src/generated/linux_bindings_s390x.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya-obj/src/generated/linux_bindings_x86_64.rs b/aya-obj/src/generated/linux_bindings_x86_64.rs index b76ed850..aff50e13 100644 --- a/aya-obj/src/generated/linux_bindings_x86_64.rs +++ b/aya-obj/src/generated/linux_bindings_x86_64.rs @@ -2105,6 +2105,22 @@ pub struct btf_var_secinfo { pub struct btf_decl_tag { pub component_idx: __s32, } +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_44 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_44 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_44 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_44 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_44 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_44 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_44 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_44 = 8; +pub type _bindgen_ty_44 = ::core::ffi::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_45 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_45 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_45 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_45 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_45 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_45 = 7; +pub type _bindgen_ty_45 = ::core::ffi::c_uint; impl nlmsgerr_attrs { pub const NLMSGERR_ATTR_MAX: nlmsgerr_attrs = nlmsgerr_attrs::NLMSGERR_ATTR_COOKIE; } @@ -2117,17 +2133,17 @@ pub enum nlmsgerr_attrs { NLMSGERR_ATTR_COOKIE = 3, __NLMSGERR_ATTR_MAX = 4, } -pub const IFLA_XDP_UNSPEC: _bindgen_ty_92 = 0; -pub const IFLA_XDP_FD: _bindgen_ty_92 = 1; -pub const IFLA_XDP_ATTACHED: _bindgen_ty_92 = 2; -pub const IFLA_XDP_FLAGS: _bindgen_ty_92 = 3; -pub const IFLA_XDP_PROG_ID: _bindgen_ty_92 = 4; -pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_92 = 5; -pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_92 = 6; -pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_92 = 7; -pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_92 = 8; -pub const __IFLA_XDP_MAX: _bindgen_ty_92 = 9; -pub type _bindgen_ty_92 = ::core::ffi::c_uint; +pub const IFLA_XDP_UNSPEC: _bindgen_ty_94 = 0; +pub const IFLA_XDP_FD: _bindgen_ty_94 = 1; +pub const IFLA_XDP_ATTACHED: _bindgen_ty_94 = 2; +pub const IFLA_XDP_FLAGS: _bindgen_ty_94 = 3; +pub const IFLA_XDP_PROG_ID: _bindgen_ty_94 = 4; +pub const IFLA_XDP_DRV_PROG_ID: _bindgen_ty_94 = 5; +pub const IFLA_XDP_SKB_PROG_ID: _bindgen_ty_94 = 6; +pub const IFLA_XDP_HW_PROG_ID: _bindgen_ty_94 = 7; +pub const IFLA_XDP_EXPECTED_FD: _bindgen_ty_94 = 8; +pub const __IFLA_XDP_MAX: _bindgen_ty_94 = 9; +pub type _bindgen_ty_94 = ::core::ffi::c_uint; impl nf_inet_hooks { pub const NF_INET_INGRESS: nf_inet_hooks = nf_inet_hooks::NF_INET_NUMHOOKS; } @@ -2141,16 +2157,16 @@ pub enum nf_inet_hooks { NF_INET_POST_ROUTING = 4, NF_INET_NUMHOOKS = 5, } -pub const NFPROTO_UNSPEC: _bindgen_ty_99 = 0; -pub const NFPROTO_INET: _bindgen_ty_99 = 1; -pub const NFPROTO_IPV4: _bindgen_ty_99 = 2; -pub const NFPROTO_ARP: _bindgen_ty_99 = 3; -pub const NFPROTO_NETDEV: _bindgen_ty_99 = 5; -pub const NFPROTO_BRIDGE: _bindgen_ty_99 = 7; -pub const NFPROTO_IPV6: _bindgen_ty_99 = 10; -pub const NFPROTO_DECNET: _bindgen_ty_99 = 12; -pub const NFPROTO_NUMPROTO: _bindgen_ty_99 = 13; -pub type _bindgen_ty_99 = ::core::ffi::c_uint; +pub const NFPROTO_UNSPEC: _bindgen_ty_101 = 0; +pub const NFPROTO_INET: _bindgen_ty_101 = 1; +pub const NFPROTO_IPV4: _bindgen_ty_101 = 2; +pub const NFPROTO_ARP: _bindgen_ty_101 = 3; +pub const NFPROTO_NETDEV: _bindgen_ty_101 = 5; +pub const NFPROTO_BRIDGE: _bindgen_ty_101 = 7; +pub const NFPROTO_IPV6: _bindgen_ty_101 = 10; +pub const NFPROTO_DECNET: _bindgen_ty_101 = 12; +pub const NFPROTO_NUMPROTO: _bindgen_ty_101 = 13; +pub type _bindgen_ty_101 = ::core::ffi::c_uint; #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum perf_type_id { @@ -4111,20 +4127,20 @@ pub enum perf_event_type { PERF_RECORD_AUX_OUTPUT_HW_ID = 21, PERF_RECORD_MAX = 22, } -pub const TCA_BPF_UNSPEC: _bindgen_ty_154 = 0; -pub const TCA_BPF_ACT: _bindgen_ty_154 = 1; -pub const TCA_BPF_POLICE: _bindgen_ty_154 = 2; -pub const TCA_BPF_CLASSID: _bindgen_ty_154 = 3; -pub const TCA_BPF_OPS_LEN: _bindgen_ty_154 = 4; -pub const TCA_BPF_OPS: _bindgen_ty_154 = 5; -pub const TCA_BPF_FD: _bindgen_ty_154 = 6; -pub const TCA_BPF_NAME: _bindgen_ty_154 = 7; -pub const TCA_BPF_FLAGS: _bindgen_ty_154 = 8; -pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_154 = 9; -pub const TCA_BPF_TAG: _bindgen_ty_154 = 10; -pub const TCA_BPF_ID: _bindgen_ty_154 = 11; -pub const __TCA_BPF_MAX: _bindgen_ty_154 = 12; -pub type _bindgen_ty_154 = ::core::ffi::c_uint; +pub const TCA_BPF_UNSPEC: _bindgen_ty_156 = 0; +pub const TCA_BPF_ACT: _bindgen_ty_156 = 1; +pub const TCA_BPF_POLICE: _bindgen_ty_156 = 2; +pub const TCA_BPF_CLASSID: _bindgen_ty_156 = 3; +pub const TCA_BPF_OPS_LEN: _bindgen_ty_156 = 4; +pub const TCA_BPF_OPS: _bindgen_ty_156 = 5; +pub const TCA_BPF_FD: _bindgen_ty_156 = 6; +pub const TCA_BPF_NAME: _bindgen_ty_156 = 7; +pub const TCA_BPF_FLAGS: _bindgen_ty_156 = 8; +pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_156 = 9; +pub const TCA_BPF_TAG: _bindgen_ty_156 = 10; +pub const TCA_BPF_ID: _bindgen_ty_156 = 11; +pub const __TCA_BPF_MAX: _bindgen_ty_156 = 12; +pub type _bindgen_ty_156 = ::core::ffi::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct ifinfomsg { @@ -4146,22 +4162,22 @@ pub struct tcmsg { pub tcm_parent: __u32, pub tcm_info: __u32, } -pub const TCA_UNSPEC: _bindgen_ty_174 = 0; -pub const TCA_KIND: _bindgen_ty_174 = 1; -pub const TCA_OPTIONS: _bindgen_ty_174 = 2; -pub const TCA_STATS: _bindgen_ty_174 = 3; -pub const TCA_XSTATS: _bindgen_ty_174 = 4; -pub const TCA_RATE: _bindgen_ty_174 = 5; -pub const TCA_FCNT: _bindgen_ty_174 = 6; -pub const TCA_STATS2: _bindgen_ty_174 = 7; -pub const TCA_STAB: _bindgen_ty_174 = 8; -pub const TCA_PAD: _bindgen_ty_174 = 9; -pub const TCA_DUMP_INVISIBLE: _bindgen_ty_174 = 10; -pub const TCA_CHAIN: _bindgen_ty_174 = 11; -pub const TCA_HW_OFFLOAD: _bindgen_ty_174 = 12; -pub const TCA_INGRESS_BLOCK: _bindgen_ty_174 = 13; -pub const TCA_EGRESS_BLOCK: _bindgen_ty_174 = 14; -pub const TCA_DUMP_FLAGS: _bindgen_ty_174 = 15; -pub const TCA_EXT_WARN_MSG: _bindgen_ty_174 = 16; -pub const __TCA_MAX: _bindgen_ty_174 = 17; -pub type _bindgen_ty_174 = ::core::ffi::c_uint; +pub const TCA_UNSPEC: _bindgen_ty_176 = 0; +pub const TCA_KIND: _bindgen_ty_176 = 1; +pub const TCA_OPTIONS: _bindgen_ty_176 = 2; +pub const TCA_STATS: _bindgen_ty_176 = 3; +pub const TCA_XSTATS: _bindgen_ty_176 = 4; +pub const TCA_RATE: _bindgen_ty_176 = 5; +pub const TCA_FCNT: _bindgen_ty_176 = 6; +pub const TCA_STATS2: _bindgen_ty_176 = 7; +pub const TCA_STAB: _bindgen_ty_176 = 8; +pub const TCA_PAD: _bindgen_ty_176 = 9; +pub const TCA_DUMP_INVISIBLE: _bindgen_ty_176 = 10; +pub const TCA_CHAIN: _bindgen_ty_176 = 11; +pub const TCA_HW_OFFLOAD: _bindgen_ty_176 = 12; +pub const TCA_INGRESS_BLOCK: _bindgen_ty_176 = 13; +pub const TCA_EGRESS_BLOCK: _bindgen_ty_176 = 14; +pub const TCA_DUMP_FLAGS: _bindgen_ty_176 = 15; +pub const TCA_EXT_WARN_MSG: _bindgen_ty_176 = 16; +pub const __TCA_MAX: _bindgen_ty_176 = 17; +pub type _bindgen_ty_176 = ::core::ffi::c_uint; diff --git a/aya/src/programs/mod.rs b/aya/src/programs/mod.rs index 4fb734f2..13db6144 100644 --- a/aya/src/programs/mod.rs +++ b/aya/src/programs/mod.rs @@ -236,6 +236,10 @@ pub enum ProgramError { /// An error occurred while working with Netlink. #[error(transparent)] NetlinkError(#[from] NetlinkError), + + /// The perf event breakpoint is underspecified + #[error("the breakpoint description is missing or incomplete")] + IncompleteBreakpoint, } /// A [`Program`] file descriptor. diff --git a/aya/src/programs/perf_event.rs b/aya/src/programs/perf_event.rs index 991227b1..c30ed8ea 100644 --- a/aya/src/programs/perf_event.rs +++ b/aya/src/programs/perf_event.rs @@ -3,7 +3,10 @@ use std::os::fd::AsFd as _; use aya_obj::generated::{ - bpf_link_type, + HW_BREAKPOINT_EMPTY, HW_BREAKPOINT_INVALID, HW_BREAKPOINT_LEN_1, HW_BREAKPOINT_LEN_2, + HW_BREAKPOINT_LEN_3, HW_BREAKPOINT_LEN_4, HW_BREAKPOINT_LEN_5, HW_BREAKPOINT_LEN_6, + HW_BREAKPOINT_LEN_7, HW_BREAKPOINT_LEN_8, HW_BREAKPOINT_R, HW_BREAKPOINT_RW, HW_BREAKPOINT_W, + HW_BREAKPOINT_X, bpf_link_type, bpf_prog_type::BPF_PROG_TYPE_PERF_EVENT, perf_type_id::{ PERF_TYPE_BREAKPOINT, PERF_TYPE_HARDWARE, PERF_TYPE_HW_CACHE, PERF_TYPE_RAW, @@ -18,7 +21,7 @@ use crate::{ programs::{ FdLink, LinkError, ProgramData, ProgramError, ProgramType, impl_try_into_fdlink, links::define_link_wrapper, - load_program, perf_attach, + load_program, perf_attach::{PerfLinkIdInner, PerfLinkInner}, }, sys::{SyscallError, bpf_link_get_info_by_fd, perf_event_open}, @@ -26,7 +29,7 @@ use crate::{ /// The type of perf event #[repr(u32)] -#[derive(Debug, Clone)] +#[derive(Debug, Clone, Copy)] pub enum PerfTypeId { /// PERF_TYPE_HARDWARE Hardware = PERF_TYPE_HARDWARE as u32, @@ -41,6 +44,58 @@ pub enum PerfTypeId { /// PERF_TYPE_BREAKPOINT Breakpoint = PERF_TYPE_BREAKPOINT as u32, } +/// A hardware breakpoint configuration +#[derive(Debug, Clone)] +pub struct PerfBreakpoint { + /// The address to set the breakpoint on + pub address: u64, + /// The breakpoint size. For HwBreakpointX this must be sizeof(long). For + /// all other types it should be one of HwBreakpointLen1, HwBreakpointLen2,, + /// HwBreakpointLen4 or HwBreakpointLen8. + pub length: PerfBreakpointSize, + /// The breakpoint type, one of HW_BREAKPOINT_{R,W,RW,X} + pub type_: PerfBreakpointType, +} + +/// Type of hardware breakpoint, determines if we break on read, write, or execute. +#[repr(u32)] +#[derive(Debug, Clone, Copy)] +pub enum PerfBreakpointType { + /// HW_BREAKPOINT_EMPTY + HwBreakpointEmpty = HW_BREAKPOINT_EMPTY, + /// HW_BREAKPOINT_R + HwBreakpointR = HW_BREAKPOINT_R, + /// HW_BREAKPOINT_W + HwBreakpointW = HW_BREAKPOINT_W, + /// HW_BREAKPOINT_RW + HwBreakpointRW = HW_BREAKPOINT_RW, + /// HW_BREAKPOINT_X + HwBreakpointX = HW_BREAKPOINT_X, + /// HW_BREAKPOINT_INVALID + HwBreakpointInvalid = HW_BREAKPOINT_INVALID, +} + +/// The size of the breakpoint being measured +#[repr(u32)] +#[derive(Debug, Clone, Copy)] +pub enum PerfBreakpointSize { + /// HW_BREAKPOINT_LEN_1 + HwBreakpointLen1 = HW_BREAKPOINT_LEN_1, + /// HW_BREAKPOINT_LEN_2 + HwBreakpointLen2 = HW_BREAKPOINT_LEN_2, + /// HW_BREAKPOINT_LEN_3 + HwBreakpointLen3 = HW_BREAKPOINT_LEN_3, + /// HW_BREAKPOINT_LEN_4 + HwBreakpointLen4 = HW_BREAKPOINT_LEN_4, + /// HW_BREAKPOINT_LEN_5 + HwBreakpointLen5 = HW_BREAKPOINT_LEN_5, + /// HW_BREAKPOINT_LEN_6 + HwBreakpointLen6 = HW_BREAKPOINT_LEN_6, + /// HW_BREAKPOINT_LEN_7 + HwBreakpointLen7 = HW_BREAKPOINT_LEN_7, + /// HW_BREAKPOINT_LEN_8 + HwBreakpointLen8 = HW_BREAKPOINT_LEN_8, +} /// Sample Policy #[derive(Debug, Clone)] @@ -116,6 +171,7 @@ pub enum PerfEventScope { /// PerfEventScope::AllProcessesOneCpu { cpu }, /// SamplePolicy::Period(1000000), /// true, +/// None /// )?; /// } /// # Ok::<(), Error>(()) @@ -141,9 +197,11 @@ impl PerfEvent { /// `perf_type`. See `perf_sw_ids`, `perf_hw_id`, `perf_hw_cache_id`, /// `perf_hw_cache_op_id` and `perf_hw_cache_op_result_id`. /// - /// The `scope` argument determines which processes are sampled. If `inherit` - /// is true, any new processes spawned by those processes will also - /// automatically get sampled. + /// The `bp` option must be specified if `perf_type` is `Breakpoint`. + /// + /// The `scope` argument determines which processes are sampled. If + /// `inherit` is true, any new processes spawned by those processes will + /// also automatically get sampled. /// /// The returned value can be used to detach, see [PerfEvent::detach]. pub fn attach( @@ -153,7 +211,11 @@ impl PerfEvent { scope: PerfEventScope, sample_policy: SamplePolicy, inherit: bool, + bp: Option, ) -> Result { + if matches!(perf_type, PerfTypeId::Breakpoint) && bp.is_none() { + return Err(ProgramError::IncompleteBreakpoint); + } let prog_fd = self.fd()?; let prog_fd = prog_fd.as_fd(); let (sample_period, sample_frequency) = match sample_policy { @@ -174,16 +236,17 @@ impl PerfEvent { cpu, sample_period, sample_frequency, - false, + matches!(perf_type, PerfTypeId::Breakpoint), inherit, 0, + bp, ) .map_err(|io_error| SyscallError { call: "perf_event_open", io_error, })?; - let link = perf_attach(prog_fd, fd, None /* cookie */)?; + let link = crate::programs::perf_attach(prog_fd, fd, None /* cookie */)?; self.data.links.insert(PerfEventLink::new(link)) } } diff --git a/aya/src/sys/perf_event.rs b/aya/src/sys/perf_event.rs index afedefa9..19651b47 100644 --- a/aya/src/sys/perf_event.rs +++ b/aya/src/sys/perf_event.rs @@ -13,6 +13,7 @@ use aya_obj::generated::{ use libc::pid_t; use super::{PerfEventIoctlRequest, Syscall, syscall}; +use crate::programs::{PerfTypeId, perf_event::PerfBreakpoint}; #[expect(clippy::too_many_arguments)] pub(crate) fn perf_event_open( @@ -25,6 +26,7 @@ pub(crate) fn perf_event_open( wakeup: bool, inherit: bool, flags: u32, + bp: Option, ) -> io::Result { let mut attr = unsafe { mem::zeroed::() }; @@ -42,6 +44,20 @@ pub(crate) fn perf_event_open( attr.__bindgen_anon_1.sample_period = sample_period; } + if perf_type == (PerfTypeId::Breakpoint as u32) { + if let Some(bp) = bp { + attr.bp_type = bp.type_ as u32; + attr.__bindgen_anon_3.bp_addr = bp.address; + attr.__bindgen_anon_4.bp_len = bp.length as u64; + attr.set_precise_ip(2); + } else { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "perf_type Breakpoint requires a PerfBreakpoint", + )); + } + } + perf_event_sys(attr, pid, cpu, flags) } @@ -56,6 +72,7 @@ pub(crate) fn perf_event_open_bpf(cpu: c_int) -> io::Result { true, false, PERF_FLAG_FD_CLOEXEC, + None, ) } diff --git a/ebpf/aya-ebpf-bindings/include/bindings.h b/ebpf/aya-ebpf-bindings/include/bindings.h index aa831c57..ba2f9183 100644 --- a/ebpf/aya-ebpf-bindings/include/bindings.h +++ b/ebpf/aya-ebpf-bindings/include/bindings.h @@ -6,6 +6,7 @@ typedef __u32 __bitwise __wsum; #include #include +#include // needed for TC_ACT_* #include #include diff --git a/ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs b/ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs index 87ef0587..473db3c6 100644 --- a/ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/aarch64/bindings.rs @@ -365,11 +365,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -2887,6 +2882,14 @@ pub struct user_pt_regs { pub pc: __u64, pub pstate: __u64, } +pub type bpf_user_pt_regs_t = user_pt_regs; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf-bindings/src/armv7/bindings.rs b/ebpf/aya-ebpf-bindings/src/armv7/bindings.rs index 54140c49..50c1d6f7 100644 --- a/ebpf/aya-ebpf-bindings/src/armv7/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/armv7/bindings.rs @@ -365,11 +365,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -2896,6 +2891,14 @@ pub struct bpf_iter_num { pub struct pt_regs { pub uregs: [::aya_ebpf_cty::c_long; 18usize], } +pub type bpf_user_pt_regs_t = pt_regs; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf-bindings/src/loongarch64/bindings.rs b/ebpf/aya-ebpf-bindings/src/loongarch64/bindings.rs index f769d7b9..4ffb76ce 100644 --- a/ebpf/aya-ebpf-bindings/src/loongarch64/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/loongarch64/bindings.rs @@ -365,11 +365,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -2888,6 +2883,14 @@ pub struct user_pt_regs { pub csr_badv: ::aya_ebpf_cty::c_ulong, pub reserved: [::aya_ebpf_cty::c_ulong; 10usize], } +pub type bpf_user_pt_regs_t = user_pt_regs; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf-bindings/src/mips/bindings.rs b/ebpf/aya-ebpf-bindings/src/mips/bindings.rs index 65333c5c..1bacaa53 100644 --- a/ebpf/aya-ebpf-bindings/src/mips/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/mips/bindings.rs @@ -366,11 +366,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -2903,6 +2898,14 @@ pub struct pt_regs { pub cp0_status: __u64, pub cp0_cause: __u64, } +pub type bpf_user_pt_regs_t = pt_regs; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs b/ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs index bc1388bf..7e46bcb7 100644 --- a/ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/powerpc64/bindings.rs @@ -365,11 +365,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -2891,6 +2886,14 @@ pub struct pt_regs { pub dsisr: ::aya_ebpf_cty::c_ulong, pub result: ::aya_ebpf_cty::c_ulong, } +pub type bpf_user_pt_regs_t = pt_regs; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs b/ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs index 98b85819..c90a7d2a 100644 --- a/ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/riscv64/bindings.rs @@ -365,11 +365,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -2915,6 +2910,14 @@ pub struct user_regs_struct { pub t5: ::aya_ebpf_cty::c_ulong, pub t6: ::aya_ebpf_cty::c_ulong, } +pub type bpf_user_pt_regs_t = user_regs_struct; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf-bindings/src/s390x/bindings.rs b/ebpf/aya-ebpf-bindings/src/s390x/bindings.rs index 15804301..015cafe7 100644 --- a/ebpf/aya-ebpf-bindings/src/s390x/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/s390x/bindings.rs @@ -365,11 +365,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -3848,6 +3843,14 @@ pub struct user_regs_struct { pub per_info: per_struct, pub ieee_instruction_pointer: ::aya_ebpf_cty::c_ulong, } +pub type bpf_user_pt_regs_t = user_pt_regs; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs b/ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs index 89fec488..72c24b75 100644 --- a/ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs +++ b/ebpf/aya-ebpf-bindings/src/x86_64/bindings.rs @@ -365,11 +365,6 @@ pub type __be32 = __u32; pub type __wsum = __u32; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct bpf_perf_event_data { - _unused: [u8; 0], -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] pub struct linux_binprm { _unused: [u8; 0], } @@ -2899,6 +2894,14 @@ pub struct pt_regs { pub rsp: ::aya_ebpf_cty::c_ulong, pub ss: ::aya_ebpf_cty::c_ulong, } +pub type bpf_user_pt_regs_t = pt_regs; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct bpf_perf_event_data { + pub regs: bpf_user_pt_regs_t, + pub sample_period: __u64, + pub addr: __u64, +} pub type sa_family_t = ::aya_ebpf_cty::c_ushort; #[repr(C)] #[derive(Debug, Copy, Clone)] diff --git a/ebpf/aya-ebpf/src/programs/perf_event.rs b/ebpf/aya-ebpf/src/programs/perf_event.rs index d847fc31..c6f270e6 100644 --- a/ebpf/aya-ebpf/src/programs/perf_event.rs +++ b/ebpf/aya-ebpf/src/programs/perf_event.rs @@ -1,19 +1,21 @@ use core::ffi::c_void; +use aya_ebpf_bindings::bindings::bpf_perf_event_data; + use crate::EbpfContext; pub struct PerfEventContext { - ctx: *mut c_void, + pub ctx: *mut bpf_perf_event_data, } impl PerfEventContext { pub fn new(ctx: *mut c_void) -> Self { - Self { ctx } + Self { ctx: ctx.cast() } } } impl EbpfContext for PerfEventContext { fn as_ptr(&self) -> *mut c_void { - self.ctx + self.ctx.cast() } } diff --git a/xtask/public-api/aya-ebpf-bindings.txt b/xtask/public-api/aya-ebpf-bindings.txt index 7a38ec39..00a60f70 100644 --- a/xtask/public-api/aya-ebpf-bindings.txt +++ b/xtask/public-api/aya-ebpf-bindings.txt @@ -4972,6 +4972,9 @@ pub unsafe fn aya_ebpf_bindings::bindings::bpf_map_info::clone_to_uninit(&self, impl core::convert::From for aya_ebpf_bindings::bindings::bpf_map_info pub fn aya_ebpf_bindings::bindings::bpf_map_info::from(t: T) -> T #[repr(C)] pub struct aya_ebpf_bindings::bindings::bpf_perf_event_data +pub aya_ebpf_bindings::bindings::bpf_perf_event_data::addr: aya_ebpf_bindings::bindings::__u64 +pub aya_ebpf_bindings::bindings::bpf_perf_event_data::regs: aya_ebpf_bindings::bindings::bpf_user_pt_regs_t +pub aya_ebpf_bindings::bindings::bpf_perf_event_data::sample_period: aya_ebpf_bindings::bindings::__u64 impl core::clone::Clone for aya_ebpf_bindings::bindings::bpf_perf_event_data pub fn aya_ebpf_bindings::bindings::bpf_perf_event_data::clone(&self) -> aya_ebpf_bindings::bindings::bpf_perf_event_data impl core::fmt::Debug for aya_ebpf_bindings::bindings::bpf_perf_event_data @@ -7057,6 +7060,7 @@ pub type aya_ebpf_bindings::bindings::_bindgen_ty_6 = aya_ebpf_cty::ad::c_uint pub type aya_ebpf_bindings::bindings::_bindgen_ty_7 = aya_ebpf_cty::ad::c_uint pub type aya_ebpf_bindings::bindings::_bindgen_ty_8 = aya_ebpf_cty::ad::c_uint pub type aya_ebpf_bindings::bindings::_bindgen_ty_9 = aya_ebpf_cty::ad::c_uint +pub type aya_ebpf_bindings::bindings::bpf_user_pt_regs_t = aya_ebpf_bindings::bindings::pt_regs pub type aya_ebpf_bindings::bindings::sa_family_t = aya_ebpf_cty::c_ushort pub mod aya_ebpf_bindings::helpers pub unsafe fn aya_ebpf_bindings::helpers::bpf_bind(ctx: *mut aya_ebpf_bindings::bindings::bpf_sock_addr, addr: *mut aya_ebpf_bindings::bindings::sockaddr, addr_len: aya_ebpf_cty::ad::c_int) -> aya_ebpf_cty::od::c_long diff --git a/xtask/public-api/aya-ebpf.txt b/xtask/public-api/aya-ebpf.txt index ea62c132..0f59201c 100644 --- a/xtask/public-api/aya-ebpf.txt +++ b/xtask/public-api/aya-ebpf.txt @@ -1721,6 +1721,7 @@ impl core::convert::From for aya_ebpf::programs::lsm::LsmContext pub fn aya_ebpf::programs::lsm::LsmContext::from(t: T) -> T pub mod aya_ebpf::programs::perf_event pub struct aya_ebpf::programs::perf_event::PerfEventContext +pub aya_ebpf::programs::perf_event::PerfEventContext::ctx: *mut aya_ebpf_bindings::x86_64::bindings::bpf_perf_event_data impl aya_ebpf::programs::perf_event::PerfEventContext pub fn aya_ebpf::programs::perf_event::PerfEventContext::new(ctx: *mut core::ffi::c_void) -> Self impl aya_ebpf::EbpfContext for aya_ebpf::programs::perf_event::PerfEventContext @@ -2459,6 +2460,7 @@ pub fn aya_ebpf::programs::lsm::LsmContext::borrow_mut(&mut self) -> &mut T impl core::convert::From for aya_ebpf::programs::lsm::LsmContext pub fn aya_ebpf::programs::lsm::LsmContext::from(t: T) -> T pub struct aya_ebpf::programs::PerfEventContext +pub aya_ebpf::programs::PerfEventContext::ctx: *mut aya_ebpf_bindings::x86_64::bindings::bpf_perf_event_data impl aya_ebpf::programs::perf_event::PerfEventContext pub fn aya_ebpf::programs::perf_event::PerfEventContext::new(ctx: *mut core::ffi::c_void) -> Self impl aya_ebpf::EbpfContext for aya_ebpf::programs::perf_event::PerfEventContext diff --git a/xtask/public-api/aya-obj.txt b/xtask/public-api/aya-obj.txt index b04d69cf..2f0d0979 100644 --- a/xtask/public-api/aya-obj.txt +++ b/xtask/public-api/aya-obj.txt @@ -8055,24 +8055,38 @@ pub const aya_obj::generated::BTF_KIND_VOLATILE: aya_obj::generated::_bindgen_ty pub const aya_obj::generated::BTF_VAR_GLOBAL_ALLOCATED: aya_obj::generated::_bindgen_ty_43 pub const aya_obj::generated::BTF_VAR_GLOBAL_EXTERN: aya_obj::generated::_bindgen_ty_43 pub const aya_obj::generated::BTF_VAR_STATIC: aya_obj::generated::_bindgen_ty_43 -pub const aya_obj::generated::IFLA_XDP_ATTACHED: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_DRV_PROG_ID: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_EXPECTED_FD: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_FD: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_FLAGS: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_HW_PROG_ID: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_PROG_ID: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_SKB_PROG_ID: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::IFLA_XDP_UNSPEC: aya_obj::generated::_bindgen_ty_92 -pub const aya_obj::generated::NFPROTO_ARP: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_BRIDGE: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_DECNET: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_INET: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_IPV4: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_IPV6: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_NETDEV: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_NUMPROTO: aya_obj::generated::_bindgen_ty_99 -pub const aya_obj::generated::NFPROTO_UNSPEC: aya_obj::generated::_bindgen_ty_99 +pub const aya_obj::generated::HW_BREAKPOINT_EMPTY: aya_obj::generated::_bindgen_ty_45 +pub const aya_obj::generated::HW_BREAKPOINT_INVALID: aya_obj::generated::_bindgen_ty_45 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_1: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_2: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_3: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_4: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_5: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_6: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_7: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_LEN_8: aya_obj::generated::_bindgen_ty_44 +pub const aya_obj::generated::HW_BREAKPOINT_R: aya_obj::generated::_bindgen_ty_45 +pub const aya_obj::generated::HW_BREAKPOINT_RW: aya_obj::generated::_bindgen_ty_45 +pub const aya_obj::generated::HW_BREAKPOINT_W: aya_obj::generated::_bindgen_ty_45 +pub const aya_obj::generated::HW_BREAKPOINT_X: aya_obj::generated::_bindgen_ty_45 +pub const aya_obj::generated::IFLA_XDP_ATTACHED: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_DRV_PROG_ID: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_EXPECTED_FD: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_FD: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_FLAGS: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_HW_PROG_ID: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_PROG_ID: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_SKB_PROG_ID: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::IFLA_XDP_UNSPEC: aya_obj::generated::_bindgen_ty_94 +pub const aya_obj::generated::NFPROTO_ARP: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_BRIDGE: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_DECNET: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_INET: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_IPV4: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_IPV6: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_NETDEV: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_NUMPROTO: aya_obj::generated::_bindgen_ty_101 +pub const aya_obj::generated::NFPROTO_UNSPEC: aya_obj::generated::_bindgen_ty_101 pub const aya_obj::generated::NLMSG_ALIGNTO: u32 pub const aya_obj::generated::NR_BTF_KINDS: aya_obj::generated::_bindgen_ty_42 pub const aya_obj::generated::PERF_EVENT_IOC_DISABLE: u32 @@ -8095,36 +8109,36 @@ pub const aya_obj::generated::PERF_MAX_CONTEXTS_PER_STACK: u32 pub const aya_obj::generated::PERF_MAX_STACK_DEPTH: u32 pub const aya_obj::generated::SO_ATTACH_BPF: u32 pub const aya_obj::generated::SO_DETACH_BPF: u32 -pub const aya_obj::generated::TCA_BPF_ACT: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_CLASSID: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_FD: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_FLAGS: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_FLAGS_GEN: aya_obj::generated::_bindgen_ty_154 +pub const aya_obj::generated::TCA_BPF_ACT: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_CLASSID: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_FD: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_FLAGS: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_FLAGS_GEN: aya_obj::generated::_bindgen_ty_156 pub const aya_obj::generated::TCA_BPF_FLAG_ACT_DIRECT: u32 -pub const aya_obj::generated::TCA_BPF_ID: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_NAME: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_OPS: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_OPS_LEN: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_POLICE: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_TAG: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_BPF_UNSPEC: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::TCA_CHAIN: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_DUMP_FLAGS: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_DUMP_INVISIBLE: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_EGRESS_BLOCK: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_EXT_WARN_MSG: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_FCNT: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_HW_OFFLOAD: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_INGRESS_BLOCK: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_KIND: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_OPTIONS: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_PAD: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_RATE: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_STAB: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_STATS: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_STATS2: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_UNSPEC: aya_obj::generated::_bindgen_ty_174 -pub const aya_obj::generated::TCA_XSTATS: aya_obj::generated::_bindgen_ty_174 +pub const aya_obj::generated::TCA_BPF_ID: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_NAME: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_OPS: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_OPS_LEN: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_POLICE: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_TAG: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_BPF_UNSPEC: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::TCA_CHAIN: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_DUMP_FLAGS: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_DUMP_INVISIBLE: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_EGRESS_BLOCK: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_EXT_WARN_MSG: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_FCNT: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_HW_OFFLOAD: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_INGRESS_BLOCK: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_KIND: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_OPTIONS: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_PAD: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_RATE: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_STAB: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_STATS: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_STATS2: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_UNSPEC: aya_obj::generated::_bindgen_ty_176 +pub const aya_obj::generated::TCA_XSTATS: aya_obj::generated::_bindgen_ty_176 pub const aya_obj::generated::TC_H_CLSACT: u32 pub const aya_obj::generated::TC_H_INGRESS: u32 pub const aya_obj::generated::TC_H_MAJ_MASK: u32 @@ -8141,10 +8155,10 @@ pub const aya_obj::generated::XDP_FLAGS_MODES: u32 pub const aya_obj::generated::XDP_FLAGS_REPLACE: u32 pub const aya_obj::generated::XDP_FLAGS_SKB_MODE: u32 pub const aya_obj::generated::XDP_FLAGS_UPDATE_IF_NOEXIST: u32 -pub const aya_obj::generated::__IFLA_XDP_MAX: aya_obj::generated::_bindgen_ty_92 +pub const aya_obj::generated::__IFLA_XDP_MAX: aya_obj::generated::_bindgen_ty_94 pub const aya_obj::generated::__MAX_BPF_REG: aya_obj::generated::_bindgen_ty_1 -pub const aya_obj::generated::__TCA_BPF_MAX: aya_obj::generated::_bindgen_ty_154 -pub const aya_obj::generated::__TCA_MAX: aya_obj::generated::_bindgen_ty_174 +pub const aya_obj::generated::__TCA_BPF_MAX: aya_obj::generated::_bindgen_ty_156 +pub const aya_obj::generated::__TCA_MAX: aya_obj::generated::_bindgen_ty_176 pub type aya_obj::generated::__s16 = core::ffi::primitives::c_short pub type aya_obj::generated::__s32 = core::ffi::primitives::c_int pub type aya_obj::generated::__s64 = core::ffi::primitives::c_longlong @@ -8153,14 +8167,15 @@ pub type aya_obj::generated::__u32 = core::ffi::primitives::c_uint pub type aya_obj::generated::__u64 = core::ffi::primitives::c_ulonglong pub type aya_obj::generated::__u8 = core::ffi::primitives::c_uchar pub type aya_obj::generated::_bindgen_ty_10 = core::ffi::primitives::c_uint +pub type aya_obj::generated::_bindgen_ty_101 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_11 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_12 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_13 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_14 = core::ffi::primitives::c_ulong pub type aya_obj::generated::_bindgen_ty_15 = core::ffi::primitives::c_int -pub type aya_obj::generated::_bindgen_ty_154 = core::ffi::primitives::c_uint +pub type aya_obj::generated::_bindgen_ty_156 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_17 = core::ffi::primitives::c_uint -pub type aya_obj::generated::_bindgen_ty_174 = core::ffi::primitives::c_uint +pub type aya_obj::generated::_bindgen_ty_176 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_19 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_2 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_21 = core::ffi::primitives::c_uint @@ -8172,13 +8187,14 @@ pub type aya_obj::generated::_bindgen_ty_4 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_41 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_42 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_43 = core::ffi::primitives::c_uint +pub type aya_obj::generated::_bindgen_ty_44 = core::ffi::primitives::c_uint +pub type aya_obj::generated::_bindgen_ty_45 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_5 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_6 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_7 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_8 = core::ffi::primitives::c_uint pub type aya_obj::generated::_bindgen_ty_9 = core::ffi::primitives::c_uint -pub type aya_obj::generated::_bindgen_ty_92 = core::ffi::primitives::c_uint -pub type aya_obj::generated::_bindgen_ty_99 = core::ffi::primitives::c_uint +pub type aya_obj::generated::_bindgen_ty_94 = core::ffi::primitives::c_uint pub mod aya_obj::links pub mod aya_obj::maps pub enum aya_obj::maps::Map diff --git a/xtask/public-api/aya.txt b/xtask/public-api/aya.txt index 680204ac..87a2d43e 100644 --- a/xtask/public-api/aya.txt +++ b/xtask/public-api/aya.txt @@ -5298,6 +5298,88 @@ pub use aya::programs::perf_event::perf_hw_cache_op_id pub use aya::programs::perf_event::perf_hw_cache_op_result_id pub use aya::programs::perf_event::perf_hw_id pub use aya::programs::perf_event::perf_sw_ids +#[repr(u32)] pub enum aya::programs::perf_event::PerfBreakpointSize +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen1 = 1 +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen2 = 2 +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen3 = 3 +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen4 = 4 +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen5 = 5 +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen6 = 6 +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen7 = 7 +pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen8 = 8 +impl core::clone::Clone for aya::programs::perf_event::PerfBreakpointSize +pub fn aya::programs::perf_event::PerfBreakpointSize::clone(&self) -> aya::programs::perf_event::PerfBreakpointSize +impl core::fmt::Debug for aya::programs::perf_event::PerfBreakpointSize +pub fn aya::programs::perf_event::PerfBreakpointSize::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::PerfBreakpointSize +impl core::marker::Freeze for aya::programs::perf_event::PerfBreakpointSize +impl core::marker::Send for aya::programs::perf_event::PerfBreakpointSize +impl core::marker::Sync for aya::programs::perf_event::PerfBreakpointSize +impl core::marker::Unpin for aya::programs::perf_event::PerfBreakpointSize +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfBreakpointSize +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfBreakpointSize +impl core::convert::Into for aya::programs::perf_event::PerfBreakpointSize where U: core::convert::From +pub fn aya::programs::perf_event::PerfBreakpointSize::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::PerfBreakpointSize where U: core::convert::Into +pub type aya::programs::perf_event::PerfBreakpointSize::Error = core::convert::Infallible +pub fn aya::programs::perf_event::PerfBreakpointSize::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::PerfBreakpointSize where U: core::convert::TryFrom +pub type aya::programs::perf_event::PerfBreakpointSize::Error = >::Error +pub fn aya::programs::perf_event::PerfBreakpointSize::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfBreakpointSize where T: core::clone::Clone +pub type aya::programs::perf_event::PerfBreakpointSize::Owned = T +pub fn aya::programs::perf_event::PerfBreakpointSize::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::PerfBreakpointSize::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::PerfBreakpointSize where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpointSize::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::PerfBreakpointSize where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpointSize::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::PerfBreakpointSize where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpointSize::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::PerfBreakpointSize where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::PerfBreakpointSize::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::PerfBreakpointSize +pub fn aya::programs::perf_event::PerfBreakpointSize::from(t: T) -> T +#[repr(u32)] pub enum aya::programs::perf_event::PerfBreakpointType +pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointEmpty = 0 +pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointInvalid = 7 +pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointR = 1 +pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointRW = 3 +pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointW = 2 +pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointX = 4 +impl core::clone::Clone for aya::programs::perf_event::PerfBreakpointType +pub fn aya::programs::perf_event::PerfBreakpointType::clone(&self) -> aya::programs::perf_event::PerfBreakpointType +impl core::fmt::Debug for aya::programs::perf_event::PerfBreakpointType +pub fn aya::programs::perf_event::PerfBreakpointType::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::PerfBreakpointType +impl core::marker::Freeze for aya::programs::perf_event::PerfBreakpointType +impl core::marker::Send for aya::programs::perf_event::PerfBreakpointType +impl core::marker::Sync for aya::programs::perf_event::PerfBreakpointType +impl core::marker::Unpin for aya::programs::perf_event::PerfBreakpointType +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfBreakpointType +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfBreakpointType +impl core::convert::Into for aya::programs::perf_event::PerfBreakpointType where U: core::convert::From +pub fn aya::programs::perf_event::PerfBreakpointType::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::PerfBreakpointType where U: core::convert::Into +pub type aya::programs::perf_event::PerfBreakpointType::Error = core::convert::Infallible +pub fn aya::programs::perf_event::PerfBreakpointType::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::PerfBreakpointType where U: core::convert::TryFrom +pub type aya::programs::perf_event::PerfBreakpointType::Error = >::Error +pub fn aya::programs::perf_event::PerfBreakpointType::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfBreakpointType where T: core::clone::Clone +pub type aya::programs::perf_event::PerfBreakpointType::Owned = T +pub fn aya::programs::perf_event::PerfBreakpointType::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::PerfBreakpointType::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::PerfBreakpointType where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpointType::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::PerfBreakpointType where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpointType::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::PerfBreakpointType where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpointType::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::PerfBreakpointType where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::PerfBreakpointType::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::PerfBreakpointType +pub fn aya::programs::perf_event::PerfBreakpointType::from(t: T) -> T pub enum aya::programs::perf_event::PerfEventScope pub aya::programs::perf_event::PerfEventScope::AllProcessesOneCpu pub aya::programs::perf_event::PerfEventScope::AllProcessesOneCpu::cpu: u32 @@ -5352,6 +5434,7 @@ impl core::clone::Clone for aya::programs::perf_event::PerfTypeId pub fn aya::programs::perf_event::PerfTypeId::clone(&self) -> aya::programs::perf_event::PerfTypeId impl core::fmt::Debug for aya::programs::perf_event::PerfTypeId pub fn aya::programs::perf_event::PerfTypeId::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::PerfTypeId impl core::marker::Freeze for aya::programs::perf_event::PerfTypeId impl core::marker::Send for aya::programs::perf_event::PerfTypeId impl core::marker::Sync for aya::programs::perf_event::PerfTypeId @@ -5415,10 +5498,46 @@ impl core::clone::CloneToUninit for aya::programs::perf_event::SamplePolicy w pub unsafe fn aya::programs::perf_event::SamplePolicy::clone_to_uninit(&self, dest: *mut u8) impl core::convert::From for aya::programs::perf_event::SamplePolicy pub fn aya::programs::perf_event::SamplePolicy::from(t: T) -> T +pub struct aya::programs::perf_event::PerfBreakpoint +pub aya::programs::perf_event::PerfBreakpoint::address: u64 +pub aya::programs::perf_event::PerfBreakpoint::length: aya::programs::perf_event::PerfBreakpointSize +pub aya::programs::perf_event::PerfBreakpoint::type_: aya::programs::perf_event::PerfBreakpointType +impl core::clone::Clone for aya::programs::perf_event::PerfBreakpoint +pub fn aya::programs::perf_event::PerfBreakpoint::clone(&self) -> aya::programs::perf_event::PerfBreakpoint +impl core::fmt::Debug for aya::programs::perf_event::PerfBreakpoint +pub fn aya::programs::perf_event::PerfBreakpoint::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Freeze for aya::programs::perf_event::PerfBreakpoint +impl core::marker::Send for aya::programs::perf_event::PerfBreakpoint +impl core::marker::Sync for aya::programs::perf_event::PerfBreakpoint +impl core::marker::Unpin for aya::programs::perf_event::PerfBreakpoint +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfBreakpoint +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfBreakpoint +impl core::convert::Into for aya::programs::perf_event::PerfBreakpoint where U: core::convert::From +pub fn aya::programs::perf_event::PerfBreakpoint::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::PerfBreakpoint where U: core::convert::Into +pub type aya::programs::perf_event::PerfBreakpoint::Error = core::convert::Infallible +pub fn aya::programs::perf_event::PerfBreakpoint::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::PerfBreakpoint where U: core::convert::TryFrom +pub type aya::programs::perf_event::PerfBreakpoint::Error = >::Error +pub fn aya::programs::perf_event::PerfBreakpoint::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfBreakpoint where T: core::clone::Clone +pub type aya::programs::perf_event::PerfBreakpoint::Owned = T +pub fn aya::programs::perf_event::PerfBreakpoint::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::PerfBreakpoint::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::PerfBreakpoint where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpoint::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::PerfBreakpoint where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpoint::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::PerfBreakpoint where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfBreakpoint::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::PerfBreakpoint where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::PerfBreakpoint::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::PerfBreakpoint +pub fn aya::programs::perf_event::PerfBreakpoint::from(t: T) -> T pub struct aya::programs::perf_event::PerfEvent impl aya::programs::perf_event::PerfEvent pub const aya::programs::perf_event::PerfEvent::PROGRAM_TYPE: aya::programs::ProgramType -pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool) -> core::result::Result +pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool, bp: core::option::Option) -> core::result::Result pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> @@ -7744,6 +7863,7 @@ impl core::clone::Clone for aya::programs::perf_event::PerfTypeId pub fn aya::programs::perf_event::PerfTypeId::clone(&self) -> aya::programs::perf_event::PerfTypeId impl core::fmt::Debug for aya::programs::perf_event::PerfTypeId pub fn aya::programs::perf_event::PerfTypeId::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::PerfTypeId impl core::marker::Freeze for aya::programs::perf_event::PerfTypeId impl core::marker::Send for aya::programs::perf_event::PerfTypeId impl core::marker::Sync for aya::programs::perf_event::PerfTypeId @@ -8037,6 +8157,7 @@ pub aya::programs::ProgramError::AttachCookieNotSupported pub aya::programs::ProgramError::Btf(aya_obj::btf::btf::BtfError) pub aya::programs::ProgramError::ExtensionError(aya::programs::extension::ExtensionError) pub aya::programs::ProgramError::IOError(std::io::error::Error) +pub aya::programs::ProgramError::IncompleteBreakpoint pub aya::programs::ProgramError::InvalidName pub aya::programs::ProgramError::InvalidName::name: alloc::string::String pub aya::programs::ProgramError::KProbeError(aya::programs::kprobe::KProbeError) @@ -9369,7 +9490,7 @@ pub fn aya::programs::lsm_cgroup::LsmCgroup::from(t: T) -> T pub struct aya::programs::PerfEvent impl aya::programs::perf_event::PerfEvent pub const aya::programs::perf_event::PerfEvent::PROGRAM_TYPE: aya::programs::ProgramType -pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool) -> core::result::Result +pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool, bp: core::option::Option) -> core::result::Result pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> diff --git a/xtask/src/codegen/aya.rs b/xtask/src/codegen/aya.rs index b8330e83..042ea9d5 100644 --- a/xtask/src/codegen/aya.rs +++ b/xtask/src/codegen/aya.rs @@ -67,6 +67,8 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<()> { .constified_enum("IFLA_.*") .constified_enum("TCA_.*") .constified_enum("BPF_RINGBUF_.*") + // PERF + .constified_enum("HW_BREAKPOINT_.*") // NETFILTER .constified_enum("NFPROTO_.*"); @@ -141,6 +143,7 @@ fn codegen_bindings(opts: &SysrootOptions, libbpf_dir: &Path) -> Result<()> { "PERF_FLAG_.*", "PERF_EVENT_.*", "PERF_MAX_.*", + "HW_BREAKPOINT_.*", // NETLINK "NLMSG_ALIGNTO", "IFLA_XDP_FD", From 8b58fc13fce1cb5f7f943864307c8a5ef4b77c9b Mon Sep 17 00:00:00 2001 From: Friday Ortiz Date: Mon, 13 Oct 2025 15:25:46 -0400 Subject: [PATCH 2/6] test: add a perf_event breakpoint test Test perf_event breakpoints by attaching a RW breakpoint to modprobe_path and triggering a read from procfs, asserting that the tgid of the program triggering the breakpoint matches the test program. --- test/integration-ebpf/Cargo.toml | 4 + test/integration-ebpf/src/perf_event_bp.rs | 24 ++++++ test/integration-test/src/lib.rs | 1 + test/integration-test/src/tests.rs | 1 + .../src/tests/perf_event_bp.rs | 81 +++++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 test/integration-ebpf/src/perf_event_bp.rs create mode 100644 test/integration-test/src/tests/perf_event_bp.rs diff --git a/test/integration-ebpf/Cargo.toml b/test/integration-ebpf/Cargo.toml index cb52e728..33715cfb 100644 --- a/test/integration-ebpf/Cargo.toml +++ b/test/integration-ebpf/Cargo.toml @@ -103,3 +103,7 @@ path = "src/xdp_sec.rs" [[bin]] name = "uprobe_cookie" path = "src/uprobe_cookie.rs" + +[[bin]] +name = "perf_event_bp" +path = "src/perf_event_bp.rs" diff --git a/test/integration-ebpf/src/perf_event_bp.rs b/test/integration-ebpf/src/perf_event_bp.rs new file mode 100644 index 00000000..f6928c01 --- /dev/null +++ b/test/integration-ebpf/src/perf_event_bp.rs @@ -0,0 +1,24 @@ +#![no_std] +#![no_main] +#![expect(unused_crate_dependencies, reason = "used in other bins")] + +use aya_ebpf::{ + EbpfContext as _, + macros::{map, perf_event}, + maps::HashMap, + programs::PerfEventContext, +}; + +#[cfg(not(test))] +extern crate ebpf_panic; + +#[map] +static READERS: HashMap = HashMap::with_max_entries(1, 0); + +#[perf_event] +fn perf_event_bp(ctx: PerfEventContext) -> u32 { + let tgid = ctx.tgid(); + let addr = unsafe { (*ctx.ctx).addr }; + let _ = READERS.insert(tgid, addr, 0); + 0 +} diff --git a/test/integration-test/src/lib.rs b/test/integration-test/src/lib.rs index 64f37d18..01e26f03 100644 --- a/test/integration-test/src/lib.rs +++ b/test/integration-test/src/lib.rs @@ -46,6 +46,7 @@ bpf_file!( MEMMOVE_TEST => "memmove_test", NAME_TEST => "name_test", PASS => "pass", + PERF_EVENT_BP => "perf_event_bp", RAW_TRACEPOINT => "raw_tracepoint", REDIRECT => "redirect", RELOCATIONS => "relocations", diff --git a/test/integration-test/src/tests.rs b/test/integration-test/src/tests.rs index b7d4d492..79122ac2 100644 --- a/test/integration-test/src/tests.rs +++ b/test/integration-test/src/tests.rs @@ -10,6 +10,7 @@ mod load; mod log; mod lsm; mod map_pin; +mod perf_event_bp; mod raw_tracepoint; mod rbpf; mod relocations; diff --git a/test/integration-test/src/tests/perf_event_bp.rs b/test/integration-test/src/tests/perf_event_bp.rs new file mode 100644 index 00000000..56d0179c --- /dev/null +++ b/test/integration-test/src/tests/perf_event_bp.rs @@ -0,0 +1,81 @@ +use std::{ + fs::{self, File}, + io::{BufRead as _, BufReader}, +}; + +use aya::{ + Ebpf, + programs::{ + PerfEventScope, PerfTypeId, SamplePolicy, + perf_event::{ + PerfBreakpoint, PerfBreakpointSize::HwBreakpointLen1, + PerfBreakpointType::HwBreakpointRW, + }, + }, + util::online_cpus, +}; +use log::info; + +// Parse /proc/kallsyms and return the address for the given symbol name, if +// found. +fn find_kallsyms_symbol(sym: &str) -> Option { + let file = File::open("/proc/kallsyms").ok()?; + let reader = BufReader::new(file); + + for line in reader.lines().map_while(Result::ok) { + // Format: " []" + let mut parts = line.split_whitespace(); + let addr_str = parts.next()?; + let _type = parts.next()?; + let name = parts.next()?; + if name == sym + && let Ok(addr) = u64::from_str_radix(addr_str, 16) + { + return Some(addr); + } + } + + None +} + +#[test_log::test] +fn perf_event_bp() { + let mut bpf = Ebpf::load(crate::PERF_EVENT_BP).unwrap(); + + let attach_addr = find_kallsyms_symbol("modprobe_path").unwrap(); + + let prog: &mut aya::programs::PerfEvent = bpf + .program_mut("perf_event_bp") + .unwrap() + .try_into() + .unwrap(); + prog.load().unwrap(); + + // attach hardware breakpoint to modprobe_path global + for cpu in online_cpus().unwrap() { + info!("attaching to cpu {cpu}"); + prog.attach( + PerfTypeId::Breakpoint, + 0u64, + PerfEventScope::AllProcessesOneCpu { cpu }, + SamplePolicy::Period(1), + true, + Some(PerfBreakpoint { + address: attach_addr, + length: HwBreakpointLen1, + type_: HwBreakpointRW, + }), + ) + .unwrap(); + } + + // trigger hardware breakpoint by reading modprobe_path via procfs + let _ = fs::read_to_string("/proc/sys/kernel/modprobe"); + + // assert that the map contains an entry for this process + let map: aya::maps::HashMap<_, u32, u64> = + aya::maps::HashMap::try_from(bpf.map_mut("READERS").unwrap()).unwrap(); + let tgid = std::process::id(); + let read_addr = map.get(&tgid, 0).unwrap(); + assert_eq!(read_addr, attach_addr); +} From 51d97a4303c1e78d3a553e189a175df8300c534a Mon Sep 17 00:00:00 2001 From: Friday Ortiz Date: Wed, 15 Oct 2025 13:24:08 -0400 Subject: [PATCH 3/6] test,xtask: include debug symbols for attaching breakpoints in tests For some reason, the aarch64 6.1 debian kernel was not compiled with CONFIG_KALLSYMS_ALL=y, and the locations of globals are not available in kallsyms. To attach breakpoints to these symbols in the test pipeline, we need to read them from System.map and apply the kaslr offset to get their real address. The System.map file is not provided in the kernel package by default, so we need to extract it from the corresponding debug package. - .github: pull the corresponding debug packages down as well as regular kernels - test: attach the perf_event_bp test breakpoint to the modprobe_path address in kallsyms if present, or by applying the kaslr offset to the System.map address if not found - xtask: preferentially extract the System.map file from the debug package, if available --- .github/scripts/download_kernel_images.sh | 17 ++ test/integration-test/Cargo.toml | 1 + .../src/tests/perf_event_bp.rs | 48 ++++- xtask/src/run.rs | 193 +++++++++++++++--- 4 files changed, 222 insertions(+), 37 deletions(-) diff --git a/.github/scripts/download_kernel_images.sh b/.github/scripts/download_kernel_images.sh index da827460..c86c6ca7 100755 --- a/.github/scripts/download_kernel_images.sh +++ b/.github/scripts/download_kernel_images.sh @@ -25,6 +25,23 @@ for VERSION in "${VERSIONS[@]}"; do exit 1 } FILES+=("$match") + + # The debug package contains the actual System.map. Debian has transitioned + # between -dbg and -dbgsym suffixes, so try both. + DEBUG_REGEX_BASE="linux-image-${VERSION//./\\.}\\.[0-9]+(-[0-9]+)?(\+bpo|\+deb[0-9]+)?-cloud-${ARCHITECTURE}-" + debug_match="" + for debug_suffix in dbg dbgsym; do + regex="${DEBUG_REGEX_BASE}${debug_suffix}_.*\\.deb" + debug_match=$(printf '%s\n' "$URLS" | grep -E "$regex" | sort -V | tail -n1 || true) + if [[ -n "$debug_match" ]]; then + break + fi + done + if [[ -z "$debug_match" ]]; then + printf 'Failed to locate debug package for VERSION=%s (tried dbg/dbgsym)\n' "$VERSION" >&2 + exit 1 + fi + FILES+=("$debug_match") done # Note: `--etag-{compare,save}` are not idempotent until curl 8.9.0 which included diff --git a/test/integration-test/Cargo.toml b/test/integration-test/Cargo.toml index 916db163..502cfcfc 100644 --- a/test/integration-test/Cargo.toml +++ b/test/integration-test/Cargo.toml @@ -23,6 +23,7 @@ aya-log = { path = "../../aya-log", version = "^0.2.1", default-features = false aya-obj = { path = "../../aya-obj", version = "^0.2.1", default-features = false } epoll = { workspace = true } futures = { workspace = true, features = ["alloc"] } +glob = { workspace = true } integration-common = { path = "../integration-common", features = ["user"] } libc = { workspace = true } log = { workspace = true } diff --git a/test/integration-test/src/tests/perf_event_bp.rs b/test/integration-test/src/tests/perf_event_bp.rs index 56d0179c..90268270 100644 --- a/test/integration-test/src/tests/perf_event_bp.rs +++ b/test/integration-test/src/tests/perf_event_bp.rs @@ -14,12 +14,43 @@ use aya::{ }, util::online_cpus, }; -use log::info; +use glob::glob; +use log::{debug, info}; + +fn find_system_map_symbol(sym: &str) -> Option { + for e in fs::read_dir("/boot").unwrap() { + let e = e.unwrap(); + debug!("found /boot/{:}", e.path().to_str().unwrap()); + } + let map = glob("/boot/System.map*") + .expect("failed to read /boot/System.map*") + .next() + .expect("no matching System.map-* file found") + .unwrap(); + let file = File::open(&map).expect("failed to open System.map"); + let reader = BufReader::new(file); + + for line in reader.lines().map_while(Result::ok) { + // Format: " []" + let mut parts = line.split_whitespace(); + let addr_str = parts.next()?; + let _type = parts.next()?; + let name = parts.next()?; + if name == sym + && let Ok(addr) = u64::from_str_radix(addr_str, 16) + { + debug!("found symbol {sym} at address {addr:#x}"); + return Some(addr); + } + } + + None +} // Parse /proc/kallsyms and return the address for the given symbol name, if // found. fn find_kallsyms_symbol(sym: &str) -> Option { - let file = File::open("/proc/kallsyms").ok()?; + let file = File::open("/proc/kallsyms").expect("failed to open /proc/kallsyms"); let reader = BufReader::new(file); for line in reader.lines().map_while(Result::ok) { @@ -41,9 +72,18 @@ fn find_kallsyms_symbol(sym: &str) -> Option { #[test_log::test] fn perf_event_bp() { let mut bpf = Ebpf::load(crate::PERF_EVENT_BP).unwrap(); + let attach_addr = if let Some(addr) = find_kallsyms_symbol("modprobe_path") { + addr + } else { + let kaslr_offset: i64 = (i128::from(find_kallsyms_symbol("_text").unwrap()) + - (i128::from(find_system_map_symbol("_text").unwrap()))) + .try_into() + .unwrap(); - let attach_addr = find_kallsyms_symbol("modprobe_path").unwrap(); - + find_system_map_symbol("modprobe_path") + .unwrap() + .wrapping_add_signed(kaslr_offset) + }; let prog: &mut aya::programs::PerfEvent = bpf .program_mut("perf_event_bp") .unwrap() diff --git a/xtask/src/run.rs b/xtask/src/run.rs index 79433217..f656bcdf 100644 --- a/xtask/src/run.rs +++ b/xtask/src/run.rs @@ -1,4 +1,5 @@ use std::{ + collections::BTreeMap, ffi::{OsStr, OsString}, fmt::Write as _, fs::{self, OpenOptions}, @@ -18,6 +19,42 @@ use xtask::{AYA_BUILD_INTEGRATION_BPF, Errors}; const GEN_INIT_CPIO_PATCH: &str = include_str!("../patches/gen_init_cpio.c.macos.diff"); +#[derive(Default)] +struct KernelPackageGroup { + kernel: Option, + debug: Option, +} + +fn extract_deb(archive: &Path, dest: &Path) -> Result<()> { + fs::create_dir_all(dest).with_context(|| format!("failed to create {}", dest.display()))?; + + let mut dpkg = Command::new("dpkg-deb"); + dpkg.arg("--fsys-tarfile") + .arg(archive) + .stdout(Stdio::piped()); + let mut dpkg_child = dpkg + .spawn() + .with_context(|| format!("failed to spawn {dpkg:?}"))?; + let Child { stdout, .. } = &mut dpkg_child; + let stdout = stdout.take().unwrap(); + let mut archive_reader = tar::Archive::new(stdout); + archive_reader.unpack(dest).with_context(|| { + format!( + "failed to unpack archive {} to {}", + archive.display(), + dest.display() + ) + })?; + let status = dpkg_child + .wait() + .with_context(|| format!("failed to wait for {dpkg:?}"))?; + if !status.success() { + bail!("{dpkg:?} exited with {status}"); + } + + Ok(()) +} + #[derive(Parser)] enum Environment { /// Runs the integration tests locally. @@ -285,40 +322,88 @@ pub(crate) fn run(opts: Options) -> Result<()> { } let extraction_root = tempfile::tempdir().context("tempdir failed")?; - let mut errors = Vec::new(); - for (index, archive) in kernel_archives.iter().enumerate() { - let archive_dir = extraction_root - .path() - .join(format!("kernel-archive-{index}")); - fs::create_dir_all(&archive_dir) - .with_context(|| format!("failed to create {}", archive_dir.display()))?; - let mut dpkg = Command::new("dpkg-deb"); - dpkg.arg("--fsys-tarfile") - .arg(archive) - .stdout(Stdio::piped()); - let mut dpkg_child = dpkg - .spawn() - .with_context(|| format!("failed to spawn {dpkg:?}"))?; - let Child { stdout, .. } = &mut dpkg_child; - let stdout = stdout.take().unwrap(); - let mut archive_reader = tar::Archive::new(stdout); - archive_reader.unpack(&archive_dir).with_context(|| { - format!( - "failed to unpack archive {} to {}", - archive.display(), - archive_dir.display() - ) + let mut package_groups: BTreeMap = BTreeMap::new(); + for archive in &kernel_archives { + let file_name = archive.file_name().ok_or_else(|| { + anyhow!("archive path missing filename: {}", archive.display()) })?; - let status = dpkg_child - .wait() - .with_context(|| format!("failed to wait for {dpkg:?}"))?; - if !status.success() { - bail!("{dpkg:?} exited with {status}"); + let file_name = file_name.to_string_lossy(); + let (package_name, _) = file_name + .split_once('_') + .ok_or_else(|| anyhow!("unexpected archive filename: {file_name}"))?; + let (base, is_debug) = if let Some(base) = package_name.strip_suffix("-dbg") { + (base, true) + } else if let Some(base) = package_name.strip_suffix("-dbgsym") { + (base, true) + } else if let Some(base) = package_name.strip_suffix("-unsigned") { + (base, false) + } else { + (package_name, false) + }; + let entry = package_groups.entry(OsString::from(base)).or_default(); + if is_debug { + entry.debug = Some(archive.clone()); + } else { + entry.kernel = Some(archive.clone()); } + } + + let mut errors = Vec::new(); + for (index, (base, group)) in package_groups.into_iter().enumerate() { + let KernelPackageGroup { kernel, debug } = group; + let base_display = base.to_string_lossy(); + let kernel_archive = + kernel.ok_or_else(|| anyhow!("missing kernel package for {base_display}"))?; + + let archive_dir = extraction_root + .path() + .join(format!("kernel-archive-{index}-image")); + extract_deb(&kernel_archive, &archive_dir)?; + + let debug_maps = if let Some(debug_archive) = debug { + let debug_dir = extraction_root + .path() + .join(format!("kernel-archive-{index}-debug")); + extract_deb(&debug_archive, &debug_dir)?; + WalkDir::new(&debug_dir) + .into_iter() + .filter_map(|entry| entry.ok()) + .filter(|entry| entry.file_type().is_file()) + .filter_map(|entry| { + let path = entry.into_path(); + let is_system_map = path + .file_name() + .map(|file_name| { + matches!( + file_name.as_encoded_bytes(), + [ + b'S', + b'y', + b's', + b't', + b'e', + b'm', + b'.', + b'm', + b'a', + b'p', + b'-', + .. + ] + ) + }) + .unwrap_or(false); + if is_system_map { Some(path) } else { None } + }) + .collect::>() + } else { + Vec::new() + }; let mut kernel_images = Vec::new(); let mut configs = Vec::new(); + let mut kernel_maps = Vec::new(); for entry in WalkDir::new(&archive_dir) { let entry = entry.with_context(|| { format!("failed to read entry in {}", archive_dir.display()) @@ -350,22 +435,59 @@ pub(crate) fn run(opts: Options) -> Result<()> { [b'c', b'o', b'n', b'f', b'i', b'g', b'-', ..] => { configs.push(path); } + // "System.map-" + [ + b'S', + b'y', + b's', + b't', + b'e', + b'm', + b'.', + b'm', + b'a', + b'p', + b'-', + .., + ] => { + kernel_maps.push(path); + } _ => {} } } } let (kernel_image, kernel_version) = match kernel_images.as_slice() { [kernel_image] => kernel_image, - [] => bail!("no kernel images in {}", archive.display()), + [] => bail!("no kernel images in {}", kernel_archive.display()), kernel_images => bail!( "multiple kernel images in {}: {:?}", - archive.display(), + kernel_archive.display(), kernel_images ), }; let config = match configs.as_slice() { [config] => config, - configs => bail!("multiple configs in {}: {:?}", archive.display(), configs), + configs => bail!( + "multiple configs in {}: {:?}", + kernel_archive.display(), + configs + ), + }; + let system_map = match debug_maps.as_slice() { + [system_map] => system_map, + [] => match kernel_maps.as_slice() { + [system_map] => system_map, + kernel_maps => bail!( + "multiple kernel System.maps in {}: {:?}", + kernel_archive.display(), + kernel_maps + ), + }, + system_maps => bail!( + "multiple debug System.maps in {}: {:?}", + kernel_archive.display(), + system_maps + ), }; let mut modules_dirs = Vec::new(); @@ -388,10 +510,10 @@ pub(crate) fn run(opts: Options) -> Result<()> { } let modules_dir = match modules_dirs.as_slice() { [modules_dir] => modules_dir, - [] => bail!("no modules directories in {}", archive.display()), + [] => bail!("no modules directories in {}", kernel_archive.display()), modules_dirs => bail!( "multiple modules directories in {}: {:?}", - archive.display(), + kernel_archive.display(), modules_dirs ), }; @@ -505,6 +627,11 @@ pub(crate) fn run(opts: Options) -> Result<()> { write_file(&Path::new("/boot").join(name), config, "644 0 0"); } + write_file(Path::new("/boot/System.map"), system_map, "644 0 0"); + if let Some(name) = system_map.file_name() { + write_file(&Path::new("/boot").join(name), system_map, "644 0 0"); + } + test_distro.iter().for_each(|(name, path)| { if name == "init" { write_file(Path::new("/init"), path, "755 0 0"); From 22d6f58e9bd26529acf222b2750b726992d56773 Mon Sep 17 00:00:00 2001 From: Friday Ortiz Date: Wed, 15 Oct 2025 18:01:29 +0000 Subject: [PATCH 4/6] test: use gunzip symbol to determine kaslr offset This symbol should appear in both kallsyms and System.map, whereas the _text symbol does not. --- test/integration-test/src/tests/perf_event_bp.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration-test/src/tests/perf_event_bp.rs b/test/integration-test/src/tests/perf_event_bp.rs index 90268270..699a4a54 100644 --- a/test/integration-test/src/tests/perf_event_bp.rs +++ b/test/integration-test/src/tests/perf_event_bp.rs @@ -75,8 +75,8 @@ fn perf_event_bp() { let attach_addr = if let Some(addr) = find_kallsyms_symbol("modprobe_path") { addr } else { - let kaslr_offset: i64 = (i128::from(find_kallsyms_symbol("_text").unwrap()) - - (i128::from(find_system_map_symbol("_text").unwrap()))) + let kaslr_offset: i64 = (i128::from(find_kallsyms_symbol("gunzip").unwrap()) + - (i128::from(find_system_map_symbol("gunzip").unwrap()))) .try_into() .unwrap(); From 4545feec9a7742e9d181fb1e1553c3968005d288 Mon Sep 17 00:00:00 2001 From: Friday Ortiz Date: Wed, 15 Oct 2025 16:43:00 -0400 Subject: [PATCH 5/6] aya,test,xtask: add breakpoint support to enforced perf_event config combo branch * aya: enforce valid perf_event type & config combos Add guardrails for when setting event type and config for perf_event programs. The `PerfEventConfig` enum now defines the event `type` and `config` of interest. Remove public re-exports, and add idiomatic Rust types for: - perf_hw_id => HardwareEvent - perf_sw_ids => SoftwareEvent - perf_hw_cache_id => HwCacheEvent - perf_hw_cache_op_id => HwCacheOp - perf_hw_cache_op_result_id => HwCacheResult The motivation behind this is mainly for the `type` and `config` fields of `bpf_link_info.perf_event.event`. The newly added enums are planned to also be used in the `bpf_link_info` metadata. Although `Breakpoint`/`PERF_TYPE_BREAKPOINT` variant exists, it is not fully implemented. It's only usage at the moment is in link info. * add breakpoint support to perf_event config interface --------- Co-authored-by: Tyrone Wu --- aya/src/programs/mod.rs | 2 +- aya/src/programs/perf_event.rs | 408 +++++++++++++++--- aya/src/sys/perf_event.rs | 26 +- .../src/tests/perf_event_bp.rs | 18 +- xtask/public-api/aya.txt | 382 ++++++++++------ 5 files changed, 626 insertions(+), 210 deletions(-) diff --git a/aya/src/programs/mod.rs b/aya/src/programs/mod.rs index 13db6144..9b3f530f 100644 --- a/aya/src/programs/mod.rs +++ b/aya/src/programs/mod.rs @@ -111,7 +111,7 @@ pub use crate::programs::{ lirc_mode2::LircMode2, lsm::Lsm, lsm_cgroup::LsmCgroup, - perf_event::{PerfEvent, PerfEventScope, PerfTypeId, SamplePolicy}, + perf_event::{PerfEvent, PerfEventScope, SamplePolicy}, probe::ProbeKind, raw_trace_point::RawTracePoint, sk_lookup::SkLookup, diff --git a/aya/src/programs/perf_event.rs b/aya/src/programs/perf_event.rs index c30ed8ea..ec581dc9 100644 --- a/aya/src/programs/perf_event.rs +++ b/aya/src/programs/perf_event.rs @@ -8,14 +8,13 @@ use aya_obj::generated::{ HW_BREAKPOINT_LEN_7, HW_BREAKPOINT_LEN_8, HW_BREAKPOINT_R, HW_BREAKPOINT_RW, HW_BREAKPOINT_W, HW_BREAKPOINT_X, bpf_link_type, bpf_prog_type::BPF_PROG_TYPE_PERF_EVENT, + perf_hw_cache_id, perf_hw_cache_op_id, perf_hw_cache_op_result_id, perf_hw_id, perf_sw_ids, + perf_type_id, perf_type_id::{ PERF_TYPE_BREAKPOINT, PERF_TYPE_HARDWARE, PERF_TYPE_HW_CACHE, PERF_TYPE_RAW, PERF_TYPE_SOFTWARE, PERF_TYPE_TRACEPOINT, }, }; -pub use aya_obj::generated::{ - perf_hw_cache_id, perf_hw_cache_op_id, perf_hw_cache_op_result_id, perf_hw_id, perf_sw_ids, -}; use crate::{ programs::{ @@ -27,34 +26,268 @@ use crate::{ sys::{SyscallError, bpf_link_get_info_by_fd, perf_event_open}, }; -/// The type of perf event +/// The type of perf event and their respective configuration. +#[doc(alias = "perf_type_id")] +#[derive(Debug, Clone, Copy)] +pub enum PerfEventConfig { + /// The hardware event to report. + #[doc(alias = "PERF_TYPE_HARDWARE")] + Hardware(HardwareEvent), + /// The software event to report. + #[doc(alias = "PERF_TYPE_SOFTWARE")] + Software(SoftwareEvent), + /// The kernel trace point event to report. + #[doc(alias = "PERF_TYPE_TRACEPOINT")] + TracePoint { + /// The ID of the tracing event. This can be obtained from + /// `/sys/kernel/debug/tracing/events/*/*/id` if `ftrace` is enabled in the kernel. + event_id: u64, + }, + /// The hardware cache event to report. + #[doc(alias = "PERF_TYPE_HW_CACHE")] + HwCache { + /// The hardware cache event. + event: HwCacheEvent, + /// The hardware cache operation. + operation: HwCacheOp, + /// The hardware cache result of interest. + result: HwCacheResult, + }, + /// The "raw" implementation-specific event to report. + #[doc(alias = "PERF_TYPE_RAW")] + Raw { + /// The "raw" event value, which is not covered by the "generalized" events. This is CPU + /// implementation defined events. + event_id: u64, + }, + /// A hardware breakpoint. + #[doc(alias = "PERF_TYPE_BREAKPOINT")] + Breakpoint { + /// The address to set the breakpoint on + address: u64, + /// The breakpoint size. For HwBreakpointX this must be sizeof(long). For + /// all other types it should be one of HwBreakpointLen1, HwBreakpointLen2,, + /// HwBreakpointLen4 or HwBreakpointLen8. + length: PerfBreakpointSize, + /// The breakpoint type, one of HW_BREAKPOINT_{R,W,RW,X} + type_: PerfBreakpointType, + }, + /// The dynamic PMU (Performance Monitor Unit) event to report. + /// + /// Available PMU's may be found under `/sys/bus/event_source/devices`. + Pmu { + /// The PMU type. + /// + /// This value can extracted from `/sys/bus/event_source/devices/*/type`. + pmu_type: u32, + /// The PMU config option. + /// + /// This value can extracted from `/sys/bus/event_source/devices/*/format/`, where the + /// `config:` indicates the bit position to set. + /// + /// For example, `config:3` => `config = 1 << 3`. + config: u64, + }, +} + +macro_rules! impl_to_u32 { + ($($t:ty, $fn:ident),*) => { + $(const fn $fn(id: $t) -> u32 { + const _: [(); 4] = [(); std::mem::size_of::<$t>()]; + id as u32 + })* + }; +} + +impl_to_u32!( + perf_hw_id, + perf_hw_id_to_u32, + perf_sw_ids, + perf_sw_ids_to_u32, + perf_hw_cache_id, + perf_hw_cache_id_to_u32, + perf_hw_cache_op_id, + perf_hw_cache_op_id_to_u32, + perf_hw_cache_op_result_id, + perf_hw_cache_op_result_id_to_u32, + perf_type_id, + perf_type_id_to_u32 +); + +/// The "generalized" hardware CPU events provided by the kernel. +#[doc(alias = "perf_hw_id")] +#[derive(Debug, Clone, Copy)] #[repr(u32)] +pub enum HardwareEvent { + /// The total CPU cycles. + #[doc(alias = "PERF_COUNT_HW_CPU_CYCLES")] + CpuCycles = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_CPU_CYCLES), + /// Number of retired instructions. + #[doc(alias = "PERF_COUNT_HW_INSTRUCTIONS")] + Instructions = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_INSTRUCTIONS), + /// Number of cache accesses. + #[doc(alias = "PERF_COUNT_HW_CACHE_REFERENCES")] + CacheReferences = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_CACHE_REFERENCES), + /// Number of cache misses. + #[doc(alias = "PERF_COUNT_HW_CACHE_MISSES")] + CacheMisses = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_CACHE_MISSES), + /// Number of retired branch instructions. + #[doc(alias = "PERF_COUNT_HW_BRANCH_INSTRUCTIONS")] + BranchInstructions = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_BRANCH_INSTRUCTIONS), + /// Number of mispredicted branch instructions. + #[doc(alias = "PERF_COUNT_HW_BRANCH_MISSES")] + BranchMisses = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_BRANCH_MISSES), + /// Number of bus cycles. + #[doc(alias = "PERF_COUNT_HW_BUS_CYCLES")] + BusCycles = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_BUS_CYCLES), + /// Number of stalled cycles during issue. + #[doc(alias = "PERF_COUNT_HW_STALLED_CYCLES_FRONTEND")] + StalledCyclesFrontend = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_STALLED_CYCLES_FRONTEND), + /// Number of stalled cycles during retirement. + #[doc(alias = "PERF_COUNT_HW_STALLED_CYCLES_BACKEND")] + StalledCyclesBackend = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_STALLED_CYCLES_BACKEND), + /// The total CPU cycles, which is not affected by CPU frequency scaling. + #[doc(alias = "PERF_COUNT_HW_REF_CPU_CYCLES")] + RefCpuCycles = perf_hw_id_to_u32(perf_hw_id::PERF_COUNT_HW_REF_CPU_CYCLES), +} + +impl HardwareEvent { + const fn into_primitive(self) -> u32 { + const _: [(); 4] = [(); std::mem::size_of::()]; + self as u32 + } +} + +/// The software-defined events provided by the kernel. +#[doc(alias = "perf_sw_ids")] #[derive(Debug, Clone, Copy)] -pub enum PerfTypeId { - /// PERF_TYPE_HARDWARE - Hardware = PERF_TYPE_HARDWARE as u32, - /// PERF_TYPE_SOFTWARE - Software = PERF_TYPE_SOFTWARE as u32, - /// PERF_TYPE_TRACEPOINT - TracePoint = PERF_TYPE_TRACEPOINT as u32, - /// PERF_TYPE_HW_CACHE - HwCache = PERF_TYPE_HW_CACHE as u32, - /// PERF_TYPE_RAW - Raw = PERF_TYPE_RAW as u32, - /// PERF_TYPE_BREAKPOINT - Breakpoint = PERF_TYPE_BREAKPOINT as u32, +#[repr(u32)] +pub enum SoftwareEvent { + /// The CPU clock timer. + #[doc(alias = "PERF_COUNT_SW_CPU_CLOCK")] + CpuClock = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_CPU_CLOCK), + /// The clock count specific to the task that is running. + #[doc(alias = "PERF_COUNT_SW_TASK_CLOCK")] + TaskClock = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_TASK_CLOCK), + /// Number of page faults. + #[doc(alias = "PERF_COUNT_SW_PAGE_FAULTS")] + PageFaults = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_PAGE_FAULTS), + /// Numer of context switches. + #[doc(alias = "PERF_COUNT_SW_CONTEXT_SWITCHES")] + ContextSwitches = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_CONTEXT_SWITCHES), + /// Number of times the process has migrated to a new CPU. + #[doc(alias = "PERF_COUNT_SW_CPU_MIGRATIONS")] + CpuMigrations = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_CPU_MIGRATIONS), + /// Number of minor page faults. + #[doc(alias = "PERF_COUNT_SW_PAGE_FAULTS_MIN")] + PageFaultsMin = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_PAGE_FAULTS_MIN), + /// Number of major page faults. + #[doc(alias = "PERF_COUNT_SW_PAGE_FAULTS_MAJ")] + PageFaultsMaj = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_PAGE_FAULTS_MAJ), + /// Number of alignment faults. + #[doc(alias = "PERF_COUNT_SW_ALIGNMENT_FAULTS")] + AlignmentFaults = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_ALIGNMENT_FAULTS), + /// Number of emulation faults. + #[doc(alias = "PERF_COUNT_SW_EMULATION_FAULTS")] + EmulationFaults = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_EMULATION_FAULTS), + /// Placeholder event that counts nothing. + #[doc(alias = "PERF_COUNT_SW_DUMMY")] + Dummy = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_DUMMY), + /// Generates raw sample data from BPF. + #[doc(alias = "PERF_COUNT_SW_BPF_OUTPUT")] + BpfOutput = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_BPF_OUTPUT), + /// Number of context switches to a task when switching to a different cgroup. + #[doc(alias = "PERF_COUNT_SW_CGROUP_SWITCHES")] + CgroupSwitches = perf_sw_ids_to_u32(perf_sw_ids::PERF_COUNT_SW_CGROUP_SWITCHES), } -/// A hardware breakpoint configuration -#[derive(Debug, Clone)] -pub struct PerfBreakpoint { - /// The address to set the breakpoint on - pub address: u64, - /// The breakpoint size. For HwBreakpointX this must be sizeof(long). For - /// all other types it should be one of HwBreakpointLen1, HwBreakpointLen2,, - /// HwBreakpointLen4 or HwBreakpointLen8. - pub length: PerfBreakpointSize, - /// The breakpoint type, one of HW_BREAKPOINT_{R,W,RW,X} - pub type_: PerfBreakpointType, + +impl SoftwareEvent { + const fn into_primitive(self) -> u32 { + const _: [(); 4] = [(); std::mem::size_of::()]; + self as u32 + } +} + +/// The hardware CPU cache events. +#[doc(alias = "perf_hw_cache_id")] +#[derive(Debug, Clone, Copy)] +#[repr(u32)] +pub enum HwCacheEvent { + /// Measures Level 1 data cache. + #[doc(alias = "PERF_COUNT_HW_CACHE_L1D")] + L1d = perf_hw_cache_id_to_u32(perf_hw_cache_id::PERF_COUNT_HW_CACHE_L1D), + /// Measures Level 1 data cache. + #[doc(alias = "PERF_COUNT_HW_CACHE_L1I")] + L1i = perf_hw_cache_id_to_u32(perf_hw_cache_id::PERF_COUNT_HW_CACHE_L1I), + /// Measures Last-level cache. + #[doc(alias = "PERF_COUNT_HW_CACHE_LL")] + Ll = perf_hw_cache_id_to_u32(perf_hw_cache_id::PERF_COUNT_HW_CACHE_LL), + /// Measures Data TLB (Translation Lookaside Buffer). + #[doc(alias = "PERF_COUNT_HW_CACHE_DTLB")] + Dtlb = perf_hw_cache_id_to_u32(perf_hw_cache_id::PERF_COUNT_HW_CACHE_DTLB), + /// Measures Instruction TLB (Translation Lookaside Buffer). + #[doc(alias = "PERF_COUNT_HW_CACHE_ITLB")] + Itlb = perf_hw_cache_id_to_u32(perf_hw_cache_id::PERF_COUNT_HW_CACHE_ITLB), + /// Measures branch prediction. + #[doc(alias = "PERF_COUNT_HW_CACHE_BPU")] + Bpu = perf_hw_cache_id_to_u32(perf_hw_cache_id::PERF_COUNT_HW_CACHE_BPU), + /// Measures local memory accesses. + #[doc(alias = "PERF_COUNT_HW_CACHE_NODE")] + Node = perf_hw_cache_id_to_u32(perf_hw_cache_id::PERF_COUNT_HW_CACHE_NODE), +} + +impl HwCacheEvent { + const fn into_primitive(self) -> u32 { + const _: [(); 4] = [(); std::mem::size_of::()]; + self as u32 + } +} + +/// The hardware CPU cache operations. +#[doc(alias = "perf_hw_cache_op_id")] +#[derive(Debug, Clone, Copy)] +#[repr(u32)] +pub enum HwCacheOp { + /// Read access. + #[doc(alias = "PERF_COUNT_HW_CACHE_OP_READ")] + Read = perf_hw_cache_op_id_to_u32(perf_hw_cache_op_id::PERF_COUNT_HW_CACHE_OP_READ), + /// Write access. + #[doc(alias = "PERF_COUNT_HW_CACHE_OP_WRITE")] + Write = perf_hw_cache_op_id_to_u32(perf_hw_cache_op_id::PERF_COUNT_HW_CACHE_OP_WRITE), + /// Prefetch access. + #[doc(alias = "PERF_COUNT_HW_CACHE_OP_PREFETCH")] + Prefetch = perf_hw_cache_op_id_to_u32(perf_hw_cache_op_id::PERF_COUNT_HW_CACHE_OP_PREFETCH), +} + +impl HwCacheOp { + const fn into_primitive(self) -> u32 { + const _: [(); 4] = [(); std::mem::size_of::()]; + self as u32 + } +} + +/// The hardware CPU cache result. +#[doc(alias = "perf_hw_cache_op_result_id")] +#[derive(Debug, Clone, Copy)] +#[repr(u32)] +pub enum HwCacheResult { + /// Cache accesses. + #[doc(alias = "PERF_COUNT_HW_CACHE_RESULT_ACCESS")] + Access = perf_hw_cache_op_result_id_to_u32( + perf_hw_cache_op_result_id::PERF_COUNT_HW_CACHE_RESULT_ACCESS, + ), + /// Cache missed accesses. + #[doc(alias = "PERF_COUNT_HW_CACHE_RESULT_MISS")] + Miss = perf_hw_cache_op_result_id_to_u32( + perf_hw_cache_op_result_id::PERF_COUNT_HW_CACHE_RESULT_MISS, + ), +} + +impl HwCacheResult { + const fn into_primitive(self) -> u32 { + const _: [(); 4] = [(); std::mem::size_of::()]; + self as u32 + } } /// Type of hardware breakpoint, determines if we break on read, write, or execute. @@ -62,39 +295,67 @@ pub struct PerfBreakpoint { #[derive(Debug, Clone, Copy)] pub enum PerfBreakpointType { /// HW_BREAKPOINT_EMPTY + #[doc(alias = "HW_BREAKPOINT_EMPTY")] HwBreakpointEmpty = HW_BREAKPOINT_EMPTY, /// HW_BREAKPOINT_R + #[doc(alias = "HW_BREAKPOINT_R")] HwBreakpointR = HW_BREAKPOINT_R, /// HW_BREAKPOINT_W + #[doc(alias = "HW_BREAKPOINT_W")] HwBreakpointW = HW_BREAKPOINT_W, /// HW_BREAKPOINT_RW + #[doc(alias = "HW_BREAKPOINT_RW")] HwBreakpointRW = HW_BREAKPOINT_RW, /// HW_BREAKPOINT_X + #[doc(alias = "HW_BREAKPOINT_X")] HwBreakpointX = HW_BREAKPOINT_X, /// HW_BREAKPOINT_INVALID + #[doc(alias = "HW_BREAKPOINT_INVALID")] HwBreakpointInvalid = HW_BREAKPOINT_INVALID, } +impl PerfBreakpointType { + pub(crate) const fn into_primitive(self) -> u32 { + const _: [(); 4] = [(); std::mem::size_of::()]; + self as u32 + } +} + /// The size of the breakpoint being measured -#[repr(u32)] +#[repr(u64)] #[derive(Debug, Clone, Copy)] pub enum PerfBreakpointSize { /// HW_BREAKPOINT_LEN_1 - HwBreakpointLen1 = HW_BREAKPOINT_LEN_1, + #[doc(alias = "HW_BREAKPOINT_LEN_1")] + HwBreakpointLen1 = HW_BREAKPOINT_LEN_1 as u64, /// HW_BREAKPOINT_LEN_2 - HwBreakpointLen2 = HW_BREAKPOINT_LEN_2, + #[doc(alias = "HW_BREAKPOINT_LEN_2")] + HwBreakpointLen2 = HW_BREAKPOINT_LEN_2 as u64, /// HW_BREAKPOINT_LEN_3 - HwBreakpointLen3 = HW_BREAKPOINT_LEN_3, + #[doc(alias = "HW_BREAKPOINT_LEN_3")] + HwBreakpointLen3 = HW_BREAKPOINT_LEN_3 as u64, /// HW_BREAKPOINT_LEN_4 - HwBreakpointLen4 = HW_BREAKPOINT_LEN_4, + #[doc(alias = "HW_BREAKPOINT_LEN_4")] + HwBreakpointLen4 = HW_BREAKPOINT_LEN_4 as u64, /// HW_BREAKPOINT_LEN_5 - HwBreakpointLen5 = HW_BREAKPOINT_LEN_5, + #[doc(alias = "HW_BREAKPOINT_LEN_5")] + HwBreakpointLen5 = HW_BREAKPOINT_LEN_5 as u64, /// HW_BREAKPOINT_LEN_6 - HwBreakpointLen6 = HW_BREAKPOINT_LEN_6, + #[doc(alias = "HW_BREAKPOINT_LEN_6")] + HwBreakpointLen6 = HW_BREAKPOINT_LEN_6 as u64, /// HW_BREAKPOINT_LEN_7 - HwBreakpointLen7 = HW_BREAKPOINT_LEN_7, + #[doc(alias = "HW_BREAKPOINT_LEN_7")] + HwBreakpointLen7 = HW_BREAKPOINT_LEN_7 as u64, /// HW_BREAKPOINT_LEN_8 - HwBreakpointLen8 = HW_BREAKPOINT_LEN_8, + #[doc(alias = "HW_BREAKPOINT_LEN_8")] + HwBreakpointLen8 = HW_BREAKPOINT_LEN_8 as u64, +} + +impl PerfBreakpointSize { + pub(crate) const fn into_primitive(self) -> u64 { + const _: [(); 8] = [(); std::mem::size_of::()]; + self as u64 + } } /// Sample Policy @@ -155,23 +416,24 @@ pub enum PerfEventScope { /// # #[error(transparent)] /// # Ebpf(#[from] aya::EbpfError) /// # } -/// # let mut bpf = aya::Ebpf::load(&[])?; -/// use aya::util::online_cpus; -/// use aya::programs::perf_event::{ -/// perf_sw_ids::PERF_COUNT_SW_CPU_CLOCK, PerfEvent, PerfEventScope, PerfTypeId, SamplePolicy, +/// use aya::{ +/// util::online_cpus, +/// programs::perf_event::{ +/// PerfEvent, PerfEventConfig, PerfEventScope, SamplePolicy, SoftwareEvent, +/// }, /// }; /// +/// # let mut bpf = aya::Ebpf::load(&[])?; /// let prog: &mut PerfEvent = bpf.program_mut("observe_cpu_clock").unwrap().try_into()?; /// prog.load()?; /// +/// let perf_type = PerfEventConfig::Software(SoftwareEvent::CpuClock); /// for cpu in online_cpus().map_err(|(_, error)| error)? { /// prog.attach( -/// PerfTypeId::Software, -/// PERF_COUNT_SW_CPU_CLOCK as u64, +/// perf_type, /// PerfEventScope::AllProcessesOneCpu { cpu }, /// SamplePolicy::Period(1000000), /// true, -/// None /// )?; /// } /// # Ok::<(), Error>(()) @@ -193,31 +455,54 @@ impl PerfEvent { /// Attaches to the given perf event. /// - /// The possible values and encoding of the `config` argument depends on the - /// `perf_type`. See `perf_sw_ids`, `perf_hw_id`, `perf_hw_cache_id`, - /// `perf_hw_cache_op_id` and `perf_hw_cache_op_result_id`. + /// [`perf_config`](PerfEventConfig) defines the event `type` and `config` of + /// interest. /// - /// The `bp` option must be specified if `perf_type` is `Breakpoint`. - /// - /// The `scope` argument determines which processes are sampled. If - /// `inherit` is true, any new processes spawned by those processes will - /// also automatically get sampled. + /// [`scope`](PerfEventScope) determines which processes are sampled. If + /// `inherit` is `true`, any new processes spawned by those processes will + /// also automatically be sampled. /// /// The returned value can be used to detach, see [PerfEvent::detach]. pub fn attach( &mut self, - perf_type: PerfTypeId, - config: u64, + perf_config: PerfEventConfig, scope: PerfEventScope, sample_policy: SamplePolicy, inherit: bool, - bp: Option, ) -> Result { - if matches!(perf_type, PerfTypeId::Breakpoint) && bp.is_none() { - return Err(ProgramError::IncompleteBreakpoint); - } let prog_fd = self.fd()?; let prog_fd = prog_fd.as_fd(); + + let (perf_type, config) = match perf_config { + PerfEventConfig::Pmu { pmu_type, config } => (pmu_type, config), + PerfEventConfig::Hardware(hw_event) => ( + perf_type_id_to_u32(PERF_TYPE_HARDWARE), + u64::from(hw_event.into_primitive()), + ), + PerfEventConfig::Software(sw_event) => ( + perf_type_id_to_u32(PERF_TYPE_SOFTWARE), + u64::from(sw_event.into_primitive()), + ), + PerfEventConfig::TracePoint { event_id } => { + (perf_type_id_to_u32(PERF_TYPE_TRACEPOINT), event_id) + } + PerfEventConfig::HwCache { + event, + operation, + result, + } => ( + perf_type_id_to_u32(PERF_TYPE_HW_CACHE), + u64::from(event.into_primitive()) + | (u64::from(operation.into_primitive()) << 8) + | (u64::from(result.into_primitive()) << 16), + ), + PerfEventConfig::Raw { event_id } => (perf_type_id_to_u32(PERF_TYPE_RAW), event_id), + PerfEventConfig::Breakpoint { + address: _, + length: _, + type_: _, + } => (perf_type_id_to_u32(PERF_TYPE_BREAKPOINT), 0), + }; let (sample_period, sample_frequency) = match sample_policy { SamplePolicy::Period(period) => (period, None), SamplePolicy::Frequency(frequency) => (0, Some(frequency)), @@ -230,16 +515,17 @@ impl PerfEvent { PerfEventScope::AllProcessesOneCpu { cpu } => (-1, cpu as i32), }; let fd = perf_event_open( - perf_type as u32, + perf_type, config, pid, cpu, sample_period, sample_frequency, - matches!(perf_type, PerfTypeId::Breakpoint), + // wakeup=true for breakpoints, false for all other types + perf_type == perf_type_id_to_u32(PERF_TYPE_BREAKPOINT), inherit, 0, - bp, + Some(perf_config), ) .map_err(|io_error| SyscallError { call: "perf_event_open", diff --git a/aya/src/sys/perf_event.rs b/aya/src/sys/perf_event.rs index 19651b47..33941598 100644 --- a/aya/src/sys/perf_event.rs +++ b/aya/src/sys/perf_event.rs @@ -13,7 +13,7 @@ use aya_obj::generated::{ use libc::pid_t; use super::{PerfEventIoctlRequest, Syscall, syscall}; -use crate::programs::{PerfTypeId, perf_event::PerfBreakpoint}; +use crate::programs::perf_event::PerfEventConfig; #[expect(clippy::too_many_arguments)] pub(crate) fn perf_event_open( @@ -26,7 +26,7 @@ pub(crate) fn perf_event_open( wakeup: bool, inherit: bool, flags: u32, - bp: Option, + perf_config: Option, ) -> io::Result { let mut attr = unsafe { mem::zeroed::() }; @@ -44,18 +44,16 @@ pub(crate) fn perf_event_open( attr.__bindgen_anon_1.sample_period = sample_period; } - if perf_type == (PerfTypeId::Breakpoint as u32) { - if let Some(bp) = bp { - attr.bp_type = bp.type_ as u32; - attr.__bindgen_anon_3.bp_addr = bp.address; - attr.__bindgen_anon_4.bp_len = bp.length as u64; - attr.set_precise_ip(2); - } else { - return Err(io::Error::new( - io::ErrorKind::InvalidInput, - "perf_type Breakpoint requires a PerfBreakpoint", - )); - } + if let Some(PerfEventConfig::Breakpoint { + address, + length, + type_, + }) = perf_config + { + attr.bp_type = type_.into_primitive(); + attr.__bindgen_anon_3.bp_addr = address; + attr.__bindgen_anon_4.bp_len = length.into_primitive(); + attr.set_precise_ip(2); } perf_event_sys(attr, pid, cpu, flags) diff --git a/test/integration-test/src/tests/perf_event_bp.rs b/test/integration-test/src/tests/perf_event_bp.rs index 699a4a54..bbeb86f2 100644 --- a/test/integration-test/src/tests/perf_event_bp.rs +++ b/test/integration-test/src/tests/perf_event_bp.rs @@ -6,10 +6,10 @@ use std::{ use aya::{ Ebpf, programs::{ - PerfEventScope, PerfTypeId, SamplePolicy, + PerfEventScope, SamplePolicy, perf_event::{ - PerfBreakpoint, PerfBreakpointSize::HwBreakpointLen1, - PerfBreakpointType::HwBreakpointRW, + PerfBreakpointSize::HwBreakpointLen1, PerfBreakpointType::HwBreakpointRW, + PerfEventConfig, }, }, util::online_cpus, @@ -95,16 +95,14 @@ fn perf_event_bp() { for cpu in online_cpus().unwrap() { info!("attaching to cpu {cpu}"); prog.attach( - PerfTypeId::Breakpoint, - 0u64, - PerfEventScope::AllProcessesOneCpu { cpu }, - SamplePolicy::Period(1), - true, - Some(PerfBreakpoint { + PerfEventConfig::Breakpoint { address: attach_addr, length: HwBreakpointLen1, type_: HwBreakpointRW, - }), + }, + PerfEventScope::AllProcessesOneCpu { cpu }, + SamplePolicy::Period(1), + true, ) .unwrap(); } diff --git a/xtask/public-api/aya.txt b/xtask/public-api/aya.txt index 87a2d43e..2390f95d 100644 --- a/xtask/public-api/aya.txt +++ b/xtask/public-api/aya.txt @@ -5293,12 +5293,165 @@ pub fn aya::programs::perf_attach::PerfLinkId::borrow_mut(&mut self) -> &mut T impl core::convert::From for aya::programs::perf_attach::PerfLinkId pub fn aya::programs::perf_attach::PerfLinkId::from(t: T) -> T pub mod aya::programs::perf_event -pub use aya::programs::perf_event::perf_hw_cache_id -pub use aya::programs::perf_event::perf_hw_cache_op_id -pub use aya::programs::perf_event::perf_hw_cache_op_result_id -pub use aya::programs::perf_event::perf_hw_id -pub use aya::programs::perf_event::perf_sw_ids -#[repr(u32)] pub enum aya::programs::perf_event::PerfBreakpointSize +#[repr(u32)] pub enum aya::programs::perf_event::HardwareEvent +pub aya::programs::perf_event::HardwareEvent::BranchInstructions = 4 +pub aya::programs::perf_event::HardwareEvent::BranchMisses = 5 +pub aya::programs::perf_event::HardwareEvent::BusCycles = 6 +pub aya::programs::perf_event::HardwareEvent::CacheMisses = 3 +pub aya::programs::perf_event::HardwareEvent::CacheReferences = 2 +pub aya::programs::perf_event::HardwareEvent::CpuCycles = 0 +pub aya::programs::perf_event::HardwareEvent::Instructions = 1 +pub aya::programs::perf_event::HardwareEvent::RefCpuCycles = 9 +pub aya::programs::perf_event::HardwareEvent::StalledCyclesBackend = 8 +pub aya::programs::perf_event::HardwareEvent::StalledCyclesFrontend = 7 +impl core::clone::Clone for aya::programs::perf_event::HardwareEvent +pub fn aya::programs::perf_event::HardwareEvent::clone(&self) -> aya::programs::perf_event::HardwareEvent +impl core::fmt::Debug for aya::programs::perf_event::HardwareEvent +pub fn aya::programs::perf_event::HardwareEvent::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::HardwareEvent +impl core::marker::Freeze for aya::programs::perf_event::HardwareEvent +impl core::marker::Send for aya::programs::perf_event::HardwareEvent +impl core::marker::Sync for aya::programs::perf_event::HardwareEvent +impl core::marker::Unpin for aya::programs::perf_event::HardwareEvent +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::HardwareEvent +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::HardwareEvent +impl core::convert::Into for aya::programs::perf_event::HardwareEvent where U: core::convert::From +pub fn aya::programs::perf_event::HardwareEvent::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::HardwareEvent where U: core::convert::Into +pub type aya::programs::perf_event::HardwareEvent::Error = core::convert::Infallible +pub fn aya::programs::perf_event::HardwareEvent::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::HardwareEvent where U: core::convert::TryFrom +pub type aya::programs::perf_event::HardwareEvent::Error = >::Error +pub fn aya::programs::perf_event::HardwareEvent::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::HardwareEvent where T: core::clone::Clone +pub type aya::programs::perf_event::HardwareEvent::Owned = T +pub fn aya::programs::perf_event::HardwareEvent::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::HardwareEvent::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::HardwareEvent where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::HardwareEvent::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::HardwareEvent where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HardwareEvent::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::HardwareEvent where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HardwareEvent::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::HardwareEvent where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::HardwareEvent::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::HardwareEvent +pub fn aya::programs::perf_event::HardwareEvent::from(t: T) -> T +#[repr(u32)] pub enum aya::programs::perf_event::HwCacheEvent +pub aya::programs::perf_event::HwCacheEvent::Bpu = 5 +pub aya::programs::perf_event::HwCacheEvent::Dtlb = 3 +pub aya::programs::perf_event::HwCacheEvent::Itlb = 4 +pub aya::programs::perf_event::HwCacheEvent::L1d = 0 +pub aya::programs::perf_event::HwCacheEvent::L1i = 1 +pub aya::programs::perf_event::HwCacheEvent::Ll = 2 +pub aya::programs::perf_event::HwCacheEvent::Node = 6 +impl core::clone::Clone for aya::programs::perf_event::HwCacheEvent +pub fn aya::programs::perf_event::HwCacheEvent::clone(&self) -> aya::programs::perf_event::HwCacheEvent +impl core::fmt::Debug for aya::programs::perf_event::HwCacheEvent +pub fn aya::programs::perf_event::HwCacheEvent::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::HwCacheEvent +impl core::marker::Freeze for aya::programs::perf_event::HwCacheEvent +impl core::marker::Send for aya::programs::perf_event::HwCacheEvent +impl core::marker::Sync for aya::programs::perf_event::HwCacheEvent +impl core::marker::Unpin for aya::programs::perf_event::HwCacheEvent +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::HwCacheEvent +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::HwCacheEvent +impl core::convert::Into for aya::programs::perf_event::HwCacheEvent where U: core::convert::From +pub fn aya::programs::perf_event::HwCacheEvent::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::HwCacheEvent where U: core::convert::Into +pub type aya::programs::perf_event::HwCacheEvent::Error = core::convert::Infallible +pub fn aya::programs::perf_event::HwCacheEvent::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::HwCacheEvent where U: core::convert::TryFrom +pub type aya::programs::perf_event::HwCacheEvent::Error = >::Error +pub fn aya::programs::perf_event::HwCacheEvent::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::HwCacheEvent where T: core::clone::Clone +pub type aya::programs::perf_event::HwCacheEvent::Owned = T +pub fn aya::programs::perf_event::HwCacheEvent::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::HwCacheEvent::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::HwCacheEvent where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheEvent::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::HwCacheEvent where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheEvent::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::HwCacheEvent where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheEvent::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::HwCacheEvent where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::HwCacheEvent::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::HwCacheEvent +pub fn aya::programs::perf_event::HwCacheEvent::from(t: T) -> T +#[repr(u32)] pub enum aya::programs::perf_event::HwCacheOp +pub aya::programs::perf_event::HwCacheOp::Prefetch = 2 +pub aya::programs::perf_event::HwCacheOp::Read = 0 +pub aya::programs::perf_event::HwCacheOp::Write = 1 +impl core::clone::Clone for aya::programs::perf_event::HwCacheOp +pub fn aya::programs::perf_event::HwCacheOp::clone(&self) -> aya::programs::perf_event::HwCacheOp +impl core::fmt::Debug for aya::programs::perf_event::HwCacheOp +pub fn aya::programs::perf_event::HwCacheOp::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::HwCacheOp +impl core::marker::Freeze for aya::programs::perf_event::HwCacheOp +impl core::marker::Send for aya::programs::perf_event::HwCacheOp +impl core::marker::Sync for aya::programs::perf_event::HwCacheOp +impl core::marker::Unpin for aya::programs::perf_event::HwCacheOp +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::HwCacheOp +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::HwCacheOp +impl core::convert::Into for aya::programs::perf_event::HwCacheOp where U: core::convert::From +pub fn aya::programs::perf_event::HwCacheOp::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::HwCacheOp where U: core::convert::Into +pub type aya::programs::perf_event::HwCacheOp::Error = core::convert::Infallible +pub fn aya::programs::perf_event::HwCacheOp::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::HwCacheOp where U: core::convert::TryFrom +pub type aya::programs::perf_event::HwCacheOp::Error = >::Error +pub fn aya::programs::perf_event::HwCacheOp::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::HwCacheOp where T: core::clone::Clone +pub type aya::programs::perf_event::HwCacheOp::Owned = T +pub fn aya::programs::perf_event::HwCacheOp::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::HwCacheOp::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::HwCacheOp where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheOp::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::HwCacheOp where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheOp::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::HwCacheOp where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheOp::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::HwCacheOp where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::HwCacheOp::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::HwCacheOp +pub fn aya::programs::perf_event::HwCacheOp::from(t: T) -> T +#[repr(u32)] pub enum aya::programs::perf_event::HwCacheResult +pub aya::programs::perf_event::HwCacheResult::Access = 0 +pub aya::programs::perf_event::HwCacheResult::Miss = 1 +impl core::clone::Clone for aya::programs::perf_event::HwCacheResult +pub fn aya::programs::perf_event::HwCacheResult::clone(&self) -> aya::programs::perf_event::HwCacheResult +impl core::fmt::Debug for aya::programs::perf_event::HwCacheResult +pub fn aya::programs::perf_event::HwCacheResult::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::HwCacheResult +impl core::marker::Freeze for aya::programs::perf_event::HwCacheResult +impl core::marker::Send for aya::programs::perf_event::HwCacheResult +impl core::marker::Sync for aya::programs::perf_event::HwCacheResult +impl core::marker::Unpin for aya::programs::perf_event::HwCacheResult +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::HwCacheResult +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::HwCacheResult +impl core::convert::Into for aya::programs::perf_event::HwCacheResult where U: core::convert::From +pub fn aya::programs::perf_event::HwCacheResult::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::HwCacheResult where U: core::convert::Into +pub type aya::programs::perf_event::HwCacheResult::Error = core::convert::Infallible +pub fn aya::programs::perf_event::HwCacheResult::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::HwCacheResult where U: core::convert::TryFrom +pub type aya::programs::perf_event::HwCacheResult::Error = >::Error +pub fn aya::programs::perf_event::HwCacheResult::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::HwCacheResult where T: core::clone::Clone +pub type aya::programs::perf_event::HwCacheResult::Owned = T +pub fn aya::programs::perf_event::HwCacheResult::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::HwCacheResult::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::HwCacheResult where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheResult::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::HwCacheResult where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheResult::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::HwCacheResult where T: ?core::marker::Sized +pub fn aya::programs::perf_event::HwCacheResult::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::HwCacheResult where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::HwCacheResult::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::HwCacheResult +pub fn aya::programs::perf_event::HwCacheResult::from(t: T) -> T +#[repr(u64)] pub enum aya::programs::perf_event::PerfBreakpointSize pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen1 = 1 pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen2 = 2 pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen3 = 3 @@ -5380,6 +5533,57 @@ impl core::clone::CloneToUninit for aya::programs::perf_event::PerfBreakpoint pub unsafe fn aya::programs::perf_event::PerfBreakpointType::clone_to_uninit(&self, dest: *mut u8) impl core::convert::From for aya::programs::perf_event::PerfBreakpointType pub fn aya::programs::perf_event::PerfBreakpointType::from(t: T) -> T +pub enum aya::programs::perf_event::PerfEventConfig +pub aya::programs::perf_event::PerfEventConfig::Breakpoint +pub aya::programs::perf_event::PerfEventConfig::Breakpoint::address: u64 +pub aya::programs::perf_event::PerfEventConfig::Breakpoint::length: aya::programs::perf_event::PerfBreakpointSize +pub aya::programs::perf_event::PerfEventConfig::Breakpoint::type_: aya::programs::perf_event::PerfBreakpointType +pub aya::programs::perf_event::PerfEventConfig::Hardware(aya::programs::perf_event::HardwareEvent) +pub aya::programs::perf_event::PerfEventConfig::HwCache +pub aya::programs::perf_event::PerfEventConfig::HwCache::event: aya::programs::perf_event::HwCacheEvent +pub aya::programs::perf_event::PerfEventConfig::HwCache::operation: aya::programs::perf_event::HwCacheOp +pub aya::programs::perf_event::PerfEventConfig::HwCache::result: aya::programs::perf_event::HwCacheResult +pub aya::programs::perf_event::PerfEventConfig::Pmu +pub aya::programs::perf_event::PerfEventConfig::Pmu::config: u64 +pub aya::programs::perf_event::PerfEventConfig::Pmu::pmu_type: u32 +pub aya::programs::perf_event::PerfEventConfig::Raw +pub aya::programs::perf_event::PerfEventConfig::Raw::event_id: u64 +pub aya::programs::perf_event::PerfEventConfig::Software(aya::programs::perf_event::SoftwareEvent) +pub aya::programs::perf_event::PerfEventConfig::TracePoint +pub aya::programs::perf_event::PerfEventConfig::TracePoint::event_id: u64 +impl core::clone::Clone for aya::programs::perf_event::PerfEventConfig +pub fn aya::programs::perf_event::PerfEventConfig::clone(&self) -> aya::programs::perf_event::PerfEventConfig +impl core::fmt::Debug for aya::programs::perf_event::PerfEventConfig +pub fn aya::programs::perf_event::PerfEventConfig::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::PerfEventConfig +impl core::marker::Freeze for aya::programs::perf_event::PerfEventConfig +impl core::marker::Send for aya::programs::perf_event::PerfEventConfig +impl core::marker::Sync for aya::programs::perf_event::PerfEventConfig +impl core::marker::Unpin for aya::programs::perf_event::PerfEventConfig +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfEventConfig +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfEventConfig +impl core::convert::Into for aya::programs::perf_event::PerfEventConfig where U: core::convert::From +pub fn aya::programs::perf_event::PerfEventConfig::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::PerfEventConfig where U: core::convert::Into +pub type aya::programs::perf_event::PerfEventConfig::Error = core::convert::Infallible +pub fn aya::programs::perf_event::PerfEventConfig::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::PerfEventConfig where U: core::convert::TryFrom +pub type aya::programs::perf_event::PerfEventConfig::Error = >::Error +pub fn aya::programs::perf_event::PerfEventConfig::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfEventConfig where T: core::clone::Clone +pub type aya::programs::perf_event::PerfEventConfig::Owned = T +pub fn aya::programs::perf_event::PerfEventConfig::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::PerfEventConfig::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::PerfEventConfig where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::PerfEventConfig::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::PerfEventConfig where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfEventConfig::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::PerfEventConfig where T: ?core::marker::Sized +pub fn aya::programs::perf_event::PerfEventConfig::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::PerfEventConfig where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::PerfEventConfig::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::PerfEventConfig +pub fn aya::programs::perf_event::PerfEventConfig::from(t: T) -> T pub enum aya::programs::perf_event::PerfEventScope pub aya::programs::perf_event::PerfEventScope::AllProcessesOneCpu pub aya::programs::perf_event::PerfEventScope::AllProcessesOneCpu::cpu: u32 @@ -5423,46 +5627,6 @@ impl core::clone::CloneToUninit for aya::programs::perf_event::PerfEventScope pub unsafe fn aya::programs::perf_event::PerfEventScope::clone_to_uninit(&self, dest: *mut u8) impl core::convert::From for aya::programs::perf_event::PerfEventScope pub fn aya::programs::perf_event::PerfEventScope::from(t: T) -> T -#[repr(u32)] pub enum aya::programs::perf_event::PerfTypeId -pub aya::programs::perf_event::PerfTypeId::Breakpoint = 5 -pub aya::programs::perf_event::PerfTypeId::Hardware = 0 -pub aya::programs::perf_event::PerfTypeId::HwCache = 3 -pub aya::programs::perf_event::PerfTypeId::Raw = 4 -pub aya::programs::perf_event::PerfTypeId::Software = 1 -pub aya::programs::perf_event::PerfTypeId::TracePoint = 2 -impl core::clone::Clone for aya::programs::perf_event::PerfTypeId -pub fn aya::programs::perf_event::PerfTypeId::clone(&self) -> aya::programs::perf_event::PerfTypeId -impl core::fmt::Debug for aya::programs::perf_event::PerfTypeId -pub fn aya::programs::perf_event::PerfTypeId::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::marker::Copy for aya::programs::perf_event::PerfTypeId -impl core::marker::Freeze for aya::programs::perf_event::PerfTypeId -impl core::marker::Send for aya::programs::perf_event::PerfTypeId -impl core::marker::Sync for aya::programs::perf_event::PerfTypeId -impl core::marker::Unpin for aya::programs::perf_event::PerfTypeId -impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfTypeId -impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfTypeId -impl core::convert::Into for aya::programs::perf_event::PerfTypeId where U: core::convert::From -pub fn aya::programs::perf_event::PerfTypeId::into(self) -> U -impl core::convert::TryFrom for aya::programs::perf_event::PerfTypeId where U: core::convert::Into -pub type aya::programs::perf_event::PerfTypeId::Error = core::convert::Infallible -pub fn aya::programs::perf_event::PerfTypeId::try_from(value: U) -> core::result::Result>::Error> -impl core::convert::TryInto for aya::programs::perf_event::PerfTypeId where U: core::convert::TryFrom -pub type aya::programs::perf_event::PerfTypeId::Error = >::Error -pub fn aya::programs::perf_event::PerfTypeId::try_into(self) -> core::result::Result>::Error> -impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfTypeId where T: core::clone::Clone -pub type aya::programs::perf_event::PerfTypeId::Owned = T -pub fn aya::programs::perf_event::PerfTypeId::clone_into(&self, target: &mut T) -pub fn aya::programs::perf_event::PerfTypeId::to_owned(&self) -> T -impl core::any::Any for aya::programs::perf_event::PerfTypeId where T: 'static + ?core::marker::Sized -pub fn aya::programs::perf_event::PerfTypeId::type_id(&self) -> core::any::TypeId -impl core::borrow::Borrow for aya::programs::perf_event::PerfTypeId where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfTypeId::borrow(&self) -> &T -impl core::borrow::BorrowMut for aya::programs::perf_event::PerfTypeId where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfTypeId::borrow_mut(&mut self) -> &mut T -impl core::clone::CloneToUninit for aya::programs::perf_event::PerfTypeId where T: core::clone::Clone -pub unsafe fn aya::programs::perf_event::PerfTypeId::clone_to_uninit(&self, dest: *mut u8) -impl core::convert::From for aya::programs::perf_event::PerfTypeId -pub fn aya::programs::perf_event::PerfTypeId::from(t: T) -> T pub enum aya::programs::perf_event::SamplePolicy pub aya::programs::perf_event::SamplePolicy::Frequency(u64) pub aya::programs::perf_event::SamplePolicy::Period(u64) @@ -5498,46 +5662,56 @@ impl core::clone::CloneToUninit for aya::programs::perf_event::SamplePolicy w pub unsafe fn aya::programs::perf_event::SamplePolicy::clone_to_uninit(&self, dest: *mut u8) impl core::convert::From for aya::programs::perf_event::SamplePolicy pub fn aya::programs::perf_event::SamplePolicy::from(t: T) -> T -pub struct aya::programs::perf_event::PerfBreakpoint -pub aya::programs::perf_event::PerfBreakpoint::address: u64 -pub aya::programs::perf_event::PerfBreakpoint::length: aya::programs::perf_event::PerfBreakpointSize -pub aya::programs::perf_event::PerfBreakpoint::type_: aya::programs::perf_event::PerfBreakpointType -impl core::clone::Clone for aya::programs::perf_event::PerfBreakpoint -pub fn aya::programs::perf_event::PerfBreakpoint::clone(&self) -> aya::programs::perf_event::PerfBreakpoint -impl core::fmt::Debug for aya::programs::perf_event::PerfBreakpoint -pub fn aya::programs::perf_event::PerfBreakpoint::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::marker::Freeze for aya::programs::perf_event::PerfBreakpoint -impl core::marker::Send for aya::programs::perf_event::PerfBreakpoint -impl core::marker::Sync for aya::programs::perf_event::PerfBreakpoint -impl core::marker::Unpin for aya::programs::perf_event::PerfBreakpoint -impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfBreakpoint -impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfBreakpoint -impl core::convert::Into for aya::programs::perf_event::PerfBreakpoint where U: core::convert::From -pub fn aya::programs::perf_event::PerfBreakpoint::into(self) -> U -impl core::convert::TryFrom for aya::programs::perf_event::PerfBreakpoint where U: core::convert::Into -pub type aya::programs::perf_event::PerfBreakpoint::Error = core::convert::Infallible -pub fn aya::programs::perf_event::PerfBreakpoint::try_from(value: U) -> core::result::Result>::Error> -impl core::convert::TryInto for aya::programs::perf_event::PerfBreakpoint where U: core::convert::TryFrom -pub type aya::programs::perf_event::PerfBreakpoint::Error = >::Error -pub fn aya::programs::perf_event::PerfBreakpoint::try_into(self) -> core::result::Result>::Error> -impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfBreakpoint where T: core::clone::Clone -pub type aya::programs::perf_event::PerfBreakpoint::Owned = T -pub fn aya::programs::perf_event::PerfBreakpoint::clone_into(&self, target: &mut T) -pub fn aya::programs::perf_event::PerfBreakpoint::to_owned(&self) -> T -impl core::any::Any for aya::programs::perf_event::PerfBreakpoint where T: 'static + ?core::marker::Sized -pub fn aya::programs::perf_event::PerfBreakpoint::type_id(&self) -> core::any::TypeId -impl core::borrow::Borrow for aya::programs::perf_event::PerfBreakpoint where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfBreakpoint::borrow(&self) -> &T -impl core::borrow::BorrowMut for aya::programs::perf_event::PerfBreakpoint where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfBreakpoint::borrow_mut(&mut self) -> &mut T -impl core::clone::CloneToUninit for aya::programs::perf_event::PerfBreakpoint where T: core::clone::Clone -pub unsafe fn aya::programs::perf_event::PerfBreakpoint::clone_to_uninit(&self, dest: *mut u8) -impl core::convert::From for aya::programs::perf_event::PerfBreakpoint -pub fn aya::programs::perf_event::PerfBreakpoint::from(t: T) -> T +#[repr(u32)] pub enum aya::programs::perf_event::SoftwareEvent +pub aya::programs::perf_event::SoftwareEvent::AlignmentFaults = 7 +pub aya::programs::perf_event::SoftwareEvent::BpfOutput = 10 +pub aya::programs::perf_event::SoftwareEvent::CgroupSwitches = 11 +pub aya::programs::perf_event::SoftwareEvent::ContextSwitches = 3 +pub aya::programs::perf_event::SoftwareEvent::CpuClock = 0 +pub aya::programs::perf_event::SoftwareEvent::CpuMigrations = 4 +pub aya::programs::perf_event::SoftwareEvent::Dummy = 9 +pub aya::programs::perf_event::SoftwareEvent::EmulationFaults = 8 +pub aya::programs::perf_event::SoftwareEvent::PageFaults = 2 +pub aya::programs::perf_event::SoftwareEvent::PageFaultsMaj = 6 +pub aya::programs::perf_event::SoftwareEvent::PageFaultsMin = 5 +pub aya::programs::perf_event::SoftwareEvent::TaskClock = 1 +impl core::clone::Clone for aya::programs::perf_event::SoftwareEvent +pub fn aya::programs::perf_event::SoftwareEvent::clone(&self) -> aya::programs::perf_event::SoftwareEvent +impl core::fmt::Debug for aya::programs::perf_event::SoftwareEvent +pub fn aya::programs::perf_event::SoftwareEvent::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::SoftwareEvent +impl core::marker::Freeze for aya::programs::perf_event::SoftwareEvent +impl core::marker::Send for aya::programs::perf_event::SoftwareEvent +impl core::marker::Sync for aya::programs::perf_event::SoftwareEvent +impl core::marker::Unpin for aya::programs::perf_event::SoftwareEvent +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::SoftwareEvent +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::SoftwareEvent +impl core::convert::Into for aya::programs::perf_event::SoftwareEvent where U: core::convert::From +pub fn aya::programs::perf_event::SoftwareEvent::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::SoftwareEvent where U: core::convert::Into +pub type aya::programs::perf_event::SoftwareEvent::Error = core::convert::Infallible +pub fn aya::programs::perf_event::SoftwareEvent::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::SoftwareEvent where U: core::convert::TryFrom +pub type aya::programs::perf_event::SoftwareEvent::Error = >::Error +pub fn aya::programs::perf_event::SoftwareEvent::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::SoftwareEvent where T: core::clone::Clone +pub type aya::programs::perf_event::SoftwareEvent::Owned = T +pub fn aya::programs::perf_event::SoftwareEvent::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::SoftwareEvent::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::SoftwareEvent where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::SoftwareEvent::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::SoftwareEvent where T: ?core::marker::Sized +pub fn aya::programs::perf_event::SoftwareEvent::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::SoftwareEvent where T: ?core::marker::Sized +pub fn aya::programs::perf_event::SoftwareEvent::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::SoftwareEvent where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::SoftwareEvent::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::SoftwareEvent +pub fn aya::programs::perf_event::SoftwareEvent::from(t: T) -> T pub struct aya::programs::perf_event::PerfEvent impl aya::programs::perf_event::PerfEvent pub const aya::programs::perf_event::PerfEvent::PROGRAM_TYPE: aya::programs::ProgramType -pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool, bp: core::option::Option) -> core::result::Result +pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_config: aya::programs::perf_event::PerfEventConfig, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool) -> core::result::Result pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> @@ -7852,46 +8026,6 @@ impl core::clone::CloneToUninit for aya::programs::perf_event::PerfEventScope pub unsafe fn aya::programs::perf_event::PerfEventScope::clone_to_uninit(&self, dest: *mut u8) impl core::convert::From for aya::programs::perf_event::PerfEventScope pub fn aya::programs::perf_event::PerfEventScope::from(t: T) -> T -#[repr(u32)] pub enum aya::programs::PerfTypeId -pub aya::programs::PerfTypeId::Breakpoint = 5 -pub aya::programs::PerfTypeId::Hardware = 0 -pub aya::programs::PerfTypeId::HwCache = 3 -pub aya::programs::PerfTypeId::Raw = 4 -pub aya::programs::PerfTypeId::Software = 1 -pub aya::programs::PerfTypeId::TracePoint = 2 -impl core::clone::Clone for aya::programs::perf_event::PerfTypeId -pub fn aya::programs::perf_event::PerfTypeId::clone(&self) -> aya::programs::perf_event::PerfTypeId -impl core::fmt::Debug for aya::programs::perf_event::PerfTypeId -pub fn aya::programs::perf_event::PerfTypeId::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::marker::Copy for aya::programs::perf_event::PerfTypeId -impl core::marker::Freeze for aya::programs::perf_event::PerfTypeId -impl core::marker::Send for aya::programs::perf_event::PerfTypeId -impl core::marker::Sync for aya::programs::perf_event::PerfTypeId -impl core::marker::Unpin for aya::programs::perf_event::PerfTypeId -impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfTypeId -impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfTypeId -impl core::convert::Into for aya::programs::perf_event::PerfTypeId where U: core::convert::From -pub fn aya::programs::perf_event::PerfTypeId::into(self) -> U -impl core::convert::TryFrom for aya::programs::perf_event::PerfTypeId where U: core::convert::Into -pub type aya::programs::perf_event::PerfTypeId::Error = core::convert::Infallible -pub fn aya::programs::perf_event::PerfTypeId::try_from(value: U) -> core::result::Result>::Error> -impl core::convert::TryInto for aya::programs::perf_event::PerfTypeId where U: core::convert::TryFrom -pub type aya::programs::perf_event::PerfTypeId::Error = >::Error -pub fn aya::programs::perf_event::PerfTypeId::try_into(self) -> core::result::Result>::Error> -impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfTypeId where T: core::clone::Clone -pub type aya::programs::perf_event::PerfTypeId::Owned = T -pub fn aya::programs::perf_event::PerfTypeId::clone_into(&self, target: &mut T) -pub fn aya::programs::perf_event::PerfTypeId::to_owned(&self) -> T -impl core::any::Any for aya::programs::perf_event::PerfTypeId where T: 'static + ?core::marker::Sized -pub fn aya::programs::perf_event::PerfTypeId::type_id(&self) -> core::any::TypeId -impl core::borrow::Borrow for aya::programs::perf_event::PerfTypeId where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfTypeId::borrow(&self) -> &T -impl core::borrow::BorrowMut for aya::programs::perf_event::PerfTypeId where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfTypeId::borrow_mut(&mut self) -> &mut T -impl core::clone::CloneToUninit for aya::programs::perf_event::PerfTypeId where T: core::clone::Clone -pub unsafe fn aya::programs::perf_event::PerfTypeId::clone_to_uninit(&self, dest: *mut u8) -impl core::convert::From for aya::programs::perf_event::PerfTypeId -pub fn aya::programs::perf_event::PerfTypeId::from(t: T) -> T pub enum aya::programs::ProbeKind pub aya::programs::ProbeKind::KProbe pub aya::programs::ProbeKind::KRetProbe @@ -9490,7 +9624,7 @@ pub fn aya::programs::lsm_cgroup::LsmCgroup::from(t: T) -> T pub struct aya::programs::PerfEvent impl aya::programs::perf_event::PerfEvent pub const aya::programs::perf_event::PerfEvent::PROGRAM_TYPE: aya::programs::ProgramType -pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_type: aya::programs::perf_event::PerfTypeId, config: u64, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool, bp: core::option::Option) -> core::result::Result +pub fn aya::programs::perf_event::PerfEvent::attach(&mut self, perf_config: aya::programs::perf_event::PerfEventConfig, scope: aya::programs::perf_event::PerfEventScope, sample_policy: aya::programs::perf_event::SamplePolicy, inherit: bool) -> core::result::Result pub fn aya::programs::perf_event::PerfEvent::load(&mut self) -> core::result::Result<(), aya::programs::ProgramError> impl aya::programs::perf_event::PerfEvent pub fn aya::programs::perf_event::PerfEvent::detach(&mut self, link_id: aya::programs::perf_event::PerfEventLinkId) -> core::result::Result<(), aya::programs::ProgramError> From 61e0aef8b6aafeafa80981dd962ffaa4392bc950 Mon Sep 17 00:00:00 2001 From: Friday Ortiz Date: Thu, 16 Oct 2025 14:57:50 -0400 Subject: [PATCH 6/6] .github,aya,test: clean up interface and script per review comments - .github: Ensure we only download the debug package that matches the kernel we downloaded. - aya: Constrain the breakpoint interface to only valid combinations of options. - test: Document what the test is actually doing for future readers who might be unfamiliar with modprobe_path. --- .github/scripts/download_kernel_images.sh | 28 +++-- aya/src/programs/mod.rs | 4 - aya/src/programs/perf_event.rs | 118 +++++++++--------- aya/src/sys/perf_event.rs | 31 +++-- .../src/tests/perf_event_bp.rs | 27 ++-- xtask/public-api/aya.txt | 98 +++++++-------- 6 files changed, 156 insertions(+), 150 deletions(-) diff --git a/.github/scripts/download_kernel_images.sh b/.github/scripts/download_kernel_images.sh index c86c6ca7..eab4e8a3 100755 --- a/.github/scripts/download_kernel_images.sh +++ b/.github/scripts/download_kernel_images.sh @@ -27,20 +27,22 @@ for VERSION in "${VERSIONS[@]}"; do FILES+=("$match") # The debug package contains the actual System.map. Debian has transitioned - # between -dbg and -dbgsym suffixes, so try both. - DEBUG_REGEX_BASE="linux-image-${VERSION//./\\.}\\.[0-9]+(-[0-9]+)?(\+bpo|\+deb[0-9]+)?-cloud-${ARCHITECTURE}-" - debug_match="" - for debug_suffix in dbg dbgsym; do - regex="${DEBUG_REGEX_BASE}${debug_suffix}_.*\\.deb" - debug_match=$(printf '%s\n' "$URLS" | grep -E "$regex" | sort -V | tail -n1 || true) - if [[ -n "$debug_match" ]]; then - break - fi - done - if [[ -z "$debug_match" ]]; then - printf 'Failed to locate debug package for VERSION=%s (tried dbg/dbgsym)\n' "$VERSION" >&2 + # between -dbg and -dbgsym suffixes, so match either for the specific kernel + # we just selected. + kernel_basename=$(basename "$match") + kernel_prefix=${kernel_basename%%_*} + kernel_suffix=${kernel_basename#${kernel_prefix}_} + base_prefix=${kernel_prefix%-unsigned} + + base_prefix_regex=$(printf '%s\n' "$base_prefix" | sed 's/[][(){}.^$*+?|\\-]/\\&/g') + kernel_suffix_regex=$(printf '%s\n' "$kernel_suffix" | sed 's/[][(){}.^$*+?|\\-]/\\&/g') + + DEBUG_REGEX="${base_prefix_regex}-dbg(sym)?_${kernel_suffix_regex}" + debug_match=$(printf '%s\n' "$URLS" | grep -E "$DEBUG_REGEX" | sort -V | tail -n1) || { + printf 'Failed to locate debug package matching %s\n%s\nVERSION=%s\nREGEX=%s\n' \ + "$kernel_basename" "$URLS" "$VERSION" "$DEBUG_REGEX" >&2 exit 1 - fi + } FILES+=("$debug_match") done diff --git a/aya/src/programs/mod.rs b/aya/src/programs/mod.rs index ddcc0f25..ec7d1520 100644 --- a/aya/src/programs/mod.rs +++ b/aya/src/programs/mod.rs @@ -236,10 +236,6 @@ pub enum ProgramError { /// An error occurred while working with Netlink. #[error(transparent)] NetlinkError(#[from] NetlinkError), - - /// The perf event breakpoint is underspecified - #[error("the breakpoint description is missing or incomplete")] - IncompleteBreakpoint, } /// A [`Program`] file descriptor. diff --git a/aya/src/programs/perf_event.rs b/aya/src/programs/perf_event.rs index ec581dc9..2e2160b3 100644 --- a/aya/src/programs/perf_event.rs +++ b/aya/src/programs/perf_event.rs @@ -3,10 +3,8 @@ use std::os::fd::AsFd as _; use aya_obj::generated::{ - HW_BREAKPOINT_EMPTY, HW_BREAKPOINT_INVALID, HW_BREAKPOINT_LEN_1, HW_BREAKPOINT_LEN_2, - HW_BREAKPOINT_LEN_3, HW_BREAKPOINT_LEN_4, HW_BREAKPOINT_LEN_5, HW_BREAKPOINT_LEN_6, - HW_BREAKPOINT_LEN_7, HW_BREAKPOINT_LEN_8, HW_BREAKPOINT_R, HW_BREAKPOINT_RW, HW_BREAKPOINT_W, - HW_BREAKPOINT_X, bpf_link_type, + HW_BREAKPOINT_LEN_1, HW_BREAKPOINT_LEN_2, HW_BREAKPOINT_LEN_4, HW_BREAKPOINT_LEN_8, + bpf_link_type, bpf_prog_type::BPF_PROG_TYPE_PERF_EVENT, perf_hw_cache_id, perf_hw_cache_op_id, perf_hw_cache_op_result_id, perf_hw_id, perf_sw_ids, perf_type_id, @@ -21,7 +19,7 @@ use crate::{ FdLink, LinkError, ProgramData, ProgramError, ProgramType, impl_try_into_fdlink, links::define_link_wrapper, load_program, - perf_attach::{PerfLinkIdInner, PerfLinkInner}, + perf_attach::{PerfLinkIdInner, PerfLinkInner, perf_attach}, }, sys::{SyscallError, bpf_link_get_info_by_fd, perf_event_open}, }; @@ -62,16 +60,7 @@ pub enum PerfEventConfig { }, /// A hardware breakpoint. #[doc(alias = "PERF_TYPE_BREAKPOINT")] - Breakpoint { - /// The address to set the breakpoint on - address: u64, - /// The breakpoint size. For HwBreakpointX this must be sizeof(long). For - /// all other types it should be one of HwBreakpointLen1, HwBreakpointLen2,, - /// HwBreakpointLen4 or HwBreakpointLen8. - length: PerfBreakpointSize, - /// The breakpoint type, one of HW_BREAKPOINT_{R,W,RW,X} - type_: PerfBreakpointType, - }, + Breakpoint(BreakpointConfig), /// The dynamic PMU (Performance Monitor Unit) event to report. /// /// Available PMU's may be found under `/sys/bus/event_source/devices`. @@ -290,38 +279,51 @@ impl HwCacheResult { } } -/// Type of hardware breakpoint, determines if we break on read, write, or execute. -#[repr(u32)] +/// Type of hardware breakpoint, determines if we break on read, write, or +/// execute, or if there should be no breakpoint on the given address. #[derive(Debug, Clone, Copy)] -pub enum PerfBreakpointType { - /// HW_BREAKPOINT_EMPTY +pub enum BreakpointConfig { + /// HW_BREAKPOINT_EMPTY, no breakpoint. #[doc(alias = "HW_BREAKPOINT_EMPTY")] - HwBreakpointEmpty = HW_BREAKPOINT_EMPTY, - /// HW_BREAKPOINT_R + Empty { + /// The size of the breakpoint being measured. + size: PerfBreakpointSize, + /// The address of the breakpoint. + address: u64, + }, + /// HW_BREAKPOINT_R, count when we read the memory location. #[doc(alias = "HW_BREAKPOINT_R")] - HwBreakpointR = HW_BREAKPOINT_R, - /// HW_BREAKPOINT_W + Read { + /// The size of the breakpoint being measured. + size: PerfBreakpointSize, + /// The address of the breakpoint. + address: u64, + }, + /// HW_BREAKPOINT_W, count when we write the memory location. #[doc(alias = "HW_BREAKPOINT_W")] - HwBreakpointW = HW_BREAKPOINT_W, - /// HW_BREAKPOINT_RW + Write { + /// The size of the breakpoint being measured. + size: PerfBreakpointSize, + /// The address of the breakpoint. + address: u64, + }, + /// HW_BREAKPOINT_RW, count when we read or write the memory location. #[doc(alias = "HW_BREAKPOINT_RW")] - HwBreakpointRW = HW_BREAKPOINT_RW, - /// HW_BREAKPOINT_X + ReadWrite { + /// The size of the breakpoint being measured. + size: PerfBreakpointSize, + /// The address of the breakpoint. + address: u64, + }, + /// HW_BREAKPOINT_X, count when we execute code at the memory location. #[doc(alias = "HW_BREAKPOINT_X")] - HwBreakpointX = HW_BREAKPOINT_X, - /// HW_BREAKPOINT_INVALID - #[doc(alias = "HW_BREAKPOINT_INVALID")] - HwBreakpointInvalid = HW_BREAKPOINT_INVALID, -} - -impl PerfBreakpointType { - pub(crate) const fn into_primitive(self) -> u32 { - const _: [(); 4] = [(); std::mem::size_of::()]; - self as u32 - } + Execute { + /// The address of the breakpoint. + address: u64, + }, } -/// The size of the breakpoint being measured +/// The size of the breakpoint being observed in bytes. #[repr(u64)] #[derive(Debug, Clone, Copy)] pub enum PerfBreakpointSize { @@ -331,21 +333,9 @@ pub enum PerfBreakpointSize { /// HW_BREAKPOINT_LEN_2 #[doc(alias = "HW_BREAKPOINT_LEN_2")] HwBreakpointLen2 = HW_BREAKPOINT_LEN_2 as u64, - /// HW_BREAKPOINT_LEN_3 - #[doc(alias = "HW_BREAKPOINT_LEN_3")] - HwBreakpointLen3 = HW_BREAKPOINT_LEN_3 as u64, /// HW_BREAKPOINT_LEN_4 #[doc(alias = "HW_BREAKPOINT_LEN_4")] HwBreakpointLen4 = HW_BREAKPOINT_LEN_4 as u64, - /// HW_BREAKPOINT_LEN_5 - #[doc(alias = "HW_BREAKPOINT_LEN_5")] - HwBreakpointLen5 = HW_BREAKPOINT_LEN_5 as u64, - /// HW_BREAKPOINT_LEN_6 - #[doc(alias = "HW_BREAKPOINT_LEN_6")] - HwBreakpointLen6 = HW_BREAKPOINT_LEN_6 as u64, - /// HW_BREAKPOINT_LEN_7 - #[doc(alias = "HW_BREAKPOINT_LEN_7")] - HwBreakpointLen7 = HW_BREAKPOINT_LEN_7 as u64, /// HW_BREAKPOINT_LEN_8 #[doc(alias = "HW_BREAKPOINT_LEN_8")] HwBreakpointLen8 = HW_BREAKPOINT_LEN_8 as u64, @@ -356,6 +346,16 @@ impl PerfBreakpointSize { const _: [(); 8] = [(); std::mem::size_of::()]; self as u64 } + + pub(crate) const fn from_primitive(size: u64) -> Self { + match size { + n if n == Self::HwBreakpointLen1.into_primitive() => Self::HwBreakpointLen1, + n if n == Self::HwBreakpointLen2.into_primitive() => Self::HwBreakpointLen2, + n if n == Self::HwBreakpointLen4.into_primitive() => Self::HwBreakpointLen4, + n if n == Self::HwBreakpointLen8.into_primitive() => Self::HwBreakpointLen8, + _ => panic!("invalid hardware breakpoint size"), + } + } } /// Sample Policy @@ -473,6 +473,7 @@ impl PerfEvent { let prog_fd = self.fd()?; let prog_fd = prog_fd.as_fd(); + let mut breakpoint = None; let (perf_type, config) = match perf_config { PerfEventConfig::Pmu { pmu_type, config } => (pmu_type, config), PerfEventConfig::Hardware(hw_event) => ( @@ -497,11 +498,10 @@ impl PerfEvent { | (u64::from(result.into_primitive()) << 16), ), PerfEventConfig::Raw { event_id } => (perf_type_id_to_u32(PERF_TYPE_RAW), event_id), - PerfEventConfig::Breakpoint { - address: _, - length: _, - type_: _, - } => (perf_type_id_to_u32(PERF_TYPE_BREAKPOINT), 0), + PerfEventConfig::Breakpoint(config) => { + breakpoint = Some(config); + (perf_type_id_to_u32(PERF_TYPE_BREAKPOINT), 0) + } }; let (sample_period, sample_frequency) = match sample_policy { SamplePolicy::Period(period) => (period, None), @@ -521,18 +521,16 @@ impl PerfEvent { cpu, sample_period, sample_frequency, - // wakeup=true for breakpoints, false for all other types - perf_type == perf_type_id_to_u32(PERF_TYPE_BREAKPOINT), inherit, 0, - Some(perf_config), + breakpoint, ) .map_err(|io_error| SyscallError { call: "perf_event_open", io_error, })?; - let link = crate::programs::perf_attach(prog_fd, fd, None /* cookie */)?; + let link = perf_attach(prog_fd, fd, None /* cookie */)?; self.data.links.insert(PerfEventLink::new(link)) } } diff --git a/aya/src/sys/perf_event.rs b/aya/src/sys/perf_event.rs index 33941598..b907f6aa 100644 --- a/aya/src/sys/perf_event.rs +++ b/aya/src/sys/perf_event.rs @@ -5,6 +5,7 @@ use std::{ }; use aya_obj::generated::{ + HW_BREAKPOINT_EMPTY, HW_BREAKPOINT_R, HW_BREAKPOINT_RW, HW_BREAKPOINT_W, HW_BREAKPOINT_X, PERF_FLAG_FD_CLOEXEC, perf_event_attr, perf_event_sample_format::PERF_SAMPLE_RAW, perf_sw_ids::PERF_COUNT_SW_BPF_OUTPUT, @@ -13,7 +14,7 @@ use aya_obj::generated::{ use libc::pid_t; use super::{PerfEventIoctlRequest, Syscall, syscall}; -use crate::programs::perf_event::PerfEventConfig; +use crate::programs::perf_event::{BreakpointConfig, PerfBreakpointSize}; #[expect(clippy::too_many_arguments)] pub(crate) fn perf_event_open( @@ -23,10 +24,9 @@ pub(crate) fn perf_event_open( cpu: c_int, sample_period: u64, sample_frequency: Option, - wakeup: bool, inherit: bool, flags: u32, - perf_config: Option, + breakpoint: Option, ) -> io::Result { let mut attr = unsafe { mem::zeroed::() }; @@ -35,7 +35,6 @@ pub(crate) fn perf_event_open( attr.type_ = perf_type; attr.sample_type = PERF_SAMPLE_RAW as u64; attr.set_inherit(if inherit { 1 } else { 0 }); - attr.__bindgen_anon_2.wakeup_events = u32::from(wakeup); if let Some(frequency) = sample_frequency { attr.set_freq(1); @@ -44,16 +43,25 @@ pub(crate) fn perf_event_open( attr.__bindgen_anon_1.sample_period = sample_period; } - if let Some(PerfEventConfig::Breakpoint { - address, - length, - type_, - }) = perf_config - { - attr.bp_type = type_.into_primitive(); + if let Some(bp) = breakpoint { + let (type_, length, address) = match bp { + BreakpointConfig::Empty { size, address } => (HW_BREAKPOINT_EMPTY, size, address), + BreakpointConfig::Read { size, address } => (HW_BREAKPOINT_R, size, address), + BreakpointConfig::Write { size, address } => (HW_BREAKPOINT_W, size, address), + BreakpointConfig::ReadWrite { size, address } => (HW_BREAKPOINT_RW, size, address), + BreakpointConfig::Execute { address } => ( + HW_BREAKPOINT_X, + PerfBreakpointSize::from_primitive(std::mem::size_of::() as u64), + address, + ), + }; + attr.bp_type = type_; attr.__bindgen_anon_3.bp_addr = address; attr.__bindgen_anon_4.bp_len = length.into_primitive(); attr.set_precise_ip(2); + attr.__bindgen_anon_2.wakeup_events = u32::from(true); + } else { + attr.__bindgen_anon_2.wakeup_events = u32::from(false); } perf_event_sys(attr, pid, cpu, flags) @@ -68,7 +76,6 @@ pub(crate) fn perf_event_open_bpf(cpu: c_int) -> io::Result { 1, None, true, - false, PERF_FLAG_FD_CLOEXEC, None, ) diff --git a/test/integration-test/src/tests/perf_event_bp.rs b/test/integration-test/src/tests/perf_event_bp.rs index bbeb86f2..d9f56410 100644 --- a/test/integration-test/src/tests/perf_event_bp.rs +++ b/test/integration-test/src/tests/perf_event_bp.rs @@ -7,10 +7,7 @@ use aya::{ Ebpf, programs::{ PerfEventScope, SamplePolicy, - perf_event::{ - PerfBreakpointSize::HwBreakpointLen1, PerfBreakpointType::HwBreakpointRW, - PerfEventConfig, - }, + perf_event::{BreakpointConfig, PerfBreakpointSize::HwBreakpointLen1, PerfEventConfig}, }, util::online_cpus, }; @@ -72,6 +69,10 @@ fn find_kallsyms_symbol(sym: &str) -> Option { #[test_log::test] fn perf_event_bp() { let mut bpf = Ebpf::load(crate::PERF_EVENT_BP).unwrap(); + + // Search for the address of modprobe_path. Prefer to grab it directly from + // kallsyms, but if it's not there we can grab it from System.map and apply + // the kaslr offset. let attach_addr = if let Some(addr) = find_kallsyms_symbol("modprobe_path") { addr } else { @@ -91,15 +92,13 @@ fn perf_event_bp() { .unwrap(); prog.load().unwrap(); - // attach hardware breakpoint to modprobe_path global for cpu in online_cpus().unwrap() { info!("attaching to cpu {cpu}"); prog.attach( - PerfEventConfig::Breakpoint { + PerfEventConfig::Breakpoint(BreakpointConfig::ReadWrite { address: attach_addr, - length: HwBreakpointLen1, - type_: HwBreakpointRW, - }, + size: HwBreakpointLen1, + }), PerfEventScope::AllProcessesOneCpu { cpu }, SamplePolicy::Period(1), true, @@ -107,10 +106,14 @@ fn perf_event_bp() { .unwrap(); } - // trigger hardware breakpoint by reading modprobe_path via procfs - let _ = fs::read_to_string("/proc/sys/kernel/modprobe"); + // Trigger the hardware breakpoint by reading /proc/sys/kernel/modprobe, the + // sysctl connected to modprobe_path. + // + // See: https://elixir.bootlin.com/linux/v6.1.155/source/kernel/sysctl.c#L1770 + fs::read_to_string("/proc/sys/kernel/modprobe").expect("failed to read modprobe"); - // assert that the map contains an entry for this process + // Assert that the map contains an entry for this process, and that we read + // the address we expected to. let map: aya::maps::HashMap<_, u32, u64> = aya::maps::HashMap::try_from(bpf.map_mut("READERS").unwrap()).unwrap(); let tgid = std::process::id(); diff --git a/xtask/public-api/aya.txt b/xtask/public-api/aya.txt index 57a32141..e6c6ba0c 100644 --- a/xtask/public-api/aya.txt +++ b/xtask/public-api/aya.txt @@ -5299,6 +5299,54 @@ pub fn aya::programs::perf_attach::PerfLinkId::borrow_mut(&mut self) -> &mut T impl core::convert::From for aya::programs::perf_attach::PerfLinkId pub fn aya::programs::perf_attach::PerfLinkId::from(t: T) -> T pub mod aya::programs::perf_event +pub enum aya::programs::perf_event::BreakpointConfig +pub aya::programs::perf_event::BreakpointConfig::Empty +pub aya::programs::perf_event::BreakpointConfig::Empty::address: u64 +pub aya::programs::perf_event::BreakpointConfig::Empty::size: aya::programs::perf_event::PerfBreakpointSize +pub aya::programs::perf_event::BreakpointConfig::Execute +pub aya::programs::perf_event::BreakpointConfig::Execute::address: u64 +pub aya::programs::perf_event::BreakpointConfig::Read +pub aya::programs::perf_event::BreakpointConfig::Read::address: u64 +pub aya::programs::perf_event::BreakpointConfig::Read::size: aya::programs::perf_event::PerfBreakpointSize +pub aya::programs::perf_event::BreakpointConfig::ReadWrite +pub aya::programs::perf_event::BreakpointConfig::ReadWrite::address: u64 +pub aya::programs::perf_event::BreakpointConfig::ReadWrite::size: aya::programs::perf_event::PerfBreakpointSize +pub aya::programs::perf_event::BreakpointConfig::Write +pub aya::programs::perf_event::BreakpointConfig::Write::address: u64 +pub aya::programs::perf_event::BreakpointConfig::Write::size: aya::programs::perf_event::PerfBreakpointSize +impl core::clone::Clone for aya::programs::perf_event::BreakpointConfig +pub fn aya::programs::perf_event::BreakpointConfig::clone(&self) -> aya::programs::perf_event::BreakpointConfig +impl core::fmt::Debug for aya::programs::perf_event::BreakpointConfig +pub fn aya::programs::perf_event::BreakpointConfig::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result +impl core::marker::Copy for aya::programs::perf_event::BreakpointConfig +impl core::marker::Freeze for aya::programs::perf_event::BreakpointConfig +impl core::marker::Send for aya::programs::perf_event::BreakpointConfig +impl core::marker::Sync for aya::programs::perf_event::BreakpointConfig +impl core::marker::Unpin for aya::programs::perf_event::BreakpointConfig +impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::BreakpointConfig +impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::BreakpointConfig +impl core::convert::Into for aya::programs::perf_event::BreakpointConfig where U: core::convert::From +pub fn aya::programs::perf_event::BreakpointConfig::into(self) -> U +impl core::convert::TryFrom for aya::programs::perf_event::BreakpointConfig where U: core::convert::Into +pub type aya::programs::perf_event::BreakpointConfig::Error = core::convert::Infallible +pub fn aya::programs::perf_event::BreakpointConfig::try_from(value: U) -> core::result::Result>::Error> +impl core::convert::TryInto for aya::programs::perf_event::BreakpointConfig where U: core::convert::TryFrom +pub type aya::programs::perf_event::BreakpointConfig::Error = >::Error +pub fn aya::programs::perf_event::BreakpointConfig::try_into(self) -> core::result::Result>::Error> +impl alloc::borrow::ToOwned for aya::programs::perf_event::BreakpointConfig where T: core::clone::Clone +pub type aya::programs::perf_event::BreakpointConfig::Owned = T +pub fn aya::programs::perf_event::BreakpointConfig::clone_into(&self, target: &mut T) +pub fn aya::programs::perf_event::BreakpointConfig::to_owned(&self) -> T +impl core::any::Any for aya::programs::perf_event::BreakpointConfig where T: 'static + ?core::marker::Sized +pub fn aya::programs::perf_event::BreakpointConfig::type_id(&self) -> core::any::TypeId +impl core::borrow::Borrow for aya::programs::perf_event::BreakpointConfig where T: ?core::marker::Sized +pub fn aya::programs::perf_event::BreakpointConfig::borrow(&self) -> &T +impl core::borrow::BorrowMut for aya::programs::perf_event::BreakpointConfig where T: ?core::marker::Sized +pub fn aya::programs::perf_event::BreakpointConfig::borrow_mut(&mut self) -> &mut T +impl core::clone::CloneToUninit for aya::programs::perf_event::BreakpointConfig where T: core::clone::Clone +pub unsafe fn aya::programs::perf_event::BreakpointConfig::clone_to_uninit(&self, dest: *mut u8) +impl core::convert::From for aya::programs::perf_event::BreakpointConfig +pub fn aya::programs::perf_event::BreakpointConfig::from(t: T) -> T #[repr(u32)] pub enum aya::programs::perf_event::HardwareEvent pub aya::programs::perf_event::HardwareEvent::BranchInstructions = 4 pub aya::programs::perf_event::HardwareEvent::BranchMisses = 5 @@ -5460,11 +5508,7 @@ pub fn aya::programs::perf_event::HwCacheResult::from(t: T) -> T #[repr(u64)] pub enum aya::programs::perf_event::PerfBreakpointSize pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen1 = 1 pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen2 = 2 -pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen3 = 3 pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen4 = 4 -pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen5 = 5 -pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen6 = 6 -pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen7 = 7 pub aya::programs::perf_event::PerfBreakpointSize::HwBreakpointLen8 = 8 impl core::clone::Clone for aya::programs::perf_event::PerfBreakpointSize pub fn aya::programs::perf_event::PerfBreakpointSize::clone(&self) -> aya::programs::perf_event::PerfBreakpointSize @@ -5499,51 +5543,8 @@ impl core::clone::CloneToUninit for aya::programs::perf_event::PerfBreakpoint pub unsafe fn aya::programs::perf_event::PerfBreakpointSize::clone_to_uninit(&self, dest: *mut u8) impl core::convert::From for aya::programs::perf_event::PerfBreakpointSize pub fn aya::programs::perf_event::PerfBreakpointSize::from(t: T) -> T -#[repr(u32)] pub enum aya::programs::perf_event::PerfBreakpointType -pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointEmpty = 0 -pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointInvalid = 7 -pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointR = 1 -pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointRW = 3 -pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointW = 2 -pub aya::programs::perf_event::PerfBreakpointType::HwBreakpointX = 4 -impl core::clone::Clone for aya::programs::perf_event::PerfBreakpointType -pub fn aya::programs::perf_event::PerfBreakpointType::clone(&self) -> aya::programs::perf_event::PerfBreakpointType -impl core::fmt::Debug for aya::programs::perf_event::PerfBreakpointType -pub fn aya::programs::perf_event::PerfBreakpointType::fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result -impl core::marker::Copy for aya::programs::perf_event::PerfBreakpointType -impl core::marker::Freeze for aya::programs::perf_event::PerfBreakpointType -impl core::marker::Send for aya::programs::perf_event::PerfBreakpointType -impl core::marker::Sync for aya::programs::perf_event::PerfBreakpointType -impl core::marker::Unpin for aya::programs::perf_event::PerfBreakpointType -impl core::panic::unwind_safe::RefUnwindSafe for aya::programs::perf_event::PerfBreakpointType -impl core::panic::unwind_safe::UnwindSafe for aya::programs::perf_event::PerfBreakpointType -impl core::convert::Into for aya::programs::perf_event::PerfBreakpointType where U: core::convert::From -pub fn aya::programs::perf_event::PerfBreakpointType::into(self) -> U -impl core::convert::TryFrom for aya::programs::perf_event::PerfBreakpointType where U: core::convert::Into -pub type aya::programs::perf_event::PerfBreakpointType::Error = core::convert::Infallible -pub fn aya::programs::perf_event::PerfBreakpointType::try_from(value: U) -> core::result::Result>::Error> -impl core::convert::TryInto for aya::programs::perf_event::PerfBreakpointType where U: core::convert::TryFrom -pub type aya::programs::perf_event::PerfBreakpointType::Error = >::Error -pub fn aya::programs::perf_event::PerfBreakpointType::try_into(self) -> core::result::Result>::Error> -impl alloc::borrow::ToOwned for aya::programs::perf_event::PerfBreakpointType where T: core::clone::Clone -pub type aya::programs::perf_event::PerfBreakpointType::Owned = T -pub fn aya::programs::perf_event::PerfBreakpointType::clone_into(&self, target: &mut T) -pub fn aya::programs::perf_event::PerfBreakpointType::to_owned(&self) -> T -impl core::any::Any for aya::programs::perf_event::PerfBreakpointType where T: 'static + ?core::marker::Sized -pub fn aya::programs::perf_event::PerfBreakpointType::type_id(&self) -> core::any::TypeId -impl core::borrow::Borrow for aya::programs::perf_event::PerfBreakpointType where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfBreakpointType::borrow(&self) -> &T -impl core::borrow::BorrowMut for aya::programs::perf_event::PerfBreakpointType where T: ?core::marker::Sized -pub fn aya::programs::perf_event::PerfBreakpointType::borrow_mut(&mut self) -> &mut T -impl core::clone::CloneToUninit for aya::programs::perf_event::PerfBreakpointType where T: core::clone::Clone -pub unsafe fn aya::programs::perf_event::PerfBreakpointType::clone_to_uninit(&self, dest: *mut u8) -impl core::convert::From for aya::programs::perf_event::PerfBreakpointType -pub fn aya::programs::perf_event::PerfBreakpointType::from(t: T) -> T pub enum aya::programs::perf_event::PerfEventConfig -pub aya::programs::perf_event::PerfEventConfig::Breakpoint -pub aya::programs::perf_event::PerfEventConfig::Breakpoint::address: u64 -pub aya::programs::perf_event::PerfEventConfig::Breakpoint::length: aya::programs::perf_event::PerfBreakpointSize -pub aya::programs::perf_event::PerfEventConfig::Breakpoint::type_: aya::programs::perf_event::PerfBreakpointType +pub aya::programs::perf_event::PerfEventConfig::Breakpoint(aya::programs::perf_event::BreakpointConfig) pub aya::programs::perf_event::PerfEventConfig::Hardware(aya::programs::perf_event::HardwareEvent) pub aya::programs::perf_event::PerfEventConfig::HwCache pub aya::programs::perf_event::PerfEventConfig::HwCache::event: aya::programs::perf_event::HwCacheEvent @@ -8297,7 +8298,6 @@ pub aya::programs::ProgramError::AttachCookieNotSupported pub aya::programs::ProgramError::Btf(aya_obj::btf::btf::BtfError) pub aya::programs::ProgramError::ExtensionError(aya::programs::extension::ExtensionError) pub aya::programs::ProgramError::IOError(std::io::error::Error) -pub aya::programs::ProgramError::IncompleteBreakpoint pub aya::programs::ProgramError::InvalidName pub aya::programs::ProgramError::InvalidName::name: alloc::string::String pub aya::programs::ProgramError::KProbeError(aya::programs::kprobe::KProbeError)