added support for armv7-unknown-linux-gnueabi and armv7-unknown-linux-gnueabihf

* new: added support for armv7-unknown-linux-gnueabi (closes alessandrod/aya/issues/22)

* fix: replaced custom type defintions with proper libc types

* fix: fixed pointless parameter binding

* new: added linker for armv7-unknown-linux-gnueabihf to cargo config
pull/15/merge
Simone Margaritelli 3 years ago committed by GitHub
parent b3ecbe7c54
commit 8311abfdcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,2 +1,8 @@
[alias] [alias]
xtask = "run --package xtask --" xtask = "run --package xtask --"
[target.armv7-unknown-linux-gnueabi]
linker = "arm-linux-gnueabi-gcc"
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

@ -802,7 +802,11 @@ pub enum perf_event_sample_format {
PERF_SAMPLE_TRANSACTION = 131072, PERF_SAMPLE_TRANSACTION = 131072,
PERF_SAMPLE_REGS_INTR = 262144, PERF_SAMPLE_REGS_INTR = 262144,
PERF_SAMPLE_PHYS_ADDR = 524288, PERF_SAMPLE_PHYS_ADDR = 524288,
PERF_SAMPLE_MAX = 1048576, PERF_SAMPLE_AUX = 1048576,
PERF_SAMPLE_CGROUP = 2097152,
PERF_SAMPLE_DATA_PAGE_SIZE = 4194304,
PERF_SAMPLE_CODE_PAGE_SIZE = 8388608,
PERF_SAMPLE_MAX = 16777216,
__PERF_SAMPLE_CALLCHAIN_EARLY = 9223372036854775808, __PERF_SAMPLE_CALLCHAIN_EARLY = 9223372036854775808,
} }
#[repr(C)] #[repr(C)]
@ -828,6 +832,8 @@ pub struct perf_event_attr {
pub aux_watermark: __u32, pub aux_watermark: __u32,
pub sample_max_stack: __u16, pub sample_max_stack: __u16,
pub __reserved_2: __u16, pub __reserved_2: __u16,
pub aux_sample_size: __u32,
pub __reserved_3: __u32,
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
@ -1204,14 +1210,36 @@ impl perf_event_attr {
} }
} }
#[inline] #[inline]
pub fn cgroup(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u64) }
}
#[inline]
pub fn set_cgroup(&mut self, val: __u64) {
unsafe {
let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(32usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_poke(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u64) }
}
#[inline]
pub fn set_text_poke(&mut self, val: __u64) {
unsafe {
let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(33usize, 1u8, val as u64)
}
}
#[inline]
pub fn __reserved_1(&self) -> __u64 { pub fn __reserved_1(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 32u8) as u64) } unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 30u8) as u64) }
} }
#[inline] #[inline]
pub fn set___reserved_1(&mut self, val: __u64) { pub fn set___reserved_1(&mut self, val: __u64) {
unsafe { unsafe {
let val: u64 = ::std::mem::transmute(val); let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(32usize, 32u8, val as u64) self._bitfield_1.set(34usize, 30u8, val as u64)
} }
} }
#[inline] #[inline]
@ -1247,6 +1275,8 @@ impl perf_event_attr {
ksymbol: __u64, ksymbol: __u64,
bpf_event: __u64, bpf_event: __u64,
aux_output: __u64, aux_output: __u64,
cgroup: __u64,
text_poke: __u64,
__reserved_1: __u64, __reserved_1: __u64,
) -> __BindgenBitfieldUnit<[u8; 8usize]> { ) -> __BindgenBitfieldUnit<[u8; 8usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default();
@ -1376,7 +1406,15 @@ impl perf_event_attr {
let aux_output: u64 = unsafe { ::std::mem::transmute(aux_output) }; let aux_output: u64 = unsafe { ::std::mem::transmute(aux_output) };
aux_output as u64 aux_output as u64
}); });
__bindgen_bitfield_unit.set(32usize, 32u8, { __bindgen_bitfield_unit.set(32usize, 1u8, {
let cgroup: u64 = unsafe { ::std::mem::transmute(cgroup) };
cgroup as u64
});
__bindgen_bitfield_unit.set(33usize, 1u8, {
let text_poke: u64 = unsafe { ::std::mem::transmute(text_poke) };
text_poke as u64
});
__bindgen_bitfield_unit.set(34usize, 30u8, {
let __reserved_1: u64 = unsafe { ::std::mem::transmute(__reserved_1) }; let __reserved_1: u64 = unsafe { ::std::mem::transmute(__reserved_1) };
__reserved_1 as u64 __reserved_1 as u64
}); });
@ -1400,7 +1438,10 @@ pub struct perf_event_mmap_page {
pub time_offset: __u64, pub time_offset: __u64,
pub time_zero: __u64, pub time_zero: __u64,
pub size: __u32, pub size: __u32,
pub __reserved: [__u8; 948usize], pub __reserved_1: __u32,
pub time_cycles: __u64,
pub time_mask: __u64,
pub __reserved: [__u8; 928usize],
pub data_head: __u64, pub data_head: __u64,
pub data_tail: __u64, pub data_tail: __u64,
pub data_offset: __u64, pub data_offset: __u64,
@ -1481,14 +1522,25 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 {
} }
} }
#[inline] #[inline]
pub fn cap_user_time_short(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) }
}
#[inline]
pub fn set_cap_user_time_short(&mut self, val: __u64) {
unsafe {
let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(5usize, 1u8, val as u64)
}
}
#[inline]
pub fn cap_____res(&self) -> __u64 { pub fn cap_____res(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 59u8) as u64) } unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 58u8) as u64) }
} }
#[inline] #[inline]
pub fn set_cap_____res(&mut self, val: __u64) { pub fn set_cap_____res(&mut self, val: __u64) {
unsafe { unsafe {
let val: u64 = ::std::mem::transmute(val); let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(5usize, 59u8, val as u64) self._bitfield_1.set(6usize, 58u8, val as u64)
} }
} }
#[inline] #[inline]
@ -1498,6 +1550,7 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 {
cap_user_rdpmc: __u64, cap_user_rdpmc: __u64,
cap_user_time: __u64, cap_user_time: __u64,
cap_user_time_zero: __u64, cap_user_time_zero: __u64,
cap_user_time_short: __u64,
cap_____res: __u64, cap_____res: __u64,
) -> __BindgenBitfieldUnit<[u8; 8usize]> { ) -> __BindgenBitfieldUnit<[u8; 8usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default();
@ -1522,7 +1575,11 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 {
let cap_user_time_zero: u64 = unsafe { ::std::mem::transmute(cap_user_time_zero) }; let cap_user_time_zero: u64 = unsafe { ::std::mem::transmute(cap_user_time_zero) };
cap_user_time_zero as u64 cap_user_time_zero as u64
}); });
__bindgen_bitfield_unit.set(5usize, 59u8, { __bindgen_bitfield_unit.set(5usize, 1u8, {
let cap_user_time_short: u64 = unsafe { ::std::mem::transmute(cap_user_time_short) };
cap_user_time_short as u64
});
__bindgen_bitfield_unit.set(6usize, 58u8, {
let cap_____res: u64 = unsafe { ::std::mem::transmute(cap_____res) }; let cap_____res: u64 = unsafe { ::std::mem::transmute(cap_____res) };
cap_____res as u64 cap_____res as u64
}); });
@ -1557,7 +1614,9 @@ pub enum perf_event_type {
PERF_RECORD_NAMESPACES = 16, PERF_RECORD_NAMESPACES = 16,
PERF_RECORD_KSYMBOL = 17, PERF_RECORD_KSYMBOL = 17,
PERF_RECORD_BPF_EVENT = 18, PERF_RECORD_BPF_EVENT = 18,
PERF_RECORD_MAX = 19, PERF_RECORD_CGROUP = 19,
PERF_RECORD_TEXT_POKE = 20,
PERF_RECORD_MAX = 21,
} }
pub const IFLA_XDP_UNSPEC: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_UNSPEC; pub const IFLA_XDP_UNSPEC: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_UNSPEC;
pub const IFLA_XDP_FD: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_FD; pub const IFLA_XDP_FD: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_FD;
@ -1604,25 +1663,26 @@ pub struct tcmsg {
pub tcm_parent: __u32, pub tcm_parent: __u32,
pub tcm_info: __u32, pub tcm_info: __u32,
} }
pub const TCA_UNSPEC: _bindgen_ty_92 = _bindgen_ty_92::TCA_UNSPEC; pub const TCA_UNSPEC: _bindgen_ty_94 = _bindgen_ty_94::TCA_UNSPEC;
pub const TCA_KIND: _bindgen_ty_92 = _bindgen_ty_92::TCA_KIND; pub const TCA_KIND: _bindgen_ty_94 = _bindgen_ty_94::TCA_KIND;
pub const TCA_OPTIONS: _bindgen_ty_92 = _bindgen_ty_92::TCA_OPTIONS; pub const TCA_OPTIONS: _bindgen_ty_94 = _bindgen_ty_94::TCA_OPTIONS;
pub const TCA_STATS: _bindgen_ty_92 = _bindgen_ty_92::TCA_STATS; pub const TCA_STATS: _bindgen_ty_94 = _bindgen_ty_94::TCA_STATS;
pub const TCA_XSTATS: _bindgen_ty_92 = _bindgen_ty_92::TCA_XSTATS; pub const TCA_XSTATS: _bindgen_ty_94 = _bindgen_ty_94::TCA_XSTATS;
pub const TCA_RATE: _bindgen_ty_92 = _bindgen_ty_92::TCA_RATE; pub const TCA_RATE: _bindgen_ty_94 = _bindgen_ty_94::TCA_RATE;
pub const TCA_FCNT: _bindgen_ty_92 = _bindgen_ty_92::TCA_FCNT; pub const TCA_FCNT: _bindgen_ty_94 = _bindgen_ty_94::TCA_FCNT;
pub const TCA_STATS2: _bindgen_ty_92 = _bindgen_ty_92::TCA_STATS2; pub const TCA_STATS2: _bindgen_ty_94 = _bindgen_ty_94::TCA_STATS2;
pub const TCA_STAB: _bindgen_ty_92 = _bindgen_ty_92::TCA_STAB; pub const TCA_STAB: _bindgen_ty_94 = _bindgen_ty_94::TCA_STAB;
pub const TCA_PAD: _bindgen_ty_92 = _bindgen_ty_92::TCA_PAD; pub const TCA_PAD: _bindgen_ty_94 = _bindgen_ty_94::TCA_PAD;
pub const TCA_DUMP_INVISIBLE: _bindgen_ty_92 = _bindgen_ty_92::TCA_DUMP_INVISIBLE; pub const TCA_DUMP_INVISIBLE: _bindgen_ty_94 = _bindgen_ty_94::TCA_DUMP_INVISIBLE;
pub const TCA_CHAIN: _bindgen_ty_92 = _bindgen_ty_92::TCA_CHAIN; pub const TCA_CHAIN: _bindgen_ty_94 = _bindgen_ty_94::TCA_CHAIN;
pub const TCA_HW_OFFLOAD: _bindgen_ty_92 = _bindgen_ty_92::TCA_HW_OFFLOAD; pub const TCA_HW_OFFLOAD: _bindgen_ty_94 = _bindgen_ty_94::TCA_HW_OFFLOAD;
pub const TCA_INGRESS_BLOCK: _bindgen_ty_92 = _bindgen_ty_92::TCA_INGRESS_BLOCK; pub const TCA_INGRESS_BLOCK: _bindgen_ty_94 = _bindgen_ty_94::TCA_INGRESS_BLOCK;
pub const TCA_EGRESS_BLOCK: _bindgen_ty_92 = _bindgen_ty_92::TCA_EGRESS_BLOCK; pub const TCA_EGRESS_BLOCK: _bindgen_ty_94 = _bindgen_ty_94::TCA_EGRESS_BLOCK;
pub const __TCA_MAX: _bindgen_ty_92 = _bindgen_ty_92::__TCA_MAX; pub const TCA_DUMP_FLAGS: _bindgen_ty_94 = _bindgen_ty_94::TCA_DUMP_FLAGS;
pub const __TCA_MAX: _bindgen_ty_94 = _bindgen_ty_94::__TCA_MAX;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_92 { pub enum _bindgen_ty_94 {
TCA_UNSPEC = 0, TCA_UNSPEC = 0,
TCA_KIND = 1, TCA_KIND = 1,
TCA_OPTIONS = 2, TCA_OPTIONS = 2,
@ -1638,24 +1698,25 @@ pub enum _bindgen_ty_92 {
TCA_HW_OFFLOAD = 12, TCA_HW_OFFLOAD = 12,
TCA_INGRESS_BLOCK = 13, TCA_INGRESS_BLOCK = 13,
TCA_EGRESS_BLOCK = 14, TCA_EGRESS_BLOCK = 14,
__TCA_MAX = 15, TCA_DUMP_FLAGS = 15,
} __TCA_MAX = 16,
pub const TCA_BPF_UNSPEC: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_UNSPEC; }
pub const TCA_BPF_ACT: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_ACT; pub const TCA_BPF_UNSPEC: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_UNSPEC;
pub const TCA_BPF_POLICE: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_POLICE; pub const TCA_BPF_ACT: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_ACT;
pub const TCA_BPF_CLASSID: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_CLASSID; pub const TCA_BPF_POLICE: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_POLICE;
pub const TCA_BPF_OPS_LEN: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_OPS_LEN; pub const TCA_BPF_CLASSID: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_CLASSID;
pub const TCA_BPF_OPS: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_OPS; pub const TCA_BPF_OPS_LEN: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_OPS_LEN;
pub const TCA_BPF_FD: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_FD; pub const TCA_BPF_OPS: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_OPS;
pub const TCA_BPF_NAME: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_NAME; pub const TCA_BPF_FD: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_FD;
pub const TCA_BPF_FLAGS: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_FLAGS; pub const TCA_BPF_NAME: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_NAME;
pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_FLAGS_GEN; pub const TCA_BPF_FLAGS: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_FLAGS;
pub const TCA_BPF_TAG: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_TAG; pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_FLAGS_GEN;
pub const TCA_BPF_ID: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_ID; pub const TCA_BPF_TAG: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_TAG;
pub const __TCA_BPF_MAX: _bindgen_ty_147 = _bindgen_ty_147::__TCA_BPF_MAX; pub const TCA_BPF_ID: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_ID;
pub const __TCA_BPF_MAX: _bindgen_ty_151 = _bindgen_ty_151::__TCA_BPF_MAX;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_147 { pub enum _bindgen_ty_151 {
TCA_BPF_UNSPEC = 0, TCA_BPF_UNSPEC = 0,
TCA_BPF_ACT = 1, TCA_BPF_ACT = 1,
TCA_BPF_POLICE = 2, TCA_BPF_POLICE = 2,

File diff suppressed because it is too large Load Diff

@ -802,7 +802,11 @@ pub enum perf_event_sample_format {
PERF_SAMPLE_TRANSACTION = 131072, PERF_SAMPLE_TRANSACTION = 131072,
PERF_SAMPLE_REGS_INTR = 262144, PERF_SAMPLE_REGS_INTR = 262144,
PERF_SAMPLE_PHYS_ADDR = 524288, PERF_SAMPLE_PHYS_ADDR = 524288,
PERF_SAMPLE_MAX = 1048576, PERF_SAMPLE_AUX = 1048576,
PERF_SAMPLE_CGROUP = 2097152,
PERF_SAMPLE_DATA_PAGE_SIZE = 4194304,
PERF_SAMPLE_CODE_PAGE_SIZE = 8388608,
PERF_SAMPLE_MAX = 16777216,
__PERF_SAMPLE_CALLCHAIN_EARLY = 9223372036854775808, __PERF_SAMPLE_CALLCHAIN_EARLY = 9223372036854775808,
} }
#[repr(C)] #[repr(C)]
@ -828,6 +832,8 @@ pub struct perf_event_attr {
pub aux_watermark: __u32, pub aux_watermark: __u32,
pub sample_max_stack: __u16, pub sample_max_stack: __u16,
pub __reserved_2: __u16, pub __reserved_2: __u16,
pub aux_sample_size: __u32,
pub __reserved_3: __u32,
} }
#[repr(C)] #[repr(C)]
#[derive(Copy, Clone)] #[derive(Copy, Clone)]
@ -1204,14 +1210,36 @@ impl perf_event_attr {
} }
} }
#[inline] #[inline]
pub fn cgroup(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u64) }
}
#[inline]
pub fn set_cgroup(&mut self, val: __u64) {
unsafe {
let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(32usize, 1u8, val as u64)
}
}
#[inline]
pub fn text_poke(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u64) }
}
#[inline]
pub fn set_text_poke(&mut self, val: __u64) {
unsafe {
let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(33usize, 1u8, val as u64)
}
}
#[inline]
pub fn __reserved_1(&self) -> __u64 { pub fn __reserved_1(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 32u8) as u64) } unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 30u8) as u64) }
} }
#[inline] #[inline]
pub fn set___reserved_1(&mut self, val: __u64) { pub fn set___reserved_1(&mut self, val: __u64) {
unsafe { unsafe {
let val: u64 = ::std::mem::transmute(val); let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(32usize, 32u8, val as u64) self._bitfield_1.set(34usize, 30u8, val as u64)
} }
} }
#[inline] #[inline]
@ -1247,6 +1275,8 @@ impl perf_event_attr {
ksymbol: __u64, ksymbol: __u64,
bpf_event: __u64, bpf_event: __u64,
aux_output: __u64, aux_output: __u64,
cgroup: __u64,
text_poke: __u64,
__reserved_1: __u64, __reserved_1: __u64,
) -> __BindgenBitfieldUnit<[u8; 8usize]> { ) -> __BindgenBitfieldUnit<[u8; 8usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default();
@ -1376,7 +1406,15 @@ impl perf_event_attr {
let aux_output: u64 = unsafe { ::std::mem::transmute(aux_output) }; let aux_output: u64 = unsafe { ::std::mem::transmute(aux_output) };
aux_output as u64 aux_output as u64
}); });
__bindgen_bitfield_unit.set(32usize, 32u8, { __bindgen_bitfield_unit.set(32usize, 1u8, {
let cgroup: u64 = unsafe { ::std::mem::transmute(cgroup) };
cgroup as u64
});
__bindgen_bitfield_unit.set(33usize, 1u8, {
let text_poke: u64 = unsafe { ::std::mem::transmute(text_poke) };
text_poke as u64
});
__bindgen_bitfield_unit.set(34usize, 30u8, {
let __reserved_1: u64 = unsafe { ::std::mem::transmute(__reserved_1) }; let __reserved_1: u64 = unsafe { ::std::mem::transmute(__reserved_1) };
__reserved_1 as u64 __reserved_1 as u64
}); });
@ -1400,7 +1438,10 @@ pub struct perf_event_mmap_page {
pub time_offset: __u64, pub time_offset: __u64,
pub time_zero: __u64, pub time_zero: __u64,
pub size: __u32, pub size: __u32,
pub __reserved: [__u8; 948usize], pub __reserved_1: __u32,
pub time_cycles: __u64,
pub time_mask: __u64,
pub __reserved: [__u8; 928usize],
pub data_head: __u64, pub data_head: __u64,
pub data_tail: __u64, pub data_tail: __u64,
pub data_offset: __u64, pub data_offset: __u64,
@ -1481,14 +1522,25 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 {
} }
} }
#[inline] #[inline]
pub fn cap_user_time_short(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) }
}
#[inline]
pub fn set_cap_user_time_short(&mut self, val: __u64) {
unsafe {
let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(5usize, 1u8, val as u64)
}
}
#[inline]
pub fn cap_____res(&self) -> __u64 { pub fn cap_____res(&self) -> __u64 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 59u8) as u64) } unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 58u8) as u64) }
} }
#[inline] #[inline]
pub fn set_cap_____res(&mut self, val: __u64) { pub fn set_cap_____res(&mut self, val: __u64) {
unsafe { unsafe {
let val: u64 = ::std::mem::transmute(val); let val: u64 = ::std::mem::transmute(val);
self._bitfield_1.set(5usize, 59u8, val as u64) self._bitfield_1.set(6usize, 58u8, val as u64)
} }
} }
#[inline] #[inline]
@ -1498,6 +1550,7 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 {
cap_user_rdpmc: __u64, cap_user_rdpmc: __u64,
cap_user_time: __u64, cap_user_time: __u64,
cap_user_time_zero: __u64, cap_user_time_zero: __u64,
cap_user_time_short: __u64,
cap_____res: __u64, cap_____res: __u64,
) -> __BindgenBitfieldUnit<[u8; 8usize]> { ) -> __BindgenBitfieldUnit<[u8; 8usize]> {
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default();
@ -1522,7 +1575,11 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 {
let cap_user_time_zero: u64 = unsafe { ::std::mem::transmute(cap_user_time_zero) }; let cap_user_time_zero: u64 = unsafe { ::std::mem::transmute(cap_user_time_zero) };
cap_user_time_zero as u64 cap_user_time_zero as u64
}); });
__bindgen_bitfield_unit.set(5usize, 59u8, { __bindgen_bitfield_unit.set(5usize, 1u8, {
let cap_user_time_short: u64 = unsafe { ::std::mem::transmute(cap_user_time_short) };
cap_user_time_short as u64
});
__bindgen_bitfield_unit.set(6usize, 58u8, {
let cap_____res: u64 = unsafe { ::std::mem::transmute(cap_____res) }; let cap_____res: u64 = unsafe { ::std::mem::transmute(cap_____res) };
cap_____res as u64 cap_____res as u64
}); });
@ -1557,7 +1614,9 @@ pub enum perf_event_type {
PERF_RECORD_NAMESPACES = 16, PERF_RECORD_NAMESPACES = 16,
PERF_RECORD_KSYMBOL = 17, PERF_RECORD_KSYMBOL = 17,
PERF_RECORD_BPF_EVENT = 18, PERF_RECORD_BPF_EVENT = 18,
PERF_RECORD_MAX = 19, PERF_RECORD_CGROUP = 19,
PERF_RECORD_TEXT_POKE = 20,
PERF_RECORD_MAX = 21,
} }
pub const IFLA_XDP_UNSPEC: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_UNSPEC; pub const IFLA_XDP_UNSPEC: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_UNSPEC;
pub const IFLA_XDP_FD: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_FD; pub const IFLA_XDP_FD: _bindgen_ty_80 = _bindgen_ty_80::IFLA_XDP_FD;
@ -1604,25 +1663,26 @@ pub struct tcmsg {
pub tcm_parent: __u32, pub tcm_parent: __u32,
pub tcm_info: __u32, pub tcm_info: __u32,
} }
pub const TCA_UNSPEC: _bindgen_ty_92 = _bindgen_ty_92::TCA_UNSPEC; pub const TCA_UNSPEC: _bindgen_ty_94 = _bindgen_ty_94::TCA_UNSPEC;
pub const TCA_KIND: _bindgen_ty_92 = _bindgen_ty_92::TCA_KIND; pub const TCA_KIND: _bindgen_ty_94 = _bindgen_ty_94::TCA_KIND;
pub const TCA_OPTIONS: _bindgen_ty_92 = _bindgen_ty_92::TCA_OPTIONS; pub const TCA_OPTIONS: _bindgen_ty_94 = _bindgen_ty_94::TCA_OPTIONS;
pub const TCA_STATS: _bindgen_ty_92 = _bindgen_ty_92::TCA_STATS; pub const TCA_STATS: _bindgen_ty_94 = _bindgen_ty_94::TCA_STATS;
pub const TCA_XSTATS: _bindgen_ty_92 = _bindgen_ty_92::TCA_XSTATS; pub const TCA_XSTATS: _bindgen_ty_94 = _bindgen_ty_94::TCA_XSTATS;
pub const TCA_RATE: _bindgen_ty_92 = _bindgen_ty_92::TCA_RATE; pub const TCA_RATE: _bindgen_ty_94 = _bindgen_ty_94::TCA_RATE;
pub const TCA_FCNT: _bindgen_ty_92 = _bindgen_ty_92::TCA_FCNT; pub const TCA_FCNT: _bindgen_ty_94 = _bindgen_ty_94::TCA_FCNT;
pub const TCA_STATS2: _bindgen_ty_92 = _bindgen_ty_92::TCA_STATS2; pub const TCA_STATS2: _bindgen_ty_94 = _bindgen_ty_94::TCA_STATS2;
pub const TCA_STAB: _bindgen_ty_92 = _bindgen_ty_92::TCA_STAB; pub const TCA_STAB: _bindgen_ty_94 = _bindgen_ty_94::TCA_STAB;
pub const TCA_PAD: _bindgen_ty_92 = _bindgen_ty_92::TCA_PAD; pub const TCA_PAD: _bindgen_ty_94 = _bindgen_ty_94::TCA_PAD;
pub const TCA_DUMP_INVISIBLE: _bindgen_ty_92 = _bindgen_ty_92::TCA_DUMP_INVISIBLE; pub const TCA_DUMP_INVISIBLE: _bindgen_ty_94 = _bindgen_ty_94::TCA_DUMP_INVISIBLE;
pub const TCA_CHAIN: _bindgen_ty_92 = _bindgen_ty_92::TCA_CHAIN; pub const TCA_CHAIN: _bindgen_ty_94 = _bindgen_ty_94::TCA_CHAIN;
pub const TCA_HW_OFFLOAD: _bindgen_ty_92 = _bindgen_ty_92::TCA_HW_OFFLOAD; pub const TCA_HW_OFFLOAD: _bindgen_ty_94 = _bindgen_ty_94::TCA_HW_OFFLOAD;
pub const TCA_INGRESS_BLOCK: _bindgen_ty_92 = _bindgen_ty_92::TCA_INGRESS_BLOCK; pub const TCA_INGRESS_BLOCK: _bindgen_ty_94 = _bindgen_ty_94::TCA_INGRESS_BLOCK;
pub const TCA_EGRESS_BLOCK: _bindgen_ty_92 = _bindgen_ty_92::TCA_EGRESS_BLOCK; pub const TCA_EGRESS_BLOCK: _bindgen_ty_94 = _bindgen_ty_94::TCA_EGRESS_BLOCK;
pub const __TCA_MAX: _bindgen_ty_92 = _bindgen_ty_92::__TCA_MAX; pub const TCA_DUMP_FLAGS: _bindgen_ty_94 = _bindgen_ty_94::TCA_DUMP_FLAGS;
pub const __TCA_MAX: _bindgen_ty_94 = _bindgen_ty_94::__TCA_MAX;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_92 { pub enum _bindgen_ty_94 {
TCA_UNSPEC = 0, TCA_UNSPEC = 0,
TCA_KIND = 1, TCA_KIND = 1,
TCA_OPTIONS = 2, TCA_OPTIONS = 2,
@ -1638,24 +1698,25 @@ pub enum _bindgen_ty_92 {
TCA_HW_OFFLOAD = 12, TCA_HW_OFFLOAD = 12,
TCA_INGRESS_BLOCK = 13, TCA_INGRESS_BLOCK = 13,
TCA_EGRESS_BLOCK = 14, TCA_EGRESS_BLOCK = 14,
__TCA_MAX = 15, TCA_DUMP_FLAGS = 15,
} __TCA_MAX = 16,
pub const TCA_BPF_UNSPEC: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_UNSPEC; }
pub const TCA_BPF_ACT: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_ACT; pub const TCA_BPF_UNSPEC: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_UNSPEC;
pub const TCA_BPF_POLICE: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_POLICE; pub const TCA_BPF_ACT: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_ACT;
pub const TCA_BPF_CLASSID: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_CLASSID; pub const TCA_BPF_POLICE: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_POLICE;
pub const TCA_BPF_OPS_LEN: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_OPS_LEN; pub const TCA_BPF_CLASSID: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_CLASSID;
pub const TCA_BPF_OPS: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_OPS; pub const TCA_BPF_OPS_LEN: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_OPS_LEN;
pub const TCA_BPF_FD: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_FD; pub const TCA_BPF_OPS: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_OPS;
pub const TCA_BPF_NAME: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_NAME; pub const TCA_BPF_FD: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_FD;
pub const TCA_BPF_FLAGS: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_FLAGS; pub const TCA_BPF_NAME: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_NAME;
pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_FLAGS_GEN; pub const TCA_BPF_FLAGS: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_FLAGS;
pub const TCA_BPF_TAG: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_TAG; pub const TCA_BPF_FLAGS_GEN: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_FLAGS_GEN;
pub const TCA_BPF_ID: _bindgen_ty_147 = _bindgen_ty_147::TCA_BPF_ID; pub const TCA_BPF_TAG: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_TAG;
pub const __TCA_BPF_MAX: _bindgen_ty_147 = _bindgen_ty_147::__TCA_BPF_MAX; pub const TCA_BPF_ID: _bindgen_ty_151 = _bindgen_ty_151::TCA_BPF_ID;
pub const __TCA_BPF_MAX: _bindgen_ty_151 = _bindgen_ty_151::__TCA_BPF_MAX;
#[repr(u32)] #[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_147 { pub enum _bindgen_ty_151 {
TCA_BPF_UNSPEC = 0, TCA_BPF_UNSPEC = 0,
TCA_BPF_ACT = 1, TCA_BPF_ACT = 1,
TCA_BPF_POLICE = 2, TCA_BPF_POLICE = 2,

@ -3,6 +3,8 @@
mod btf_internal_bindings; mod btf_internal_bindings;
#[cfg(target_arch = "aarch64")] #[cfg(target_arch = "aarch64")]
mod linux_bindings_aarch64; mod linux_bindings_aarch64;
#[cfg(target_arch = "arm")]
mod linux_bindings_armv7;
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
mod linux_bindings_x86_64; mod linux_bindings_x86_64;
@ -11,5 +13,8 @@ pub use btf_internal_bindings::*;
#[cfg(target_arch = "x86_64")] #[cfg(target_arch = "x86_64")]
pub use linux_bindings_x86_64::*; pub use linux_bindings_x86_64::*;
#[cfg(target_arch = "arm")]
pub use linux_bindings_armv7::*;
#[cfg(target_arch = "aarch64")] #[cfg(target_arch = "aarch64")]
pub use linux_bindings_aarch64::*; pub use linux_bindings_aarch64::*;

@ -64,6 +64,7 @@ pub use queue::Queue;
pub use sock::{SockHash, SockMap}; pub use sock::{SockHash, SockMap};
pub use stack::Stack; pub use stack::Stack;
pub use stack_trace::StackTraceMap; pub use stack_trace::StackTraceMap;
#[derive(Error, Debug)] #[derive(Error, Debug)]
pub enum MapError { pub enum MapError {
#[error("map `{name}` not found ")] #[error("map `{name}` not found ")]
@ -84,7 +85,7 @@ pub enum MapError {
#[error("failed to create map `{name}`: {code}")] #[error("failed to create map `{name}`: {code}")]
CreateError { CreateError {
name: String, name: String,
code: i64, code: libc::c_long,
io_error: io::Error, io_error: io::Error,
}, },
@ -109,7 +110,7 @@ pub enum MapError {
#[error("the `{call}` syscall failed with code {code} io_error {io_error}")] #[error("the `{call}` syscall failed with code {code} io_error {io_error}")]
SyscallError { SyscallError {
call: String, call: String,
code: i64, code: libc::c_long,
io_error: io::Error, io_error: io::Error,
}, },

@ -280,7 +280,7 @@ unsafe fn mmap(
prot: c_int, prot: c_int,
flags: c_int, flags: c_int,
fd: i32, fd: i32,
offset: i64, offset: libc::off_t,
) -> *mut c_void { ) -> *mut c_void {
#[cfg(not(test))] #[cfg(not(test))]
return libc::mmap(addr, len, prot, flags, fd, offset); return libc::mmap(addr, len, prot, flags, fd, offset);

@ -64,7 +64,7 @@ unsafe fn syscall_impl(call: Syscall) -> SysResult {
flags, flags,
} => libc::syscall(SYS_perf_event_open, &attr, pid, cpu, group, flags), } => libc::syscall(SYS_perf_event_open, &attr, pid, cpu, group, flags),
PerfEventIoctl { fd, request, arg } => { PerfEventIoctl { fd, request, arg } => {
libc::ioctl(fd, request.try_into().unwrap(), arg) as i64 libc::ioctl(fd, request.try_into().unwrap(), arg) as libc::c_long
} }
}; };

@ -228,6 +228,8 @@ pub const SO_TIMESTAMPING_NEW: u32 = 65;
pub const SO_RCVTIMEO_NEW: u32 = 66; pub const SO_RCVTIMEO_NEW: u32 = 66;
pub const SO_SNDTIMEO_NEW: u32 = 67; pub const SO_SNDTIMEO_NEW: u32 = 67;
pub const SO_DETACH_REUSEPORT_BPF: u32 = 68; pub const SO_DETACH_REUSEPORT_BPF: u32 = 68;
pub const SO_PREFER_BUSY_POLL: u32 = 69;
pub const SO_BUSY_POLL_BUDGET: u32 = 70;
pub const SO_TIMESTAMP: u32 = 29; pub const SO_TIMESTAMP: u32 = 29;
pub const SO_TIMESTAMPNS: u32 = 35; pub const SO_TIMESTAMPNS: u32 = 35;
pub const SO_TIMESTAMPING: u32 = 37; pub const SO_TIMESTAMPING: u32 = 37;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,3 @@
pub mod bindings;
pub mod getters;
pub mod helpers;

@ -4,6 +4,9 @@
#[cfg(bpf_target_arch = "x86_64")] #[cfg(bpf_target_arch = "x86_64")]
mod x86_64; mod x86_64;
#[cfg(bpf_target_arch = "arm")]
mod armv7;
#[cfg(bpf_target_arch = "aarch64")] #[cfg(bpf_target_arch = "aarch64")]
mod aarch64; mod aarch64;
@ -11,6 +14,9 @@ mod gen {
#[cfg(bpf_target_arch = "x86_64")] #[cfg(bpf_target_arch = "x86_64")]
pub use super::x86_64::*; pub use super::x86_64::*;
#[cfg(bpf_target_arch = "arm")]
pub use super::armv7::*;
#[cfg(bpf_target_arch = "aarch64")] #[cfg(bpf_target_arch = "aarch64")]
pub use super::aarch64::*; pub use super::aarch64::*;
} }

@ -228,6 +228,8 @@ pub const SO_TIMESTAMPING_NEW: u32 = 65;
pub const SO_RCVTIMEO_NEW: u32 = 66; pub const SO_RCVTIMEO_NEW: u32 = 66;
pub const SO_SNDTIMEO_NEW: u32 = 67; pub const SO_SNDTIMEO_NEW: u32 = 67;
pub const SO_DETACH_REUSEPORT_BPF: u32 = 68; pub const SO_DETACH_REUSEPORT_BPF: u32 = 68;
pub const SO_PREFER_BUSY_POLL: u32 = 69;
pub const SO_BUSY_POLL_BUDGET: u32 = 70;
pub const SO_TIMESTAMP: u32 = 29; pub const SO_TIMESTAMP: u32 = 29;
pub const SO_TIMESTAMPNS: u32 = 35; pub const SO_TIMESTAMPNS: u32 = 35;
pub const SO_TIMESTAMPING: u32 = 37; pub const SO_TIMESTAMPING: u32 = 37;

@ -20,6 +20,9 @@ mod ad {
pub type c_int = i32; pub type c_int = i32;
pub type c_uint = u32; pub type c_uint = u32;
#[cfg(bpf_target_arch = "arm")]
pub type c_char = super::c_uchar;
#[cfg(bpf_target_arch = "aarch64")] #[cfg(bpf_target_arch = "aarch64")]
pub type c_char = super::c_uchar; pub type c_char = super::c_uchar;

@ -168,6 +168,9 @@ fn codegen_bindings(opts: &Options) -> Result<(), anyhow::Error> {
Architecture::X86_64 => { Architecture::X86_64 => {
bindgen = bindgen.clang_args(&["-I", "/usr/include/x86_64-linux-gnu"]); bindgen = bindgen.clang_args(&["-I", "/usr/include/x86_64-linux-gnu"]);
} }
Architecture::ARMv7 => {
bindgen = bindgen.clang_args(&["-I", "/usr/arm-linux-gnueabi/include"]);
}
Architecture::AArch64 => { Architecture::AArch64 => {
bindgen = bindgen.clang_args(&["-I", "/usr/aarch64-linux-gnu/include"]); bindgen = bindgen.clang_args(&["-I", "/usr/aarch64-linux-gnu/include"]);
} }

@ -6,11 +6,16 @@ use std::path::PathBuf;
use structopt::StructOpt; use structopt::StructOpt;
const SUPPORTED_ARCHS: &'static [Architecture] = &[Architecture::X86_64, Architecture::AArch64]; const SUPPORTED_ARCHS: &'static [Architecture] = &[
Architecture::X86_64,
Architecture::ARMv7,
Architecture::AArch64,
];
#[derive(Debug, Copy, Clone)] #[derive(Debug, Copy, Clone)]
pub enum Architecture { pub enum Architecture {
X86_64, X86_64,
ARMv7,
AArch64, AArch64,
} }
@ -26,6 +31,7 @@ impl std::str::FromStr for Architecture {
fn from_str(s: &str) -> Result<Self, Self::Err> { fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(match s { Ok(match s {
"x86_64" => Architecture::X86_64, "x86_64" => Architecture::X86_64,
"armv7" => Architecture::ARMv7,
"aarch64" => Architecture::AArch64, "aarch64" => Architecture::AArch64,
_ => return Err("invalid architecture".to_owned()), _ => return Err("invalid architecture".to_owned()),
}) })
@ -36,6 +42,7 @@ impl std::fmt::Display for Architecture {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(match self { f.write_str(match self {
Architecture::X86_64 => "x86_64", Architecture::X86_64 => "x86_64",
Architecture::ARMv7 => "armv7",
Architecture::AArch64 => "aarch64", Architecture::AArch64 => "aarch64",
}) })
} }

Loading…
Cancel
Save