diff --git a/perf-event-open-sys/src/bindings_aarch64.rs b/perf-event-open-sys/src/bindings_aarch64.rs index 40750455..403e21a3 100644 --- a/perf-event-open-sys/src/bindings_aarch64.rs +++ b/perf-event-open-sys/src/bindings_aarch64.rs @@ -23,7 +23,7 @@ #![allow(clippy::too_many_arguments)] #![allow(clippy::useless_transmute)] -/* automatically generated by rust-bindgen 0.61.0 */ +/* automatically generated by rust-bindgen 0.71.1 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] @@ -41,10 +41,7 @@ where Storage: AsRef<[u8]> + AsMut<[u8]>, { #[inline] - pub fn get_bit(&self, index: usize) -> bool { - debug_assert!(index / 8 < self.storage.as_ref().len()); - let byte_index = index / 8; - let byte = self.storage.as_ref()[byte_index]; + fn extract_bit(byte: u8, index: usize) -> bool { let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { @@ -54,10 +51,21 @@ where byte & mask == mask } #[inline] - pub fn set_bit(&mut self, index: usize, val: bool) { + pub fn get_bit(&self, index: usize) -> bool { debug_assert!(index / 8 < self.storage.as_ref().len()); let byte_index = index / 8; - let byte = &mut self.storage.as_mut()[byte_index]; + let byte = self.storage.as_ref()[byte_index]; + Self::extract_bit(byte, index) + } + #[inline] + pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize); + Self::extract_bit(byte, index) + } + #[inline] + fn change_bit(byte: u8, index: usize, val: bool) -> u8 { let bit_index = if cfg!(target_endian = "big") { 7 - (index % 8) } else { @@ -65,12 +73,27 @@ where }; let mask = 1 << bit_index; if val { - *byte |= mask; + byte | mask } else { - *byte &= !mask; + byte & !mask } } #[inline] + pub fn set_bit(&mut self, index: usize, val: bool) { + debug_assert!(index / 8 < self.storage.as_ref().len()); + let byte_index = index / 8; + let byte = &mut self.storage.as_mut()[byte_index]; + *byte = Self::change_bit(*byte, index, val); + } + #[inline] + pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) { + debug_assert!(index / 8 < core::mem::size_of::()); + let byte_index = index / 8; + let byte = + (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize); + *byte = Self::change_bit(*byte, index, val); + } + #[inline] pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); @@ -89,6 +112,24 @@ where val } #[inline] + pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + let mut val = 0; + for i in 0..(bit_width as usize) { + if Self::raw_get_bit(this, i + bit_offset) { + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + val |= 1 << index; + } + } + val + } + #[inline] pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) { debug_assert!(bit_width <= 64); debug_assert!(bit_offset / 8 < self.storage.as_ref().len()); @@ -104,6 +145,22 @@ where self.set_bit(index + bit_offset, val_bit_is_set); } } + #[inline] + pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) { + debug_assert!(bit_width <= 64); + debug_assert!(bit_offset / 8 < core::mem::size_of::()); + debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::()); + for i in 0..(bit_width as usize) { + let mask = 1 << i; + let val_bit_is_set = val & mask == mask; + let index = if cfg!(target_endian = "big") { + bit_width as usize - 1 - i + } else { + i + }; + Self::raw_set_bit(this, index + bit_offset, val_bit_is_set); + } + } } #[repr(C)] #[derive(Default)] @@ -136,6 +193,7 @@ impl ::std::fmt::Debug for __IncompleteArrayField { } } pub const __BITS_PER_LONG: u32 = 64; +pub const __BITS_PER_LONG_LONG: u32 = 64; pub const __FD_SETSIZE: u32 = 1024; pub const _IOC_NRBITS: u32 = 8; pub const _IOC_TYPEBITS: u32 = 8; @@ -168,6 +226,7 @@ pub const PERF_ATTR_SIZE_VER4: u32 = 104; pub const PERF_ATTR_SIZE_VER5: u32 = 112; pub const PERF_ATTR_SIZE_VER6: u32 = 120; pub const PERF_ATTR_SIZE_VER7: u32 = 128; +pub const PERF_ATTR_SIZE_VER8: u32 = 136; pub const PERF_RECORD_MISC_CPUMODE_MASK: u32 = 7; pub const PERF_RECORD_MISC_CPUMODE_UNKNOWN: u32 = 0; pub const PERF_RECORD_MISC_KERNEL: u32 = 1; @@ -225,6 +284,11 @@ pub const PERF_MEM_LVLNUM_L1: u32 = 1; pub const PERF_MEM_LVLNUM_L2: u32 = 2; pub const PERF_MEM_LVLNUM_L3: u32 = 3; pub const PERF_MEM_LVLNUM_L4: u32 = 4; +pub const PERF_MEM_LVLNUM_L2_MHB: u32 = 5; +pub const PERF_MEM_LVLNUM_MSC: u32 = 6; +pub const PERF_MEM_LVLNUM_UNC: u32 = 8; +pub const PERF_MEM_LVLNUM_CXL: u32 = 9; +pub const PERF_MEM_LVLNUM_IO: u32 = 10; pub const PERF_MEM_LVLNUM_ANY_CACHE: u32 = 11; pub const PERF_MEM_LVLNUM_LFB: u32 = 12; pub const PERF_MEM_LVLNUM_RAM: u32 = 13; @@ -238,6 +302,7 @@ pub const PERF_MEM_SNOOP_MISS: u32 = 8; pub const PERF_MEM_SNOOP_HITM: u32 = 16; pub const PERF_MEM_SNOOP_SHIFT: u32 = 19; pub const PERF_MEM_SNOOPX_FWD: u32 = 1; +pub const PERF_MEM_SNOOPX_PEER: u32 = 2; pub const PERF_MEM_SNOOPX_SHIFT: u32 = 38; pub const PERF_MEM_LOCK_NA: u32 = 1; pub const PERF_MEM_LOCK_LOCKED: u32 = 2; @@ -259,6 +324,7 @@ pub const PERF_MEM_HOPS_1: u32 = 2; pub const PERF_MEM_HOPS_2: u32 = 3; pub const PERF_MEM_HOPS_3: u32 = 4; pub const PERF_MEM_HOPS_SHIFT: u32 = 43; +pub const PERF_BRANCH_ENTRY_INFO_BITS_MAX: u32 = 33; pub const __NR_io_setup: u32 = 0; pub const __NR_io_destroy: u32 = 1; pub const __NR_io_submit: u32 = 2; @@ -284,7 +350,7 @@ pub const __NR_epoll_ctl: u32 = 21; pub const __NR_epoll_pwait: u32 = 22; pub const __NR_dup: u32 = 23; pub const __NR_dup3: u32 = 24; -pub const __NR3264_fcntl: u32 = 25; +pub const __NR_fcntl: u32 = 25; pub const __NR_inotify_init1: u32 = 26; pub const __NR_inotify_add_watch: u32 = 27; pub const __NR_inotify_rm_watch: u32 = 28; @@ -302,10 +368,10 @@ pub const __NR_umount2: u32 = 39; pub const __NR_mount: u32 = 40; pub const __NR_pivot_root: u32 = 41; pub const __NR_nfsservctl: u32 = 42; -pub const __NR3264_statfs: u32 = 43; -pub const __NR3264_fstatfs: u32 = 44; -pub const __NR3264_truncate: u32 = 45; -pub const __NR3264_ftruncate: u32 = 46; +pub const __NR_statfs: u32 = 43; +pub const __NR_fstatfs: u32 = 44; +pub const __NR_truncate: u32 = 45; +pub const __NR_ftruncate: u32 = 46; pub const __NR_fallocate: u32 = 47; pub const __NR_faccessat: u32 = 48; pub const __NR_chdir: u32 = 49; @@ -321,7 +387,7 @@ pub const __NR_vhangup: u32 = 58; pub const __NR_pipe2: u32 = 59; pub const __NR_quotactl: u32 = 60; pub const __NR_getdents64: u32 = 61; -pub const __NR3264_lseek: u32 = 62; +pub const __NR_lseek: u32 = 62; pub const __NR_read: u32 = 63; pub const __NR_write: u32 = 64; pub const __NR_readv: u32 = 65; @@ -330,7 +396,7 @@ pub const __NR_pread64: u32 = 67; pub const __NR_pwrite64: u32 = 68; pub const __NR_preadv: u32 = 69; pub const __NR_pwritev: u32 = 70; -pub const __NR3264_sendfile: u32 = 71; +pub const __NR_sendfile: u32 = 71; pub const __NR_pselect6: u32 = 72; pub const __NR_ppoll: u32 = 73; pub const __NR_signalfd4: u32 = 74; @@ -338,8 +404,8 @@ pub const __NR_vmsplice: u32 = 75; pub const __NR_splice: u32 = 76; pub const __NR_tee: u32 = 77; pub const __NR_readlinkat: u32 = 78; -pub const __NR3264_fstatat: u32 = 79; -pub const __NR3264_fstat: u32 = 80; +pub const __NR_newfstatat: u32 = 79; +pub const __NR_fstat: u32 = 80; pub const __NR_sync: u32 = 81; pub const __NR_fsync: u32 = 82; pub const __NR_fdatasync: u32 = 83; @@ -481,8 +547,8 @@ pub const __NR_request_key: u32 = 218; pub const __NR_keyctl: u32 = 219; pub const __NR_clone: u32 = 220; pub const __NR_execve: u32 = 221; -pub const __NR3264_mmap: u32 = 222; -pub const __NR3264_fadvise64: u32 = 223; +pub const __NR_mmap: u32 = 222; +pub const __NR_fadvise64: u32 = 223; pub const __NR_swapon: u32 = 224; pub const __NR_swapoff: u32 = 225; pub const __NR_mprotect: u32 = 226; @@ -503,7 +569,6 @@ pub const __NR_rt_tgsigqueueinfo: u32 = 240; pub const __NR_perf_event_open: u32 = 241; pub const __NR_accept4: u32 = 242; pub const __NR_recvmmsg: u32 = 243; -pub const __NR_arch_specific_syscall: u32 = 244; pub const __NR_wait4: u32 = 260; pub const __NR_prlimit64: u32 = 261; pub const __NR_fanotify_init: u32 = 262; @@ -566,18 +631,22 @@ pub const __NR_memfd_secret: u32 = 447; pub const __NR_process_mrelease: u32 = 448; pub const __NR_futex_waitv: u32 = 449; pub const __NR_set_mempolicy_home_node: u32 = 450; -pub const __NR_syscalls: u32 = 451; -pub const __NR_fcntl: u32 = 25; -pub const __NR_statfs: u32 = 43; -pub const __NR_fstatfs: u32 = 44; -pub const __NR_truncate: u32 = 45; -pub const __NR_ftruncate: u32 = 46; -pub const __NR_lseek: u32 = 62; -pub const __NR_sendfile: u32 = 71; -pub const __NR_newfstatat: u32 = 79; -pub const __NR_fstat: u32 = 80; -pub const __NR_mmap: u32 = 222; -pub const __NR_fadvise64: u32 = 223; +pub const __NR_cachestat: u32 = 451; +pub const __NR_fchmodat2: u32 = 452; +pub const __NR_map_shadow_stack: u32 = 453; +pub const __NR_futex_wake: u32 = 454; +pub const __NR_futex_wait: u32 = 455; +pub const __NR_futex_requeue: u32 = 456; +pub const __NR_statmount: u32 = 457; +pub const __NR_listmount: u32 = 458; +pub const __NR_lsm_get_self_attr: u32 = 459; +pub const __NR_lsm_set_self_attr: u32 = 460; +pub const __NR_lsm_list_modules: u32 = 461; +pub const __NR_mseal: u32 = 462; +pub const __NR_setxattrat: u32 = 463; +pub const __NR_getxattrat: u32 = 464; +pub const __NR_listxattrat: u32 = 465; +pub const __NR_removexattrat: u32 = 466; pub type __s8 = ::std::os::raw::c_schar; pub type __u8 = ::std::os::raw::c_uchar; pub type __s16 = ::std::os::raw::c_short; @@ -591,31 +660,13 @@ pub type __u64 = ::std::os::raw::c_ulonglong; pub struct __kernel_fd_set { pub fds_bits: [::std::os::raw::c_ulong; 16usize], } -#[test] -fn bindgen_test_layout___kernel_fd_set() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fd_set> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fd_set>(), - 128usize, - concat!("Size of: ", stringify!(__kernel_fd_set)) - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fd_set>(), - 8usize, - concat!("Alignment of ", stringify!(__kernel_fd_set)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).fds_bits) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__kernel_fd_set), - "::", - stringify!(fds_bits) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fd_set"][::std::mem::size_of::<__kernel_fd_set>() - 128usize]; + ["Alignment of __kernel_fd_set"][::std::mem::align_of::<__kernel_fd_set>() - 8usize]; + ["Offset of field: __kernel_fd_set::fds_bits"] + [::std::mem::offset_of!(__kernel_fd_set, fds_bits) - 0usize]; +}; pub type __kernel_sighandler_t = ::std::option::Option; pub type __kernel_key_t = ::std::os::raw::c_int; @@ -643,31 +694,13 @@ pub type __kernel_ptrdiff_t = __kernel_long_t; pub struct __kernel_fsid_t { pub val: [::std::os::raw::c_int; 2usize], } -#[test] -fn bindgen_test_layout___kernel_fsid_t() { - const UNINIT: ::std::mem::MaybeUninit<__kernel_fsid_t> = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::<__kernel_fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__kernel_fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__kernel_fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__kernel_fsid_t)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__kernel_fsid_t), - "::", - stringify!(val) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __kernel_fsid_t"][::std::mem::size_of::<__kernel_fsid_t>() - 8usize]; + ["Alignment of __kernel_fsid_t"][::std::mem::align_of::<__kernel_fsid_t>() - 4usize]; + ["Offset of field: __kernel_fsid_t::val"] + [::std::mem::offset_of!(__kernel_fsid_t, val) - 0usize]; +}; pub type __kernel_off_t = __kernel_long_t; pub type __kernel_loff_t = ::std::os::raw::c_longlong; pub type __kernel_old_time_t = __kernel_long_t; @@ -679,6 +712,8 @@ pub type __kernel_clockid_t = ::std::os::raw::c_int; pub type __kernel_caddr_t = *mut ::std::os::raw::c_char; pub type __kernel_uid16_t = ::std::os::raw::c_ushort; pub type __kernel_gid16_t = ::std::os::raw::c_ushort; +pub type __s128 = i128; +pub type __u128 = u128; pub type __le16 = __u16; pub type __be16 = __u16; pub type __le32 = __u32; @@ -766,8 +801,7 @@ pub const PERF_SAMPLE_DATA_PAGE_SIZE: perf_event_sample_format = 4194304; pub const PERF_SAMPLE_CODE_PAGE_SIZE: perf_event_sample_format = 8388608; pub const PERF_SAMPLE_WEIGHT_STRUCT: perf_event_sample_format = 16777216; pub const PERF_SAMPLE_MAX: perf_event_sample_format = 33554432; -pub const __PERF_SAMPLE_CALLCHAIN_EARLY: perf_event_sample_format = 9223372036854775808; -pub type perf_event_sample_format = ::std::os::raw::c_ulong; +pub type perf_event_sample_format = ::std::os::raw::c_uint; pub const PERF_SAMPLE_BRANCH_USER_SHIFT: perf_branch_sample_type_shift = 0; pub const PERF_SAMPLE_BRANCH_KERNEL_SHIFT: perf_branch_sample_type_shift = 1; pub const PERF_SAMPLE_BRANCH_HV_SHIFT: perf_branch_sample_type_shift = 2; @@ -786,7 +820,9 @@ pub const PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT: perf_branch_sample_type_shift = 14; pub const PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT: perf_branch_sample_type_shift = 15; pub const PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT: perf_branch_sample_type_shift = 16; pub const PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT: perf_branch_sample_type_shift = 17; -pub const PERF_SAMPLE_BRANCH_MAX_SHIFT: perf_branch_sample_type_shift = 18; +pub const PERF_SAMPLE_BRANCH_PRIV_SAVE_SHIFT: perf_branch_sample_type_shift = 18; +pub const PERF_SAMPLE_BRANCH_COUNTERS_SHIFT: perf_branch_sample_type_shift = 19; +pub const PERF_SAMPLE_BRANCH_MAX_SHIFT: perf_branch_sample_type_shift = 20; pub type perf_branch_sample_type_shift = ::std::os::raw::c_uint; pub const PERF_SAMPLE_BRANCH_USER: perf_branch_sample_type = 1; pub const PERF_SAMPLE_BRANCH_KERNEL: perf_branch_sample_type = 2; @@ -806,7 +842,9 @@ pub const PERF_SAMPLE_BRANCH_NO_FLAGS: perf_branch_sample_type = 16384; pub const PERF_SAMPLE_BRANCH_NO_CYCLES: perf_branch_sample_type = 32768; pub const PERF_SAMPLE_BRANCH_TYPE_SAVE: perf_branch_sample_type = 65536; pub const PERF_SAMPLE_BRANCH_HW_INDEX: perf_branch_sample_type = 131072; -pub const PERF_SAMPLE_BRANCH_MAX: perf_branch_sample_type = 262144; +pub const PERF_SAMPLE_BRANCH_PRIV_SAVE: perf_branch_sample_type = 262144; +pub const PERF_SAMPLE_BRANCH_COUNTERS: perf_branch_sample_type = 524288; +pub const PERF_SAMPLE_BRANCH_MAX: perf_branch_sample_type = 1048576; pub type perf_branch_sample_type = ::std::os::raw::c_uint; pub const PERF_BR_UNKNOWN: _bindgen_ty_1 = 0; pub const PERF_BR_COND: _bindgen_ty_1 = 1; @@ -819,29 +857,56 @@ pub const PERF_BR_SYSCALL: _bindgen_ty_1 = 7; pub const PERF_BR_SYSRET: _bindgen_ty_1 = 8; pub const PERF_BR_COND_CALL: _bindgen_ty_1 = 9; pub const PERF_BR_COND_RET: _bindgen_ty_1 = 10; -pub const PERF_BR_MAX: _bindgen_ty_1 = 11; +pub const PERF_BR_ERET: _bindgen_ty_1 = 11; +pub const PERF_BR_IRQ: _bindgen_ty_1 = 12; +pub const PERF_BR_SERROR: _bindgen_ty_1 = 13; +pub const PERF_BR_NO_TX: _bindgen_ty_1 = 14; +pub const PERF_BR_EXTEND_ABI: _bindgen_ty_1 = 15; +pub const PERF_BR_MAX: _bindgen_ty_1 = 16; pub type _bindgen_ty_1 = ::std::os::raw::c_uint; +pub const PERF_BR_SPEC_NA: _bindgen_ty_2 = 0; +pub const PERF_BR_SPEC_WRONG_PATH: _bindgen_ty_2 = 1; +pub const PERF_BR_NON_SPEC_CORRECT_PATH: _bindgen_ty_2 = 2; +pub const PERF_BR_SPEC_CORRECT_PATH: _bindgen_ty_2 = 3; +pub const PERF_BR_SPEC_MAX: _bindgen_ty_2 = 4; +pub type _bindgen_ty_2 = ::std::os::raw::c_uint; +pub const PERF_BR_NEW_FAULT_ALGN: _bindgen_ty_3 = 0; +pub const PERF_BR_NEW_FAULT_DATA: _bindgen_ty_3 = 1; +pub const PERF_BR_NEW_FAULT_INST: _bindgen_ty_3 = 2; +pub const PERF_BR_NEW_ARCH_1: _bindgen_ty_3 = 3; +pub const PERF_BR_NEW_ARCH_2: _bindgen_ty_3 = 4; +pub const PERF_BR_NEW_ARCH_3: _bindgen_ty_3 = 5; +pub const PERF_BR_NEW_ARCH_4: _bindgen_ty_3 = 6; +pub const PERF_BR_NEW_ARCH_5: _bindgen_ty_3 = 7; +pub const PERF_BR_NEW_MAX: _bindgen_ty_3 = 8; +pub type _bindgen_ty_3 = ::std::os::raw::c_uint; +pub const PERF_BR_PRIV_UNKNOWN: _bindgen_ty_4 = 0; +pub const PERF_BR_PRIV_USER: _bindgen_ty_4 = 1; +pub const PERF_BR_PRIV_KERNEL: _bindgen_ty_4 = 2; +pub const PERF_BR_PRIV_HV: _bindgen_ty_4 = 3; +pub type _bindgen_ty_4 = ::std::os::raw::c_uint; pub const PERF_SAMPLE_REGS_ABI_NONE: perf_sample_regs_abi = 0; pub const PERF_SAMPLE_REGS_ABI_32: perf_sample_regs_abi = 1; pub const PERF_SAMPLE_REGS_ABI_64: perf_sample_regs_abi = 2; pub type perf_sample_regs_abi = ::std::os::raw::c_uint; -pub const PERF_TXN_ELISION: _bindgen_ty_2 = 1; -pub const PERF_TXN_TRANSACTION: _bindgen_ty_2 = 2; -pub const PERF_TXN_SYNC: _bindgen_ty_2 = 4; -pub const PERF_TXN_ASYNC: _bindgen_ty_2 = 8; -pub const PERF_TXN_RETRY: _bindgen_ty_2 = 16; -pub const PERF_TXN_CONFLICT: _bindgen_ty_2 = 32; -pub const PERF_TXN_CAPACITY_WRITE: _bindgen_ty_2 = 64; -pub const PERF_TXN_CAPACITY_READ: _bindgen_ty_2 = 128; -pub const PERF_TXN_MAX: _bindgen_ty_2 = 256; -pub const PERF_TXN_ABORT_MASK: _bindgen_ty_2 = 18446744069414584320; -pub const PERF_TXN_ABORT_SHIFT: _bindgen_ty_2 = 32; -pub type _bindgen_ty_2 = ::std::os::raw::c_ulong; +pub const PERF_TXN_ELISION: _bindgen_ty_5 = 1; +pub const PERF_TXN_TRANSACTION: _bindgen_ty_5 = 2; +pub const PERF_TXN_SYNC: _bindgen_ty_5 = 4; +pub const PERF_TXN_ASYNC: _bindgen_ty_5 = 8; +pub const PERF_TXN_RETRY: _bindgen_ty_5 = 16; +pub const PERF_TXN_CONFLICT: _bindgen_ty_5 = 32; +pub const PERF_TXN_CAPACITY_WRITE: _bindgen_ty_5 = 64; +pub const PERF_TXN_CAPACITY_READ: _bindgen_ty_5 = 128; +pub const PERF_TXN_MAX: _bindgen_ty_5 = 256; +pub const PERF_TXN_ABORT_MASK: _bindgen_ty_5 = 18446744069414584320; +pub const PERF_TXN_ABORT_SHIFT: _bindgen_ty_5 = 32; +pub type _bindgen_ty_5 = ::std::os::raw::c_ulong; pub const PERF_FORMAT_TOTAL_TIME_ENABLED: perf_event_read_format = 1; pub const PERF_FORMAT_TOTAL_TIME_RUNNING: perf_event_read_format = 2; pub const PERF_FORMAT_ID: perf_event_read_format = 4; pub const PERF_FORMAT_GROUP: perf_event_read_format = 8; -pub const PERF_FORMAT_MAX: perf_event_read_format = 16; +pub const PERF_FORMAT_LOST: perf_event_read_format = 16; +pub const PERF_FORMAT_MAX: perf_event_read_format = 32; pub type perf_event_read_format = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] @@ -867,8 +932,9 @@ pub struct perf_event_attr { pub sample_max_stack: __u16, pub __reserved_2: __u16, pub aux_sample_size: __u32, - pub __reserved_3: __u32, + pub __bindgen_anon_5: perf_event_attr__bindgen_ty_5, pub sig_data: __u64, + pub config3: __u64, } #[repr(C)] #[derive(Copy, Clone)] @@ -876,42 +942,17 @@ pub union perf_event_attr__bindgen_ty_1 { pub sample_period: __u64, pub sample_freq: __u64, } -#[test] -fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_event_attr__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_event_attr__bindgen_ty_1)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sample_period) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_1), - "::", - stringify!(sample_period) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sample_freq) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_1), - "::", - stringify!(sample_freq) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_attr__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of perf_event_attr__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_event_attr__bindgen_ty_1::sample_period"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_1, sample_period) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_1::sample_freq"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_1, sample_freq) - 0usize]; +}; impl Default for perf_event_attr__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -921,48 +962,28 @@ impl Default for perf_event_attr__bindgen_ty_1 { } } } +impl ::std::fmt::Debug for perf_event_attr__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_event_attr__bindgen_ty_1 {{ union }}") + } +} #[repr(C)] #[derive(Copy, Clone)] pub union perf_event_attr__bindgen_ty_2 { pub wakeup_events: __u32, pub wakeup_watermark: __u32, } -#[test] -fn bindgen_test_layout_perf_event_attr__bindgen_ty_2() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(perf_event_attr__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(perf_event_attr__bindgen_ty_2)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wakeup_events) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_2), - "::", - stringify!(wakeup_events) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).wakeup_watermark) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_2), - "::", - stringify!(wakeup_watermark) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_attr__bindgen_ty_2"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of perf_event_attr__bindgen_ty_2"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: perf_event_attr__bindgen_ty_2::wakeup_events"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_2, wakeup_events) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_2::wakeup_watermark"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_2, wakeup_watermark) - 0usize]; +}; impl Default for perf_event_attr__bindgen_ty_2 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -972,6 +993,11 @@ impl Default for perf_event_attr__bindgen_ty_2 { } } } +impl ::std::fmt::Debug for perf_event_attr__bindgen_ty_2 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_event_attr__bindgen_ty_2 {{ union }}") + } +} #[repr(C)] #[derive(Copy, Clone)] pub union perf_event_attr__bindgen_ty_3 { @@ -980,62 +1006,21 @@ pub union perf_event_attr__bindgen_ty_3 { pub uprobe_path: __u64, pub config1: __u64, } -#[test] -fn bindgen_test_layout_perf_event_attr__bindgen_ty_3() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_event_attr__bindgen_ty_3)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_event_attr__bindgen_ty_3)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bp_addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_3), - "::", - stringify!(bp_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kprobe_func) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_3), - "::", - stringify!(kprobe_func) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).uprobe_path) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_3), - "::", - stringify!(uprobe_path) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).config1) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_3), - "::", - stringify!(config1) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_attr__bindgen_ty_3"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of perf_event_attr__bindgen_ty_3"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_event_attr__bindgen_ty_3::bp_addr"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_3, bp_addr) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_3::kprobe_func"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_3, kprobe_func) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_3::uprobe_path"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_3, uprobe_path) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_3::config1"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_3, config1) - 0usize]; +}; impl Default for perf_event_attr__bindgen_ty_3 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1045,6 +1030,11 @@ impl Default for perf_event_attr__bindgen_ty_3 { } } } +impl ::std::fmt::Debug for perf_event_attr__bindgen_ty_3 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_event_attr__bindgen_ty_3 {{ union }}") + } +} #[repr(C)] #[derive(Copy, Clone)] pub union perf_event_attr__bindgen_ty_4 { @@ -1053,62 +1043,21 @@ pub union perf_event_attr__bindgen_ty_4 { pub probe_offset: __u64, pub config2: __u64, } -#[test] -fn bindgen_test_layout_perf_event_attr__bindgen_ty_4() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_event_attr__bindgen_ty_4)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_event_attr__bindgen_ty_4)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bp_len) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_4), - "::", - stringify!(bp_len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).kprobe_addr) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_4), - "::", - stringify!(kprobe_addr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).probe_offset) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_4), - "::", - stringify!(probe_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).config2) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr__bindgen_ty_4), - "::", - stringify!(config2) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_attr__bindgen_ty_4"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of perf_event_attr__bindgen_ty_4"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_event_attr__bindgen_ty_4::bp_len"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_4, bp_len) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_4::kprobe_addr"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_4, kprobe_addr) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_4::probe_offset"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_4, probe_offset) - 0usize]; + ["Offset of field: perf_event_attr__bindgen_ty_4::config2"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_4, config2) - 0usize]; +}; impl Default for perf_event_attr__bindgen_ty_4 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -1118,422 +1067,928 @@ impl Default for perf_event_attr__bindgen_ty_4 { } } } -#[test] -fn bindgen_test_layout_perf_event_attr() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(perf_event_attr)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_event_attr)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).config) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(config) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sample_type) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(sample_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).read_format) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(read_format) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).bp_type) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(bp_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).branch_sample_type) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(branch_sample_type) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sample_regs_user) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(sample_regs_user) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sample_stack_user) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(sample_stack_user) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).clockid) as usize - ptr as usize }, - 92usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(clockid) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sample_regs_intr) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(sample_regs_intr) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aux_watermark) as usize - ptr as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(aux_watermark) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sample_max_stack) as usize - ptr as usize }, - 108usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(sample_max_stack) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved_2) as usize - ptr as usize }, - 110usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(__reserved_2) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aux_sample_size) as usize - ptr as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(aux_sample_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved_3) as usize - ptr as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(__reserved_3) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).sig_data) as usize - ptr as usize }, - 120usize, - concat!( - "Offset of field: ", - stringify!(perf_event_attr), - "::", - stringify!(sig_data) - ) - ); -} -impl Default for perf_event_attr { - fn default() -> Self { - let mut s = ::std::mem::MaybeUninit::::uninit(); - unsafe { - ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); - s.assume_init() - } +impl ::std::fmt::Debug for perf_event_attr__bindgen_ty_4 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_event_attr__bindgen_ty_4 {{ union }}") } } -impl perf_event_attr { +#[repr(C)] +#[derive(Copy, Clone)] +pub union perf_event_attr__bindgen_ty_5 { + pub aux_action: __u32, + pub __bindgen_anon_1: perf_event_attr__bindgen_ty_5__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct perf_event_attr__bindgen_ty_5__bindgen_ty_1 { + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_attr__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of perf_event_attr__bindgen_ty_5__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; +}; +impl perf_event_attr__bindgen_ty_5__bindgen_ty_1 { #[inline] - pub fn disabled(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } + pub fn aux_start_paused(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u32) } } #[inline] - pub fn set_disabled(&mut self, val: __u64) { + pub fn set_aux_start_paused(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); + let val: u32 = ::std::mem::transmute(val); self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn inherit(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } + pub unsafe fn aux_start_paused_raw(this: *const Self) -> __u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u32) + } } #[inline] - pub fn set_inherit(&mut self, val: __u64) { + pub unsafe fn set_aux_start_paused_raw(this: *mut Self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(1usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) } } #[inline] - pub fn pinned(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } + pub fn aux_pause(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) } } #[inline] - pub fn set_pinned(&mut self, val: __u64) { + pub fn set_aux_pause(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(2usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(1usize, 1u8, val as u64) } } #[inline] - pub fn exclusive(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } + pub unsafe fn aux_pause_raw(this: *const Self) -> __u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u32) + } } #[inline] - pub fn set_exclusive(&mut self, val: __u64) { + pub unsafe fn set_aux_pause_raw(this: *mut Self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(3usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) } } #[inline] - pub fn exclude_user(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u64) } + pub fn aux_resume(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u32) } } #[inline] - pub fn set_exclude_user(&mut self, val: __u64) { + pub fn set_aux_resume(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(2usize, 1u8, val as u64) } } #[inline] - pub fn exclude_kernel(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } + pub unsafe fn aux_resume_raw(this: *const Self) -> __u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u32) + } } #[inline] - pub fn set_exclude_kernel(&mut self, val: __u64) { + pub unsafe fn set_aux_resume_raw(this: *mut Self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) } } #[inline] - pub fn exclude_hv(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } + pub fn __reserved_3(&self) -> __u32 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 29u8) as u32) } } #[inline] - pub fn set_exclude_hv(&mut self, val: __u64) { + pub fn set___reserved_3(&mut self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(6usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(3usize, 29u8, val as u64) } } #[inline] - pub fn exclude_idle(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } + pub unsafe fn __reserved_3_raw(this: *const Self) -> __u32 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 29u8, + ) as u32) + } } #[inline] - pub fn set_exclude_idle(&mut self, val: __u64) { + pub unsafe fn set___reserved_3_raw(this: *mut Self, val: __u32) { unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(7usize, 1u8, val as u64) + let val: u32 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 29u8, + val as u64, + ) } } #[inline] - pub fn mmap(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u64) } + pub fn new_bitfield_1( + aux_start_paused: __u32, + aux_pause: __u32, + aux_resume: __u32, + __reserved_3: __u32, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 1u8, { + let aux_start_paused: u32 = unsafe { ::std::mem::transmute(aux_start_paused) }; + aux_start_paused as u64 + }); + __bindgen_bitfield_unit.set(1usize, 1u8, { + let aux_pause: u32 = unsafe { ::std::mem::transmute(aux_pause) }; + aux_pause as u64 + }); + __bindgen_bitfield_unit.set(2usize, 1u8, { + let aux_resume: u32 = unsafe { ::std::mem::transmute(aux_resume) }; + aux_resume as u64 + }); + __bindgen_bitfield_unit.set(3usize, 29u8, { + let __reserved_3: u32 = unsafe { ::std::mem::transmute(__reserved_3) }; + __reserved_3 as u64 + }); + __bindgen_bitfield_unit } - #[inline] - pub fn set_mmap(&mut self, val: __u64) { +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_attr__bindgen_ty_5"] + [::std::mem::size_of::() - 4usize]; + ["Alignment of perf_event_attr__bindgen_ty_5"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: perf_event_attr__bindgen_ty_5::aux_action"] + [::std::mem::offset_of!(perf_event_attr__bindgen_ty_5, aux_action) - 0usize]; +}; +impl Default for perf_event_attr__bindgen_ty_5 { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(8usize, 1u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } - #[inline] - pub fn comm(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u64) } +} +impl ::std::fmt::Debug for perf_event_attr__bindgen_ty_5 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_event_attr__bindgen_ty_5 {{ union }}") } - #[inline] - pub fn set_comm(&mut self, val: __u64) { +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_attr"][::std::mem::size_of::() - 136usize]; + ["Alignment of perf_event_attr"][::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_event_attr::type_"] + [::std::mem::offset_of!(perf_event_attr, type_) - 0usize]; + ["Offset of field: perf_event_attr::size"] + [::std::mem::offset_of!(perf_event_attr, size) - 4usize]; + ["Offset of field: perf_event_attr::config"] + [::std::mem::offset_of!(perf_event_attr, config) - 8usize]; + ["Offset of field: perf_event_attr::sample_type"] + [::std::mem::offset_of!(perf_event_attr, sample_type) - 24usize]; + ["Offset of field: perf_event_attr::read_format"] + [::std::mem::offset_of!(perf_event_attr, read_format) - 32usize]; + ["Offset of field: perf_event_attr::bp_type"] + [::std::mem::offset_of!(perf_event_attr, bp_type) - 52usize]; + ["Offset of field: perf_event_attr::branch_sample_type"] + [::std::mem::offset_of!(perf_event_attr, branch_sample_type) - 72usize]; + ["Offset of field: perf_event_attr::sample_regs_user"] + [::std::mem::offset_of!(perf_event_attr, sample_regs_user) - 80usize]; + ["Offset of field: perf_event_attr::sample_stack_user"] + [::std::mem::offset_of!(perf_event_attr, sample_stack_user) - 88usize]; + ["Offset of field: perf_event_attr::clockid"] + [::std::mem::offset_of!(perf_event_attr, clockid) - 92usize]; + ["Offset of field: perf_event_attr::sample_regs_intr"] + [::std::mem::offset_of!(perf_event_attr, sample_regs_intr) - 96usize]; + ["Offset of field: perf_event_attr::aux_watermark"] + [::std::mem::offset_of!(perf_event_attr, aux_watermark) - 104usize]; + ["Offset of field: perf_event_attr::sample_max_stack"] + [::std::mem::offset_of!(perf_event_attr, sample_max_stack) - 108usize]; + ["Offset of field: perf_event_attr::__reserved_2"] + [::std::mem::offset_of!(perf_event_attr, __reserved_2) - 110usize]; + ["Offset of field: perf_event_attr::aux_sample_size"] + [::std::mem::offset_of!(perf_event_attr, aux_sample_size) - 112usize]; + ["Offset of field: perf_event_attr::sig_data"] + [::std::mem::offset_of!(perf_event_attr, sig_data) - 120usize]; + ["Offset of field: perf_event_attr::config3"] + [::std::mem::offset_of!(perf_event_attr, config3) - 128usize]; +}; +impl Default for perf_event_attr { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::::uninit(); unsafe { - let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(9usize, 1u8, val as u64) + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() } } +} +impl ::std::fmt::Debug for perf_event_attr { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "perf_event_attr {{ type: {:?}, size: {:?}, config: {:?}, __bindgen_anon_1: {:?}, sample_type: {:?}, read_format: {:?}, disabled : {:?}, inherit : {:?}, pinned : {:?}, exclusive : {:?}, exclude_user : {:?}, exclude_kernel : {:?}, exclude_hv : {:?}, exclude_idle : {:?}, mmap : {:?}, comm : {:?}, freq : {:?}, inherit_stat : {:?}, enable_on_exec : {:?}, task : {:?}, watermark : {:?}, precise_ip : {:?}, mmap_data : {:?}, sample_id_all : {:?}, exclude_host : {:?}, exclude_guest : {:?}, exclude_callchain_kernel : {:?}, exclude_callchain_user : {:?}, mmap2 : {:?}, comm_exec : {:?}, use_clockid : {:?}, context_switch : {:?}, write_backward : {:?}, namespaces : {:?}, ksymbol : {:?}, bpf_event : {:?}, aux_output : {:?}, cgroup : {:?}, text_poke : {:?}, build_id : {:?}, inherit_thread : {:?}, remove_on_exec : {:?}, sigtrap : {:?}, __reserved_1 : {:?}, __bindgen_anon_2: {:?}, bp_type: {:?}, __bindgen_anon_3: {:?}, __bindgen_anon_4: {:?}, branch_sample_type: {:?}, sample_regs_user: {:?}, sample_stack_user: {:?}, clockid: {:?}, sample_regs_intr: {:?}, aux_watermark: {:?}, sample_max_stack: {:?}, __reserved_2: {:?}, aux_sample_size: {:?}, __bindgen_anon_5: {:?}, sig_data: {:?}, config3: {:?} }}" , self . type_ , self . size , self . config , self . __bindgen_anon_1 , self . sample_type , self . read_format , self . disabled () , self . inherit () , self . pinned () , self . exclusive () , self . exclude_user () , self . exclude_kernel () , self . exclude_hv () , self . exclude_idle () , self . mmap () , self . comm () , self . freq () , self . inherit_stat () , self . enable_on_exec () , self . task () , self . watermark () , self . precise_ip () , self . mmap_data () , self . sample_id_all () , self . exclude_host () , self . exclude_guest () , self . exclude_callchain_kernel () , self . exclude_callchain_user () , self . mmap2 () , self . comm_exec () , self . use_clockid () , self . context_switch () , self . write_backward () , self . namespaces () , self . ksymbol () , self . bpf_event () , self . aux_output () , self . cgroup () , self . text_poke () , self . build_id () , self . inherit_thread () , self . remove_on_exec () , self . sigtrap () , self . __reserved_1 () , self . __bindgen_anon_2 , self . bp_type , self . __bindgen_anon_3 , self . __bindgen_anon_4 , self . branch_sample_type , self . sample_regs_user , self . sample_stack_user , self . clockid , self . sample_regs_intr , self . aux_watermark , self . sample_max_stack , self . __reserved_2 , self . aux_sample_size , self . __bindgen_anon_5 , self . sig_data , self . config3) + } +} +impl perf_event_attr { #[inline] - pub fn freq(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } + pub fn disabled(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 1u8) as u64) } } #[inline] - pub fn set_freq(&mut self, val: __u64) { + pub fn set_disabled(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(10usize, 1u8, val as u64) + self._bitfield_1.set(0usize, 1u8, val as u64) } } #[inline] - pub fn inherit_stat(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } + pub unsafe fn disabled_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } } #[inline] - pub fn set_inherit_stat(&mut self, val: __u64) { + pub unsafe fn set_disabled_raw(this: *mut Self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(11usize, 1u8, val as u64) + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) } } #[inline] - pub fn enable_on_exec(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } + pub fn inherit(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } } #[inline] - pub fn set_enable_on_exec(&mut self, val: __u64) { + pub fn set_inherit(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(12usize, 1u8, val as u64) + self._bitfield_1.set(1usize, 1u8, val as u64) } } #[inline] - pub fn task(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u64) } + pub unsafe fn inherit_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u64) + } } #[inline] - pub fn set_task(&mut self, val: __u64) { + pub unsafe fn set_inherit_raw(this: *mut Self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(13usize, 1u8, val as u64) + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) } } #[inline] - pub fn watermark(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u64) } + pub fn pinned(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } } #[inline] - pub fn set_watermark(&mut self, val: __u64) { + pub fn set_pinned(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(14usize, 1u8, val as u64) + self._bitfield_1.set(2usize, 1u8, val as u64) } } #[inline] - pub fn precise_ip(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 2u8) as u64) } + pub unsafe fn pinned_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u64) + } } #[inline] - pub fn set_precise_ip(&mut self, val: __u64) { + pub unsafe fn set_pinned_raw(this: *mut Self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(15usize, 2u8, val as u64) + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) } } #[inline] - pub fn mmap_data(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } + pub fn exclusive(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } } #[inline] - pub fn set_mmap_data(&mut self, val: __u64) { + pub fn set_exclusive(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(17usize, 1u8, val as u64) + self._bitfield_1.set(3usize, 1u8, val as u64) } } #[inline] - pub fn sample_id_all(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } + pub unsafe fn exclusive_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u64) + } } #[inline] - pub fn set_sample_id_all(&mut self, val: __u64) { + pub unsafe fn set_exclusive_raw(this: *mut Self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(18usize, 1u8, val as u64) + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) } } #[inline] - pub fn exclude_host(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } + pub fn exclude_user(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u64) } } #[inline] - pub fn set_exclude_host(&mut self, val: __u64) { + pub fn set_exclude_user(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(19usize, 1u8, val as u64) + self._bitfield_1.set(4usize, 1u8, val as u64) } } #[inline] - pub fn exclude_guest(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u64) } + pub unsafe fn exclude_user_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u64) + } } #[inline] - pub fn set_exclude_guest(&mut self, val: __u64) { + pub unsafe fn set_exclude_user_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn exclude_kernel(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } + } + #[inline] + pub fn set_exclude_kernel(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn exclude_kernel_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_exclude_kernel_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn exclude_hv(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u64) } + } + #[inline] + pub fn set_exclude_hv(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(6usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn exclude_hv_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_exclude_hv_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn exclude_idle(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u64) } + } + #[inline] + pub fn set_exclude_idle(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn exclude_idle_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 7usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_exclude_idle_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 7usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn mmap(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 1u8) as u64) } + } + #[inline] + pub fn set_mmap(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn mmap_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 8usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mmap_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 8usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn comm(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(9usize, 1u8) as u64) } + } + #[inline] + pub fn set_comm(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(9usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn comm_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 9usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_comm_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 9usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn freq(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(10usize, 1u8) as u64) } + } + #[inline] + pub fn set_freq(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(10usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn freq_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 10usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_freq_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 10usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn inherit_stat(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(11usize, 1u8) as u64) } + } + #[inline] + pub fn set_inherit_stat(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(11usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn inherit_stat_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 11usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_inherit_stat_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 11usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn enable_on_exec(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u64) } + } + #[inline] + pub fn set_enable_on_exec(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(12usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn enable_on_exec_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 12usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_enable_on_exec_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 12usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn task(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(13usize, 1u8) as u64) } + } + #[inline] + pub fn set_task(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(13usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn task_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 13usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_task_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 13usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn watermark(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(14usize, 1u8) as u64) } + } + #[inline] + pub fn set_watermark(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(14usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn watermark_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 14usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_watermark_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 14usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn precise_ip(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(15usize, 2u8) as u64) } + } + #[inline] + pub fn set_precise_ip(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(15usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn precise_ip_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 15usize, + 2u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_precise_ip_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 15usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn mmap_data(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(17usize, 1u8) as u64) } + } + #[inline] + pub fn set_mmap_data(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(17usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn mmap_data_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 17usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mmap_data_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 17usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn sample_id_all(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(18usize, 1u8) as u64) } + } + #[inline] + pub fn set_sample_id_all(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(18usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn sample_id_all_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 18usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_sample_id_all_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 18usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn exclude_host(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 1u8) as u64) } + } + #[inline] + pub fn set_exclude_host(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(19usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn exclude_host_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_exclude_host_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 1u8, + val as u64, + ) + } + } + #[inline] + pub fn exclude_guest(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 1u8) as u64) } + } + #[inline] + pub fn set_exclude_guest(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); self._bitfield_1.set(20usize, 1u8, val as u64) } } #[inline] + pub unsafe fn exclude_guest_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 20usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_exclude_guest_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 20usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn exclude_callchain_kernel(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(21usize, 1u8) as u64) } } @@ -1545,6 +2000,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn exclude_callchain_kernel_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 21usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_exclude_callchain_kernel_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 21usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn exclude_callchain_user(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(22usize, 1u8) as u64) } } @@ -1556,6 +2033,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn exclude_callchain_user_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 22usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_exclude_callchain_user_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 22usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn mmap2(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(23usize, 1u8) as u64) } } @@ -1567,6 +2066,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn mmap2_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 23usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mmap2_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 23usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn comm_exec(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 1u8) as u64) } } @@ -1578,6 +2099,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn comm_exec_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_comm_exec_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn use_clockid(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(25usize, 1u8) as u64) } } @@ -1589,6 +2132,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn use_clockid_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 25usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_use_clockid_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 25usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn context_switch(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 1u8) as u64) } } @@ -1600,6 +2165,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn context_switch_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 26usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_context_switch_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 26usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn write_backward(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(27usize, 1u8) as u64) } } @@ -1611,6 +2198,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn write_backward_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 27usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_write_backward_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 27usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn namespaces(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(28usize, 1u8) as u64) } } @@ -1622,6 +2231,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn namespaces_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 28usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_namespaces_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 28usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn ksymbol(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(29usize, 1u8) as u64) } } @@ -1633,6 +2264,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn ksymbol_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 29usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_ksymbol_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 29usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn bpf_event(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 1u8) as u64) } } @@ -1644,6 +2297,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn bpf_event_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 30usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_bpf_event_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 30usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn aux_output(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(31usize, 1u8) as u64) } } @@ -1655,6 +2330,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn aux_output_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 31usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_aux_output_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 31usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn cgroup(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u64) } } @@ -1666,6 +2363,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn cgroup_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 32usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cgroup_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 32usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn text_poke(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u64) } } @@ -1677,6 +2396,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn text_poke_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 33usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_text_poke_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 33usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn build_id(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u64) } } @@ -1688,6 +2429,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn build_id_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 34usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_build_id_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 34usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn inherit_thread(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u64) } } @@ -1699,6 +2462,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn inherit_thread_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 35usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_inherit_thread_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 35usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn remove_on_exec(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(36usize, 1u8) as u64) } } @@ -1710,6 +2495,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn remove_on_exec_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 36usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_remove_on_exec_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 36usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn sigtrap(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u64) } } @@ -1721,6 +2528,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn sigtrap_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 37usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_sigtrap_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 37usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn __reserved_1(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 26u8) as u64) } } @@ -1732,6 +2561,28 @@ impl perf_event_attr { } } #[inline] + pub unsafe fn __reserved_1_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 38usize, + 26u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set___reserved_1_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 38usize, + 26u8, + val as u64, + ) + } + } + #[inline] pub fn new_bitfield_1( disabled: __u64, inherit: __u64, @@ -1937,51 +2788,17 @@ pub struct perf_event_query_bpf { pub prog_cnt: __u32, pub ids: __IncompleteArrayField<__u32>, } -#[test] -fn bindgen_test_layout_perf_event_query_bpf() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_event_query_bpf)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(perf_event_query_bpf)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ids_len) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_query_bpf), - "::", - stringify!(ids_len) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).prog_cnt) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(perf_event_query_bpf), - "::", - stringify!(prog_cnt) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ids) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(perf_event_query_bpf), - "::", - stringify!(ids) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_query_bpf"][::std::mem::size_of::() - 8usize]; + ["Alignment of perf_event_query_bpf"][::std::mem::align_of::() - 4usize]; + ["Offset of field: perf_event_query_bpf::ids_len"] + [::std::mem::offset_of!(perf_event_query_bpf, ids_len) - 0usize]; + ["Offset of field: perf_event_query_bpf::prog_cnt"] + [::std::mem::offset_of!(perf_event_query_bpf, prog_cnt) - 4usize]; + ["Offset of field: perf_event_query_bpf::ids"] + [::std::mem::offset_of!(perf_event_query_bpf, ids) - 8usize]; +}; pub const PERF_IOC_FLAG_GROUP: perf_event_ioc_flags = 1; pub type perf_event_ioc_flags = ::std::os::raw::c_uint; #[repr(C)] @@ -2021,31 +2838,18 @@ pub union perf_event_mmap_page__bindgen_ty_1 { pub __bindgen_anon_1: perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1, } #[repr(C)] -#[repr(align(8))] #[derive(Debug, Default, Copy, Clone)] pub struct perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { pub _bitfield_align_1: [u64; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } -#[test] -fn bindgen_test_layout_perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { #[inline] pub fn cap_bit0(&self) -> __u64 { @@ -2059,6 +2863,28 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { } } #[inline] + pub unsafe fn cap_bit0_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cap_bit0_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn cap_bit0_is_deprecated(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } } @@ -2070,6 +2896,28 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { } } #[inline] + pub unsafe fn cap_bit0_is_deprecated_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cap_bit0_is_deprecated_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn cap_user_rdpmc(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } } @@ -2081,6 +2929,28 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { } } #[inline] + pub unsafe fn cap_user_rdpmc_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cap_user_rdpmc_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn cap_user_time(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } } @@ -2092,14 +2962,58 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { } } #[inline] + pub unsafe fn cap_user_time_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cap_user_time_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn cap_user_time_zero(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u64) } } #[inline] - pub fn set_cap_user_time_zero(&mut self, val: __u64) { + pub fn set_cap_user_time_zero(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(4usize, 1u8, val as u64) + } + } + #[inline] + pub unsafe fn cap_user_time_zero_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cap_user_time_zero_raw(this: *mut Self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(4usize, 1u8, val as u64) + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 1u8, + val as u64, + ) } } #[inline] @@ -2114,6 +3028,28 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { } } #[inline] + pub unsafe fn cap_user_time_short_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cap_user_time_short_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn cap_____res(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 58u8) as u64) } } @@ -2125,6 +3061,28 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { } } #[inline] + pub unsafe fn cap_____res_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 6usize, + 58u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cap_____res_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 6usize, + 58u8, + val as u64, + ) + } + } + #[inline] pub fn new_bitfield_1( cap_bit0: __u64, cap_bit0_is_deprecated: __u64, @@ -2167,35 +3125,15 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { __bindgen_bitfield_unit } } -#[test] -fn bindgen_test_layout_perf_event_mmap_page__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_event_mmap_page__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(perf_event_mmap_page__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).capabilities) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page__bindgen_ty_1), - "::", - stringify!(capabilities) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_mmap_page__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of perf_event_mmap_page__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_event_mmap_page__bindgen_ty_1::capabilities"] + [::std::mem::offset_of!(perf_event_mmap_page__bindgen_ty_1, capabilities) - 0usize]; +}; impl Default for perf_event_mmap_page__bindgen_ty_1 { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2205,271 +3143,66 @@ impl Default for perf_event_mmap_page__bindgen_ty_1 { } } } -#[test] -fn bindgen_test_layout_perf_event_mmap_page() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 1088usize, - concat!("Size of: ", stringify!(perf_event_mmap_page)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_event_mmap_page)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).version) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).compat_version) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(compat_version) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).lock) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(lock) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).index) as usize - ptr as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(index) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).offset) as usize - ptr as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_enabled) as usize - ptr as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_enabled) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_running) as usize - ptr as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_running) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).pmc_width) as usize - ptr as usize }, - 48usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(pmc_width) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_shift) as usize - ptr as usize }, - 50usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_shift) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_mult) as usize - ptr as usize }, - 52usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_mult) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_offset) as usize - ptr as usize }, - 56usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_zero) as usize - ptr as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_zero) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved_1) as usize - ptr as usize }, - 76usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(__reserved_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_cycles) as usize - ptr as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_cycles) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).time_mask) as usize - ptr as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(time_mask) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).__reserved) as usize - ptr as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(__reserved) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data_head) as usize - ptr as usize }, - 1024usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(data_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data_tail) as usize - ptr as usize }, - 1032usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(data_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data_offset) as usize - ptr as usize }, - 1040usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(data_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).data_size) as usize - ptr as usize }, - 1048usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(data_size) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aux_head) as usize - ptr as usize }, - 1056usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(aux_head) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aux_tail) as usize - ptr as usize }, - 1064usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(aux_tail) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aux_offset) as usize - ptr as usize }, - 1072usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(aux_offset) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).aux_size) as usize - ptr as usize }, - 1080usize, - concat!( - "Offset of field: ", - stringify!(perf_event_mmap_page), - "::", - stringify!(aux_size) - ) - ); +impl ::std::fmt::Debug for perf_event_mmap_page__bindgen_ty_1 { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_event_mmap_page__bindgen_ty_1 {{ union }}") + } } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_mmap_page"][::std::mem::size_of::() - 1088usize]; + ["Alignment of perf_event_mmap_page"][::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_event_mmap_page::version"] + [::std::mem::offset_of!(perf_event_mmap_page, version) - 0usize]; + ["Offset of field: perf_event_mmap_page::compat_version"] + [::std::mem::offset_of!(perf_event_mmap_page, compat_version) - 4usize]; + ["Offset of field: perf_event_mmap_page::lock"] + [::std::mem::offset_of!(perf_event_mmap_page, lock) - 8usize]; + ["Offset of field: perf_event_mmap_page::index"] + [::std::mem::offset_of!(perf_event_mmap_page, index) - 12usize]; + ["Offset of field: perf_event_mmap_page::offset"] + [::std::mem::offset_of!(perf_event_mmap_page, offset) - 16usize]; + ["Offset of field: perf_event_mmap_page::time_enabled"] + [::std::mem::offset_of!(perf_event_mmap_page, time_enabled) - 24usize]; + ["Offset of field: perf_event_mmap_page::time_running"] + [::std::mem::offset_of!(perf_event_mmap_page, time_running) - 32usize]; + ["Offset of field: perf_event_mmap_page::pmc_width"] + [::std::mem::offset_of!(perf_event_mmap_page, pmc_width) - 48usize]; + ["Offset of field: perf_event_mmap_page::time_shift"] + [::std::mem::offset_of!(perf_event_mmap_page, time_shift) - 50usize]; + ["Offset of field: perf_event_mmap_page::time_mult"] + [::std::mem::offset_of!(perf_event_mmap_page, time_mult) - 52usize]; + ["Offset of field: perf_event_mmap_page::time_offset"] + [::std::mem::offset_of!(perf_event_mmap_page, time_offset) - 56usize]; + ["Offset of field: perf_event_mmap_page::time_zero"] + [::std::mem::offset_of!(perf_event_mmap_page, time_zero) - 64usize]; + ["Offset of field: perf_event_mmap_page::size"] + [::std::mem::offset_of!(perf_event_mmap_page, size) - 72usize]; + ["Offset of field: perf_event_mmap_page::__reserved_1"] + [::std::mem::offset_of!(perf_event_mmap_page, __reserved_1) - 76usize]; + ["Offset of field: perf_event_mmap_page::time_cycles"] + [::std::mem::offset_of!(perf_event_mmap_page, time_cycles) - 80usize]; + ["Offset of field: perf_event_mmap_page::time_mask"] + [::std::mem::offset_of!(perf_event_mmap_page, time_mask) - 88usize]; + ["Offset of field: perf_event_mmap_page::__reserved"] + [::std::mem::offset_of!(perf_event_mmap_page, __reserved) - 96usize]; + ["Offset of field: perf_event_mmap_page::data_head"] + [::std::mem::offset_of!(perf_event_mmap_page, data_head) - 1024usize]; + ["Offset of field: perf_event_mmap_page::data_tail"] + [::std::mem::offset_of!(perf_event_mmap_page, data_tail) - 1032usize]; + ["Offset of field: perf_event_mmap_page::data_offset"] + [::std::mem::offset_of!(perf_event_mmap_page, data_offset) - 1040usize]; + ["Offset of field: perf_event_mmap_page::data_size"] + [::std::mem::offset_of!(perf_event_mmap_page, data_size) - 1048usize]; + ["Offset of field: perf_event_mmap_page::aux_head"] + [::std::mem::offset_of!(perf_event_mmap_page, aux_head) - 1056usize]; + ["Offset of field: perf_event_mmap_page::aux_tail"] + [::std::mem::offset_of!(perf_event_mmap_page, aux_tail) - 1064usize]; + ["Offset of field: perf_event_mmap_page::aux_offset"] + [::std::mem::offset_of!(perf_event_mmap_page, aux_offset) - 1072usize]; + ["Offset of field: perf_event_mmap_page::aux_size"] + [::std::mem::offset_of!(perf_event_mmap_page, aux_size) - 1080usize]; +}; impl Default for perf_event_mmap_page { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2479,6 +3212,11 @@ impl Default for perf_event_mmap_page { } } } +impl ::std::fmt::Debug for perf_event_mmap_page { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write ! (f , "perf_event_mmap_page {{ version: {:?}, compat_version: {:?}, lock: {:?}, index: {:?}, offset: {:?}, time_enabled: {:?}, time_running: {:?}, __bindgen_anon_1: {:?}, pmc_width: {:?}, time_shift: {:?}, time_mult: {:?}, time_offset: {:?}, time_zero: {:?}, size: {:?}, __reserved_1: {:?}, time_cycles: {:?}, time_mask: {:?}, __reserved: {:?}, data_head: {:?}, data_tail: {:?}, data_offset: {:?}, data_size: {:?}, aux_head: {:?}, aux_tail: {:?}, aux_offset: {:?}, aux_size: {:?} }}" , self . version , self . compat_version , self . lock , self . index , self . offset , self . time_enabled , self . time_running , self . __bindgen_anon_1 , self . pmc_width , self . time_shift , self . time_mult , self . time_offset , self . time_zero , self . size , self . __reserved_1 , self . time_cycles , self . time_mask , self . __reserved , self . data_head , self . data_tail , self . data_offset , self . data_size , self . aux_head , self . aux_tail , self . aux_offset , self . aux_size) + } +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct perf_event_header { @@ -2486,101 +3224,41 @@ pub struct perf_event_header { pub misc: __u16, pub size: __u16, } -#[test] -fn bindgen_test_layout_perf_event_header() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_event_header)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(perf_event_header)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).type_) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_event_header), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).misc) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(perf_event_header), - "::", - stringify!(misc) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).size) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(perf_event_header), - "::", - stringify!(size) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_event_header"][::std::mem::size_of::() - 8usize]; + ["Alignment of perf_event_header"][::std::mem::align_of::() - 4usize]; + ["Offset of field: perf_event_header::type_"] + [::std::mem::offset_of!(perf_event_header, type_) - 0usize]; + ["Offset of field: perf_event_header::misc"] + [::std::mem::offset_of!(perf_event_header, misc) - 4usize]; + ["Offset of field: perf_event_header::size"] + [::std::mem::offset_of!(perf_event_header, size) - 6usize]; +}; #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct perf_ns_link_info { pub dev: __u64, pub ino: __u64, } -#[test] -fn bindgen_test_layout_perf_ns_link_info() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(perf_ns_link_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_ns_link_info)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).dev) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_ns_link_info), - "::", - stringify!(dev) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).ino) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(perf_ns_link_info), - "::", - stringify!(ino) - ) - ); -} -pub const NET_NS_INDEX: _bindgen_ty_3 = 0; -pub const UTS_NS_INDEX: _bindgen_ty_3 = 1; -pub const IPC_NS_INDEX: _bindgen_ty_3 = 2; -pub const PID_NS_INDEX: _bindgen_ty_3 = 3; -pub const USER_NS_INDEX: _bindgen_ty_3 = 4; -pub const MNT_NS_INDEX: _bindgen_ty_3 = 5; -pub const CGROUP_NS_INDEX: _bindgen_ty_3 = 6; -pub const NR_NAMESPACES: _bindgen_ty_3 = 7; -pub type _bindgen_ty_3 = ::std::os::raw::c_uint; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_ns_link_info"][::std::mem::size_of::() - 16usize]; + ["Alignment of perf_ns_link_info"][::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_ns_link_info::dev"] + [::std::mem::offset_of!(perf_ns_link_info, dev) - 0usize]; + ["Offset of field: perf_ns_link_info::ino"] + [::std::mem::offset_of!(perf_ns_link_info, ino) - 8usize]; +}; +pub const NET_NS_INDEX: _bindgen_ty_6 = 0; +pub const UTS_NS_INDEX: _bindgen_ty_6 = 1; +pub const IPC_NS_INDEX: _bindgen_ty_6 = 2; +pub const PID_NS_INDEX: _bindgen_ty_6 = 3; +pub const USER_NS_INDEX: _bindgen_ty_6 = 4; +pub const MNT_NS_INDEX: _bindgen_ty_6 = 5; +pub const CGROUP_NS_INDEX: _bindgen_ty_6 = 6; +pub const NR_NAMESPACES: _bindgen_ty_6 = 7; +pub type _bindgen_ty_6 = ::std::os::raw::c_uint; pub const PERF_RECORD_MMAP: perf_event_type = 1; pub const PERF_RECORD_LOST: perf_event_type = 2; pub const PERF_RECORD_COMM: perf_event_type = 3; @@ -2635,19 +3313,13 @@ pub struct perf_mem_data_src__bindgen_ty_1 { pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } -#[test] -fn bindgen_test_layout_perf_mem_data_src__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_mem_data_src__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_mem_data_src__bindgen_ty_1)) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_mem_data_src__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of perf_mem_data_src__bindgen_ty_1"] + [::std::mem::align_of::() - 8usize]; +}; impl perf_mem_data_src__bindgen_ty_1 { #[inline] pub fn mem_op(&self) -> __u64 { @@ -2661,6 +3333,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_op_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 5u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_op_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 5u8, + val as u64, + ) + } + } + #[inline] pub fn mem_lvl(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 14u8) as u64) } } @@ -2672,6 +3366,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_lvl_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 5usize, + 14u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_lvl_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 5usize, + 14u8, + val as u64, + ) + } + } + #[inline] pub fn mem_snoop(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(19usize, 5u8) as u64) } } @@ -2683,6 +3399,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_snoop_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 19usize, + 5u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_snoop_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 19usize, + 5u8, + val as u64, + ) + } + } + #[inline] pub fn mem_lock(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 2u8) as u64) } } @@ -2694,6 +3432,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_lock_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 2u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_lock_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 2u8, + val as u64, + ) + } + } + #[inline] pub fn mem_dtlb(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 7u8) as u64) } } @@ -2705,6 +3465,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_dtlb_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 26usize, + 7u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_dtlb_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 26usize, + 7u8, + val as u64, + ) + } + } + #[inline] pub fn mem_lvl_num(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 4u8) as u64) } } @@ -2716,6 +3498,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_lvl_num_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 33usize, + 4u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_lvl_num_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 33usize, + 4u8, + val as u64, + ) + } + } + #[inline] pub fn mem_remote(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u64) } } @@ -2727,6 +3531,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_remote_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 37usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_remote_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 37usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn mem_snoopx(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 2u8) as u64) } } @@ -2738,6 +3564,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_snoopx_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 38usize, + 2u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_snoopx_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 38usize, + 2u8, + val as u64, + ) + } + } + #[inline] pub fn mem_blk(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 3u8) as u64) } } @@ -2749,6 +3597,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_blk_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 40usize, + 3u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_blk_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 40usize, + 3u8, + val as u64, + ) + } + } + #[inline] pub fn mem_hops(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(43usize, 3u8) as u64) } } @@ -2760,6 +3630,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_hops_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 43usize, + 3u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_hops_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 43usize, + 3u8, + val as u64, + ) + } + } + #[inline] pub fn mem_rsvd(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(46usize, 18u8) as u64) } } @@ -2771,6 +3663,28 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub unsafe fn mem_rsvd_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 46usize, + 18u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mem_rsvd_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 46usize, + 18u8, + val as u64, + ) + } + } + #[inline] pub fn new_bitfield_1( mem_op: __u64, mem_lvl: __u64, @@ -2832,31 +3746,13 @@ impl perf_mem_data_src__bindgen_ty_1 { __bindgen_bitfield_unit } } -#[test] -fn bindgen_test_layout_perf_mem_data_src() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_mem_data_src)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_mem_data_src)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).val) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_mem_data_src), - "::", - stringify!(val) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_mem_data_src"][::std::mem::size_of::() - 8usize]; + ["Alignment of perf_mem_data_src"][::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_mem_data_src::val"] + [::std::mem::offset_of!(perf_mem_data_src, val) - 0usize]; +}; impl Default for perf_mem_data_src { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -2866,49 +3762,28 @@ impl Default for perf_mem_data_src { } } } +impl ::std::fmt::Debug for perf_mem_data_src { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_mem_data_src {{ union }}") + } +} #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct perf_branch_entry { pub from: __u64, pub to: __u64, - pub _bitfield_align_1: [u64; 0], + pub _bitfield_align_1: [u32; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } -#[test] -fn bindgen_test_layout_perf_branch_entry() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(perf_branch_entry)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_branch_entry)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).from) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_branch_entry), - "::", - stringify!(from) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).to) as usize - ptr as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(perf_branch_entry), - "::", - stringify!(to) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_branch_entry"][::std::mem::size_of::() - 24usize]; + ["Alignment of perf_branch_entry"][::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_branch_entry::from"] + [::std::mem::offset_of!(perf_branch_entry, from) - 0usize]; + ["Offset of field: perf_branch_entry::to"] + [::std::mem::offset_of!(perf_branch_entry, to) - 8usize]; +}; impl perf_branch_entry { #[inline] pub fn mispred(&self) -> __u64 { @@ -2922,6 +3797,28 @@ impl perf_branch_entry { } } #[inline] + pub unsafe fn mispred_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 0usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_mispred_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 0usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn predicted(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u64) } } @@ -2933,6 +3830,28 @@ impl perf_branch_entry { } } #[inline] + pub unsafe fn predicted_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 1usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_predicted_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 1usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn in_tx(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(2usize, 1u8) as u64) } } @@ -2944,6 +3863,28 @@ impl perf_branch_entry { } } #[inline] + pub unsafe fn in_tx_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 2usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_in_tx_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 2usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn abort(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(3usize, 1u8) as u64) } } @@ -2955,6 +3896,28 @@ impl perf_branch_entry { } } #[inline] + pub unsafe fn abort_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 3usize, + 1u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_abort_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 3usize, + 1u8, + val as u64, + ) + } + } + #[inline] pub fn cycles(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(4usize, 16u8) as u64) } } @@ -2966,6 +3929,28 @@ impl perf_branch_entry { } } #[inline] + pub unsafe fn cycles_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 4usize, + 16u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_cycles_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 4usize, + 16u8, + val as u64, + ) + } + } + #[inline] pub fn type_(&self) -> __u64 { unsafe { ::std::mem::transmute(self._bitfield_1.get(20usize, 4u8) as u64) } } @@ -2977,14 +3962,157 @@ impl perf_branch_entry { } } #[inline] + pub unsafe fn type__raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 20usize, + 4u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_type_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 20usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn spec(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 2u8) as u64) } + } + #[inline] + pub fn set_spec(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(24usize, 2u8, val as u64) + } + } + #[inline] + pub unsafe fn spec_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 24usize, + 2u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_spec_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 24usize, + 2u8, + val as u64, + ) + } + } + #[inline] + pub fn new_type(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(26usize, 4u8) as u64) } + } + #[inline] + pub fn set_new_type(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(26usize, 4u8, val as u64) + } + } + #[inline] + pub unsafe fn new_type_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 26usize, + 4u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_new_type_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 26usize, + 4u8, + val as u64, + ) + } + } + #[inline] + pub fn priv_(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(30usize, 3u8) as u64) } + } + #[inline] + pub fn set_priv(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(30usize, 3u8, val as u64) + } + } + #[inline] + pub unsafe fn priv__raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 30usize, + 3u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_priv_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 30usize, + 3u8, + val as u64, + ) + } + } + #[inline] pub fn reserved(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(24usize, 40u8) as u64) } + unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 31u8) as u64) } } #[inline] pub fn set_reserved(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(24usize, 40u8, val as u64) + self._bitfield_1.set(33usize, 31u8, val as u64) + } + } + #[inline] + pub unsafe fn reserved_raw(this: *const Self) -> __u64 { + unsafe { + ::std::mem::transmute(<__BindgenBitfieldUnit<[u8; 8usize]>>::raw_get( + ::std::ptr::addr_of!((*this)._bitfield_1), + 33usize, + 31u8, + ) as u64) + } + } + #[inline] + pub unsafe fn set_reserved_raw(this: *mut Self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + <__BindgenBitfieldUnit<[u8; 8usize]>>::raw_set( + ::std::ptr::addr_of_mut!((*this)._bitfield_1), + 33usize, + 31u8, + val as u64, + ) } } #[inline] @@ -2995,6 +4123,9 @@ impl perf_branch_entry { abort: __u64, cycles: __u64, type_: __u64, + spec: __u64, + new_type: __u64, + priv_: __u64, reserved: __u64, ) -> __BindgenBitfieldUnit<[u8; 8usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); @@ -3022,7 +4153,19 @@ impl perf_branch_entry { let type_: u64 = unsafe { ::std::mem::transmute(type_) }; type_ as u64 }); - __bindgen_bitfield_unit.set(24usize, 40u8, { + __bindgen_bitfield_unit.set(24usize, 2u8, { + let spec: u64 = unsafe { ::std::mem::transmute(spec) }; + spec as u64 + }); + __bindgen_bitfield_unit.set(26usize, 4u8, { + let new_type: u64 = unsafe { ::std::mem::transmute(new_type) }; + new_type as u64 + }); + __bindgen_bitfield_unit.set(30usize, 3u8, { + let priv_: u64 = unsafe { ::std::mem::transmute(priv_) }; + priv_ as u64 + }); + __bindgen_bitfield_unit.set(33usize, 31u8, { let reserved: u64 = unsafe { ::std::mem::transmute(reserved) }; reserved as u64 }); @@ -3042,80 +4185,26 @@ pub struct perf_sample_weight__bindgen_ty_1 { pub var2_w: __u16, pub var3_w: __u16, } -#[test] -fn bindgen_test_layout_perf_sample_weight__bindgen_ty_1() { - const UNINIT: ::std::mem::MaybeUninit = - ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_sample_weight__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(perf_sample_weight__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).var1_dw) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_sample_weight__bindgen_ty_1), - "::", - stringify!(var1_dw) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).var2_w) as usize - ptr as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(perf_sample_weight__bindgen_ty_1), - "::", - stringify!(var2_w) - ) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).var3_w) as usize - ptr as usize }, - 6usize, - concat!( - "Offset of field: ", - stringify!(perf_sample_weight__bindgen_ty_1), - "::", - stringify!(var3_w) - ) - ); -} -#[test] -fn bindgen_test_layout_perf_sample_weight() { - const UNINIT: ::std::mem::MaybeUninit = ::std::mem::MaybeUninit::uninit(); - let ptr = UNINIT.as_ptr(); - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(perf_sample_weight)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(perf_sample_weight)) - ); - assert_eq!( - unsafe { ::std::ptr::addr_of!((*ptr).full) as usize - ptr as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(perf_sample_weight), - "::", - stringify!(full) - ) - ); -} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_sample_weight__bindgen_ty_1"] + [::std::mem::size_of::() - 8usize]; + ["Alignment of perf_sample_weight__bindgen_ty_1"] + [::std::mem::align_of::() - 4usize]; + ["Offset of field: perf_sample_weight__bindgen_ty_1::var1_dw"] + [::std::mem::offset_of!(perf_sample_weight__bindgen_ty_1, var1_dw) - 0usize]; + ["Offset of field: perf_sample_weight__bindgen_ty_1::var2_w"] + [::std::mem::offset_of!(perf_sample_weight__bindgen_ty_1, var2_w) - 4usize]; + ["Offset of field: perf_sample_weight__bindgen_ty_1::var3_w"] + [::std::mem::offset_of!(perf_sample_weight__bindgen_ty_1, var3_w) - 6usize]; +}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of perf_sample_weight"][::std::mem::size_of::() - 8usize]; + ["Alignment of perf_sample_weight"][::std::mem::align_of::() - 8usize]; + ["Offset of field: perf_sample_weight::full"] + [::std::mem::offset_of!(perf_sample_weight, full) - 0usize]; +}; impl Default for perf_sample_weight { fn default() -> Self { let mut s = ::std::mem::MaybeUninit::::uninit(); @@ -3125,26 +4214,27 @@ impl Default for perf_sample_weight { } } } -pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_4 = 1; -pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_4 = 2; -pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_4 = 3; -pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_4 = 4; -pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_4 = 5; -pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_4 = 6; -pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_4 = 7; -pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_4 = 8; -pub type _bindgen_ty_4 = ::std::os::raw::c_uint; -pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_5 = 0; -pub const HW_BREAKPOINT_R: _bindgen_ty_5 = 1; -pub const HW_BREAKPOINT_W: _bindgen_ty_5 = 2; -pub const HW_BREAKPOINT_RW: _bindgen_ty_5 = 3; -pub const HW_BREAKPOINT_X: _bindgen_ty_5 = 4; -pub const HW_BREAKPOINT_INVALID: _bindgen_ty_5 = 7; -pub type _bindgen_ty_5 = ::std::os::raw::c_uint; -pub const TYPE_INST: bp_type_idx = 0; -pub const TYPE_DATA: bp_type_idx = 1; -pub const TYPE_MAX: bp_type_idx = 2; -pub type bp_type_idx = ::std::os::raw::c_uint; +impl ::std::fmt::Debug for perf_sample_weight { + fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { + write!(f, "perf_sample_weight {{ union }}") + } +} +pub const HW_BREAKPOINT_LEN_1: _bindgen_ty_7 = 1; +pub const HW_BREAKPOINT_LEN_2: _bindgen_ty_7 = 2; +pub const HW_BREAKPOINT_LEN_3: _bindgen_ty_7 = 3; +pub const HW_BREAKPOINT_LEN_4: _bindgen_ty_7 = 4; +pub const HW_BREAKPOINT_LEN_5: _bindgen_ty_7 = 5; +pub const HW_BREAKPOINT_LEN_6: _bindgen_ty_7 = 6; +pub const HW_BREAKPOINT_LEN_7: _bindgen_ty_7 = 7; +pub const HW_BREAKPOINT_LEN_8: _bindgen_ty_7 = 8; +pub type _bindgen_ty_7 = ::std::os::raw::c_uint; +pub const HW_BREAKPOINT_EMPTY: _bindgen_ty_8 = 0; +pub const HW_BREAKPOINT_R: _bindgen_ty_8 = 1; +pub const HW_BREAKPOINT_W: _bindgen_ty_8 = 2; +pub const HW_BREAKPOINT_RW: _bindgen_ty_8 = 3; +pub const HW_BREAKPOINT_X: _bindgen_ty_8 = 4; +pub const HW_BREAKPOINT_INVALID: _bindgen_ty_8 = 7; +pub type _bindgen_ty_8 = ::std::os::raw::c_uint; pub const ENABLE: perf_event_ioctls = 9216; pub const DISABLE: perf_event_ioctls = 9217; pub const REFRESH: perf_event_ioctls = 9218; diff --git a/perf-event-open-sys/src/lib.rs b/perf-event-open-sys/src/lib.rs index 029beb15..791cd215 100644 --- a/perf-event-open-sys/src/lib.rs +++ b/perf-event-open-sys/src/lib.rs @@ -72,7 +72,7 @@ //! The bindings in this crate are generated from the Linux kernel headers //! packaged by Fedora as: //! - x86_64: `kernel-headers-6.13.3-200.fc41.x86_64` (`PERF_ATTR_SIZE_VER8`) -//! - aarch64: `kernel-headers-5.18.4-201.fc36.aarch64` (`PERF_ATTR_SIZE_VER7`) +//! - aarch64: `kernel-headers-6.13.3-200.fc41.aarch64` (`PERF_ATTR_SIZE_VER8`) //! //! As explained above, bugs aside, it is not necessary to use the version of //! these structures that matches the kernel you want to run under, so it should