diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-30 03:57:19 +0000 |
commit | a0b8f38ab54ac451646aa00cd5e91b6c76f22a84 (patch) | |
tree | fc451898ccaf445814e26b46664d78702178101d /vendor/perf-event-open-sys | |
parent | Adding debian version 1.71.1+dfsg1-2. (diff) | |
download | rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.tar.xz rustc-a0b8f38ab54ac451646aa00cd5e91b6c76f22a84.zip |
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/perf-event-open-sys')
-rw-r--r-- | vendor/perf-event-open-sys/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/perf-event-open-sys/Cargo.toml | 29 | ||||
-rw-r--r-- | vendor/perf-event-open-sys/LICENSE-APACHE | 201 | ||||
-rw-r--r-- | vendor/perf-event-open-sys/LICENSE-MIT | 23 | ||||
-rw-r--r-- | vendor/perf-event-open-sys/README.md | 4 | ||||
-rw-r--r-- | vendor/perf-event-open-sys/RELEASE-NOTES.md | 62 | ||||
-rwxr-xr-x | vendor/perf-event-open-sys/regenerate.sh | 5 | ||||
-rw-r--r-- | vendor/perf-event-open-sys/src/bindings.rs | 941 | ||||
-rw-r--r-- | vendor/perf-event-open-sys/src/lib.rs | 57 |
9 files changed, 760 insertions, 564 deletions
diff --git a/vendor/perf-event-open-sys/.cargo-checksum.json b/vendor/perf-event-open-sys/.cargo-checksum.json index 94c12b528..545868ea4 100644 --- a/vendor/perf-event-open-sys/.cargo-checksum.json +++ b/vendor/perf-event-open-sys/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"Cargo.toml":"43d4960bd26abbc5e6682924a3a35cd5b96ddde703f8578e1b304dcbfcc77a7a","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"383389744bfd0cd720224f8a01fb6dd28be093ba4965363dcd0d6ae8da3d087b","regenerate.sh":"75c81d43681cd44c961da0399605a8cfe1b05b6d3a8659e11e9984f9f7c88618","src/bindings.rs":"ee0d5d224dfeae4feefbbfbf2ce46b7617ba109fa1b7f88ab886a99131d41bab","src/lib.rs":"42c2107446f81663e4c59a11148ebc8df5241b62a58f0712133382667bc35176","wrapper.h":"22abab03fcdb32f39c72756da8c45dd4d4b6cbf3de24d8922dbc3a460bccf27a"},"package":"ce9bedf5da2c234fdf2391ede2b90fabf585355f33100689bc364a3ea558561a"}
\ No newline at end of file +{"files":{"Cargo.toml":"30ffeea18e875a3bf4b0f22e80d583923a679b297fb68ec53c9e103e10181e47","README.md":"5cf51531089e12cc2005c94c531b9af8937255241a18dd80b18cb52e65065c5d","RELEASE-NOTES.md":"3367aa43e6de5fe0a29aa64db12d5396d218b3d698750a1a8a18d6a6a12e467f","regenerate.sh":"a99e3c4cc486d5e69068b8455f492b579f7e500d5f16b06503a380499d0d140c","src/bindings.rs":"cf2d58efa7db6b610e54a8de1db391b49e4e35f364f5037ec4ae0f45df49effd","src/lib.rs":"e037f0b9cf8ab64eaf9dcacaf1141e4974a42fe17a048967aee9e1fad4752e20","wrapper.h":"22abab03fcdb32f39c72756da8c45dd4d4b6cbf3de24d8922dbc3a460bccf27a"},"package":"b29be2ba35c12c6939f6bc73187f728bba82c3c062ecdc5fa90ea739282a1f58"}
\ No newline at end of file diff --git a/vendor/perf-event-open-sys/Cargo.toml b/vendor/perf-event-open-sys/Cargo.toml index 1fd0b9dd4..205237c82 100644 --- a/vendor/perf-event-open-sys/Cargo.toml +++ b/vendor/perf-event-open-sys/Cargo.toml @@ -3,21 +3,36 @@ # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies -# to registry (e.g., crates.io) dependencies +# to registry (e.g., crates.io) dependencies. # -# If you believe there's an error in this file please file an -# issue against the rust-lang/cargo repository. If you're -# editing this file be aware that the upstream Cargo.toml -# will likely look very different (and much more reasonable) +# If you are reading this file be aware that the original Cargo.toml +# will likely look very different (and much more reasonable). +# See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "perf-event-open-sys" -version = "1.0.1" +version = "3.0.0" authors = ["Jim Blandy <jimb@red-bean.com>"] -description = "Unsafe, direct bindings for Linux's perf_event_open system call, with associated\ntypes and constants.\n" +description = """ +Unsafe, direct bindings for Linux's perf_event_open system call, with associated +types and constants. +""" +documentation = "https://docs.rs/perf-event-open-sys/" readme = "README.md" +keywords = [ + "linux", + "perf", +] +categories = [ + "external-ffi-bindings", + "development-tools::profiling", + "hardware-support", + "os::linux-apis", +] license = "MIT OR Apache-2.0" repository = "https://github.com/jimblandy/perf-event-open-sys.git" +resolver = "2" + [dependencies.libc] version = "0.2" diff --git a/vendor/perf-event-open-sys/LICENSE-APACHE b/vendor/perf-event-open-sys/LICENSE-APACHE deleted file mode 100644 index 16fe87b06..000000000 --- a/vendor/perf-event-open-sys/LICENSE-APACHE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/vendor/perf-event-open-sys/LICENSE-MIT b/vendor/perf-event-open-sys/LICENSE-MIT deleted file mode 100644 index 31aa79387..000000000 --- a/vendor/perf-event-open-sys/LICENSE-MIT +++ /dev/null @@ -1,23 +0,0 @@ -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/vendor/perf-event-open-sys/README.md b/vendor/perf-event-open-sys/README.md index faf43d4ff..3d2a20721 100644 --- a/vendor/perf-event-open-sys/README.md +++ b/vendor/perf-event-open-sys/README.md @@ -31,8 +31,8 @@ the interface and the underlying functionality are quite complex, and new features are added at a steady pace. To update the generated bindings: - Run the `regenerate.sh` script, found in the same directory as this - `README.md` file. This runs bindgen and splices its output in the `bindings` - module's source code, preserving the documentation. + `README.md` file. This runs bindgen and splices its output into the + `bindings` module's source code, preserving the documentation. - Fix the comments in `src/lib.rs` explaining exactly which version of the kernel headers you generated the bindings from. diff --git a/vendor/perf-event-open-sys/RELEASE-NOTES.md b/vendor/perf-event-open-sys/RELEASE-NOTES.md new file mode 100644 index 000000000..f1222ec36 --- /dev/null +++ b/vendor/perf-event-open-sys/RELEASE-NOTES.md @@ -0,0 +1,62 @@ +# Release notes for `perf-event-open-sys` + +## 3.0.0 + +- Based on Linux kernel headers packaged by Fedora as `kernel-headers-5.18.4-200.fc36`. + +- Fix build for Android, x86_64-unknown-linux-musl. + +- Remove redundant prefixes from `bindings` constants derived from enums in + the Linux kernel headers. + + For example, the kernel headers have the definition: + + /* + * attr.type + */ + enum perf_type_id { + PERF_TYPE_HARDWARE = 0, + PERF_TYPE_SOFTWARE = 1, + PERF_TYPE_TRACEPOINT = 2, + ... + }; + + This crate used to render the above as constants like this: + + pub const perf_type_id_PERF_TYPE_HARDWARE: perf_type_id = 0; + pub const perf_type_id_PERF_TYPE_SOFTWARE: perf_type_id = 1; + pub const perf_type_id_PERF_TYPE_TRACEPOINT: perf_type_id = 2; + ... + + The names incorporate the names of both the C enum and its constants. But + since the constants' names are already prefixed (necessary because C places + enumeration constants in the 'ordinary identifier' namespace), this is + redundant. + + In v3.0.0, these constants are rendered in Rust like this: + + pub const PERF_TYPE_HARDWARE: perf_type_id = 0; + pub const PERF_TYPE_SOFTWARE: perf_type_id = 1; + pub const PERF_TYPE_TRACEPOINT: perf_type_id = 2; + + Here's the full list of prefixes that were stripped, in case you want to + `sed` your way through a conversion: + + bp_type_idx_ + perf_bpf_event_type_ + perf_branch_sample_type_ + perf_branch_sample_type_shift_ + perf_callchain_context_ + perf_event_ioc_flags_ + perf_event_ioctls_ + perf_event_read_format_ + perf_event_sample_format_ + perf_event_type_ + perf_hw_cache_id_ + perf_hw_cache_op_result_id_ + perf_hw_id_ + perf_record_ksymbol_type_ + perf_sample_regs_abi_ + perf_sw_ids_ + perf_type_id_ + diff --git a/vendor/perf-event-open-sys/regenerate.sh b/vendor/perf-event-open-sys/regenerate.sh index 81cfea680..75af64061 100755 --- a/vendor/perf-event-open-sys/regenerate.sh +++ b/vendor/perf-event-open-sys/regenerate.sh @@ -6,7 +6,10 @@ cd $(dirname $0) ( sed -e '/automatically generated by rust-bindgen/,$d' src/bindings.rs - bindgen --with-derive-default wrapper.h + bindgen \ + --with-derive-default \ + --no-prepend-enum-name \ + wrapper.h ) > new-bindings.rs~ mv new-bindings.rs~ src/bindings.rs diff --git a/vendor/perf-event-open-sys/src/bindings.rs b/vendor/perf-event-open-sys/src/bindings.rs index 0cdd40742..012e5afe6 100644 --- a/vendor/perf-event-open-sys/src/bindings.rs +++ b/vendor/perf-event-open-sys/src/bindings.rs @@ -18,22 +18,25 @@ #![allow(non_upper_case_globals)] #![allow(non_camel_case_types)] #![allow(non_snake_case)] +#![allow(deref_nullptr)] // `bindgen_test_layout` tests use bogus code +#![allow(clippy::missing_safety_doc)] +#![allow(clippy::too_many_arguments)] +#![allow(clippy::useless_transmute)] -/* automatically generated by rust-bindgen 0.54.1 */ +/* automatically generated by rust-bindgen 0.59.2 */ #[repr(C)] #[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] -pub struct __BindgenBitfieldUnit<Storage, Align> { +pub struct __BindgenBitfieldUnit<Storage> { storage: Storage, - align: [Align; 0], } -impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> { +impl<Storage> __BindgenBitfieldUnit<Storage> { #[inline] pub const fn new(storage: Storage) -> Self { - Self { storage, align: [] } + Self { storage } } } -impl<Storage, Align> __BindgenBitfieldUnit<Storage, Align> +impl<Storage> __BindgenBitfieldUnit<Storage> where Storage: AsRef<[u8]> + AsMut<[u8]>, { @@ -155,6 +158,8 @@ pub const IOC_INOUT: u32 = 3221225472; pub const IOCSIZE_MASK: u32 = 1073676288; pub const IOCSIZE_SHIFT: u32 = 16; pub const __LITTLE_ENDIAN: u32 = 1234; +pub const PERF_PMU_TYPE_SHIFT: u32 = 32; +pub const PERF_HW_EVENT_MASK: u32 = 4294967295; pub const PERF_ATTR_SIZE_VER0: u32 = 64; pub const PERF_ATTR_SIZE_VER1: u32 = 72; pub const PERF_ATTR_SIZE_VER2: u32 = 80; @@ -162,6 +167,7 @@ pub const PERF_ATTR_SIZE_VER3: u32 = 96; 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_RECORD_MISC_CPUMODE_MASK: u32 = 7; pub const PERF_RECORD_MISC_CPUMODE_UNKNOWN: u32 = 0; pub const PERF_RECORD_MISC_KERNEL: u32 = 1; @@ -176,6 +182,7 @@ pub const PERF_RECORD_MISC_FORK_EXEC: u32 = 8192; pub const PERF_RECORD_MISC_SWITCH_OUT: u32 = 8192; pub const PERF_RECORD_MISC_EXACT_IP: u32 = 16384; pub const PERF_RECORD_MISC_SWITCH_OUT_PREEMPT: u32 = 16384; +pub const PERF_RECORD_MISC_MMAP_BUILD_ID: u32 = 16384; pub const PERF_RECORD_MISC_EXT_RESERVED: u32 = 32768; pub const PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER: u32 = 1; pub const PERF_MAX_STACK_DEPTH: u32 = 127; @@ -184,6 +191,9 @@ pub const PERF_AUX_FLAG_TRUNCATED: u32 = 1; pub const PERF_AUX_FLAG_OVERWRITE: u32 = 2; pub const PERF_AUX_FLAG_PARTIAL: u32 = 4; pub const PERF_AUX_FLAG_COLLISION: u32 = 8; +pub const PERF_AUX_FLAG_PMU_FORMAT_TYPE_MASK: u32 = 65280; +pub const PERF_AUX_FLAG_CORESIGHT_FORMAT_CORESIGHT: u32 = 0; +pub const PERF_AUX_FLAG_CORESIGHT_FORMAT_RAW: u32 = 256; pub const PERF_FLAG_FD_NO_GROUP: u32 = 1; pub const PERF_FLAG_FD_OUTPUT: u32 = 2; pub const PERF_FLAG_PID_CGROUP: u32 = 4; @@ -228,7 +238,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_SHIFT: u32 = 37; +pub const PERF_MEM_SNOOPX_SHIFT: u32 = 38; pub const PERF_MEM_LOCK_NA: u32 = 1; pub const PERF_MEM_LOCK_LOCKED: u32 = 2; pub const PERF_MEM_LOCK_SHIFT: u32 = 24; @@ -240,8 +250,16 @@ pub const PERF_MEM_TLB_L2: u32 = 16; pub const PERF_MEM_TLB_WK: u32 = 32; pub const PERF_MEM_TLB_OS: u32 = 64; pub const PERF_MEM_TLB_SHIFT: u32 = 26; +pub const PERF_MEM_BLK_NA: u32 = 1; +pub const PERF_MEM_BLK_DATA: u32 = 2; +pub const PERF_MEM_BLK_ADDR: u32 = 4; +pub const PERF_MEM_BLK_SHIFT: u32 = 40; +pub const PERF_MEM_HOPS_0: u32 = 1; +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 __X32_SYSCALL_BIT: u32 = 1073741824; -pub const _ASM_X86_UNISTD_64_H: u32 = 1; pub const __NR_read: u32 = 0; pub const __NR_write: u32 = 1; pub const __NR_open: u32 = 2; @@ -589,8 +607,21 @@ pub const __NR_fsmount: u32 = 432; pub const __NR_fspick: u32 = 433; pub const __NR_pidfd_open: u32 = 434; pub const __NR_clone3: u32 = 435; +pub const __NR_close_range: u32 = 436; pub const __NR_openat2: u32 = 437; pub const __NR_pidfd_getfd: u32 = 438; +pub const __NR_faccessat2: u32 = 439; +pub const __NR_process_madvise: u32 = 440; +pub const __NR_epoll_pwait2: u32 = 441; +pub const __NR_mount_setattr: u32 = 442; +pub const __NR_quotactl_fd: u32 = 443; +pub const __NR_landlock_create_ruleset: u32 = 444; +pub const __NR_landlock_add_rule: u32 = 445; +pub const __NR_landlock_restrict_self: u32 = 446; +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 type __s8 = ::std::os::raw::c_schar; pub type __u8 = ::std::os::raw::c_uchar; pub type __s16 = ::std::os::raw::c_short; @@ -697,175 +728,163 @@ pub type __be64 = __u64; pub type __sum16 = __u16; pub type __wsum = __u32; pub type __poll_t = ::std::os::raw::c_uint; -pub const perf_type_id_PERF_TYPE_HARDWARE: perf_type_id = 0; -pub const perf_type_id_PERF_TYPE_SOFTWARE: perf_type_id = 1; -pub const perf_type_id_PERF_TYPE_TRACEPOINT: perf_type_id = 2; -pub const perf_type_id_PERF_TYPE_HW_CACHE: perf_type_id = 3; -pub const perf_type_id_PERF_TYPE_RAW: perf_type_id = 4; -pub const perf_type_id_PERF_TYPE_BREAKPOINT: perf_type_id = 5; -pub const perf_type_id_PERF_TYPE_MAX: perf_type_id = 6; -pub type perf_type_id = u32; -pub const perf_hw_id_PERF_COUNT_HW_CPU_CYCLES: perf_hw_id = 0; -pub const perf_hw_id_PERF_COUNT_HW_INSTRUCTIONS: perf_hw_id = 1; -pub const perf_hw_id_PERF_COUNT_HW_CACHE_REFERENCES: perf_hw_id = 2; -pub const perf_hw_id_PERF_COUNT_HW_CACHE_MISSES: perf_hw_id = 3; -pub const perf_hw_id_PERF_COUNT_HW_BRANCH_INSTRUCTIONS: perf_hw_id = 4; -pub const perf_hw_id_PERF_COUNT_HW_BRANCH_MISSES: perf_hw_id = 5; -pub const perf_hw_id_PERF_COUNT_HW_BUS_CYCLES: perf_hw_id = 6; -pub const perf_hw_id_PERF_COUNT_HW_STALLED_CYCLES_FRONTEND: perf_hw_id = 7; -pub const perf_hw_id_PERF_COUNT_HW_STALLED_CYCLES_BACKEND: perf_hw_id = 8; -pub const perf_hw_id_PERF_COUNT_HW_REF_CPU_CYCLES: perf_hw_id = 9; -pub const perf_hw_id_PERF_COUNT_HW_MAX: perf_hw_id = 10; -pub type perf_hw_id = u32; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_L1D: perf_hw_cache_id = 0; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_L1I: perf_hw_cache_id = 1; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_LL: perf_hw_cache_id = 2; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_DTLB: perf_hw_cache_id = 3; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_ITLB: perf_hw_cache_id = 4; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_BPU: perf_hw_cache_id = 5; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_NODE: perf_hw_cache_id = 6; -pub const perf_hw_cache_id_PERF_COUNT_HW_CACHE_MAX: perf_hw_cache_id = 7; -pub type perf_hw_cache_id = u32; -pub const perf_hw_cache_op_id_PERF_COUNT_HW_CACHE_OP_READ: perf_hw_cache_op_id = 0; -pub const perf_hw_cache_op_id_PERF_COUNT_HW_CACHE_OP_WRITE: perf_hw_cache_op_id = 1; -pub const perf_hw_cache_op_id_PERF_COUNT_HW_CACHE_OP_PREFETCH: perf_hw_cache_op_id = 2; -pub const perf_hw_cache_op_id_PERF_COUNT_HW_CACHE_OP_MAX: perf_hw_cache_op_id = 3; -pub type perf_hw_cache_op_id = u32; -pub const perf_hw_cache_op_result_id_PERF_COUNT_HW_CACHE_RESULT_ACCESS: perf_hw_cache_op_result_id = - 0; -pub const perf_hw_cache_op_result_id_PERF_COUNT_HW_CACHE_RESULT_MISS: perf_hw_cache_op_result_id = - 1; -pub const perf_hw_cache_op_result_id_PERF_COUNT_HW_CACHE_RESULT_MAX: perf_hw_cache_op_result_id = 2; -pub type perf_hw_cache_op_result_id = u32; -pub const perf_sw_ids_PERF_COUNT_SW_CPU_CLOCK: perf_sw_ids = 0; -pub const perf_sw_ids_PERF_COUNT_SW_TASK_CLOCK: perf_sw_ids = 1; -pub const perf_sw_ids_PERF_COUNT_SW_PAGE_FAULTS: perf_sw_ids = 2; -pub const perf_sw_ids_PERF_COUNT_SW_CONTEXT_SWITCHES: perf_sw_ids = 3; -pub const perf_sw_ids_PERF_COUNT_SW_CPU_MIGRATIONS: perf_sw_ids = 4; -pub const perf_sw_ids_PERF_COUNT_SW_PAGE_FAULTS_MIN: perf_sw_ids = 5; -pub const perf_sw_ids_PERF_COUNT_SW_PAGE_FAULTS_MAJ: perf_sw_ids = 6; -pub const perf_sw_ids_PERF_COUNT_SW_ALIGNMENT_FAULTS: perf_sw_ids = 7; -pub const perf_sw_ids_PERF_COUNT_SW_EMULATION_FAULTS: perf_sw_ids = 8; -pub const perf_sw_ids_PERF_COUNT_SW_DUMMY: perf_sw_ids = 9; -pub const perf_sw_ids_PERF_COUNT_SW_BPF_OUTPUT: perf_sw_ids = 10; -pub const perf_sw_ids_PERF_COUNT_SW_MAX: perf_sw_ids = 11; -pub type perf_sw_ids = u32; -pub const perf_event_sample_format_PERF_SAMPLE_IP: perf_event_sample_format = 1; -pub const perf_event_sample_format_PERF_SAMPLE_TID: perf_event_sample_format = 2; -pub const perf_event_sample_format_PERF_SAMPLE_TIME: perf_event_sample_format = 4; -pub const perf_event_sample_format_PERF_SAMPLE_ADDR: perf_event_sample_format = 8; -pub const perf_event_sample_format_PERF_SAMPLE_READ: perf_event_sample_format = 16; -pub const perf_event_sample_format_PERF_SAMPLE_CALLCHAIN: perf_event_sample_format = 32; -pub const perf_event_sample_format_PERF_SAMPLE_ID: perf_event_sample_format = 64; -pub const perf_event_sample_format_PERF_SAMPLE_CPU: perf_event_sample_format = 128; -pub const perf_event_sample_format_PERF_SAMPLE_PERIOD: perf_event_sample_format = 256; -pub const perf_event_sample_format_PERF_SAMPLE_STREAM_ID: perf_event_sample_format = 512; -pub const perf_event_sample_format_PERF_SAMPLE_RAW: perf_event_sample_format = 1024; -pub const perf_event_sample_format_PERF_SAMPLE_BRANCH_STACK: perf_event_sample_format = 2048; -pub const perf_event_sample_format_PERF_SAMPLE_REGS_USER: perf_event_sample_format = 4096; -pub const perf_event_sample_format_PERF_SAMPLE_STACK_USER: perf_event_sample_format = 8192; -pub const perf_event_sample_format_PERF_SAMPLE_WEIGHT: perf_event_sample_format = 16384; -pub const perf_event_sample_format_PERF_SAMPLE_DATA_SRC: perf_event_sample_format = 32768; -pub const perf_event_sample_format_PERF_SAMPLE_IDENTIFIER: perf_event_sample_format = 65536; -pub const perf_event_sample_format_PERF_SAMPLE_TRANSACTION: perf_event_sample_format = 131072; -pub const perf_event_sample_format_PERF_SAMPLE_REGS_INTR: perf_event_sample_format = 262144; -pub const perf_event_sample_format_PERF_SAMPLE_PHYS_ADDR: perf_event_sample_format = 524288; -pub const perf_event_sample_format_PERF_SAMPLE_AUX: perf_event_sample_format = 1048576; -pub const perf_event_sample_format_PERF_SAMPLE_MAX: perf_event_sample_format = 2097152; -pub const perf_event_sample_format___PERF_SAMPLE_CALLCHAIN_EARLY: perf_event_sample_format = - 9223372036854775808; -pub type perf_event_sample_format = u64; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_USER_SHIFT: - perf_branch_sample_type_shift = 0; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_KERNEL_SHIFT: - perf_branch_sample_type_shift = 1; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_HV_SHIFT: perf_branch_sample_type_shift = - 2; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_ANY_SHIFT: - perf_branch_sample_type_shift = 3; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT: - perf_branch_sample_type_shift = 4; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT: - perf_branch_sample_type_shift = 5; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_IND_CALL_SHIFT: - perf_branch_sample_type_shift = 6; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT: - perf_branch_sample_type_shift = 7; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_IN_TX_SHIFT: - perf_branch_sample_type_shift = 8; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_NO_TX_SHIFT: - perf_branch_sample_type_shift = 9; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_COND_SHIFT: - perf_branch_sample_type_shift = 10; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT: - perf_branch_sample_type_shift = 11; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT: - perf_branch_sample_type_shift = 12; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_CALL_SHIFT: - perf_branch_sample_type_shift = 13; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT: - perf_branch_sample_type_shift = 14; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT: - perf_branch_sample_type_shift = 15; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT: - perf_branch_sample_type_shift = 16; -pub const perf_branch_sample_type_shift_PERF_SAMPLE_BRANCH_MAX_SHIFT: - perf_branch_sample_type_shift = 17; -pub type perf_branch_sample_type_shift = u32; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_USER: perf_branch_sample_type = 1; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_KERNEL: perf_branch_sample_type = 2; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_HV: perf_branch_sample_type = 4; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_ANY: perf_branch_sample_type = 8; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_ANY_CALL: perf_branch_sample_type = 16; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_ANY_RETURN: perf_branch_sample_type = 32; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_IND_CALL: perf_branch_sample_type = 64; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_ABORT_TX: perf_branch_sample_type = 128; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_IN_TX: perf_branch_sample_type = 256; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_NO_TX: perf_branch_sample_type = 512; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_COND: perf_branch_sample_type = 1024; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_CALL_STACK: perf_branch_sample_type = 2048; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_IND_JUMP: perf_branch_sample_type = 4096; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_CALL: perf_branch_sample_type = 8192; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_NO_FLAGS: perf_branch_sample_type = 16384; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_NO_CYCLES: perf_branch_sample_type = 32768; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_TYPE_SAVE: perf_branch_sample_type = 65536; -pub const perf_branch_sample_type_PERF_SAMPLE_BRANCH_MAX: perf_branch_sample_type = 131072; -pub type perf_branch_sample_type = u32; -pub const PERF_BR_UNKNOWN: _bindgen_ty_1 = 0; -pub const PERF_BR_COND: _bindgen_ty_1 = 1; -pub const PERF_BR_UNCOND: _bindgen_ty_1 = 2; -pub const PERF_BR_IND: _bindgen_ty_1 = 3; -pub const PERF_BR_CALL: _bindgen_ty_1 = 4; -pub const PERF_BR_IND_CALL: _bindgen_ty_1 = 5; -pub const PERF_BR_RET: _bindgen_ty_1 = 6; -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 type _bindgen_ty_1 = u32; -pub const perf_sample_regs_abi_PERF_SAMPLE_REGS_ABI_NONE: perf_sample_regs_abi = 0; -pub const perf_sample_regs_abi_PERF_SAMPLE_REGS_ABI_32: perf_sample_regs_abi = 1; -pub const perf_sample_regs_abi_PERF_SAMPLE_REGS_ABI_64: perf_sample_regs_abi = 2; -pub type perf_sample_regs_abi = u32; -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 = u64; -pub const perf_event_read_format_PERF_FORMAT_TOTAL_TIME_ENABLED: perf_event_read_format = 1; -pub const perf_event_read_format_PERF_FORMAT_TOTAL_TIME_RUNNING: perf_event_read_format = 2; -pub const perf_event_read_format_PERF_FORMAT_ID: perf_event_read_format = 4; -pub const perf_event_read_format_PERF_FORMAT_GROUP: perf_event_read_format = 8; -pub const perf_event_read_format_PERF_FORMAT_MAX: perf_event_read_format = 16; -pub type perf_event_read_format = u32; +pub const PERF_TYPE_HARDWARE: perf_type_id = 0; +pub const PERF_TYPE_SOFTWARE: perf_type_id = 1; +pub const PERF_TYPE_TRACEPOINT: perf_type_id = 2; +pub const PERF_TYPE_HW_CACHE: perf_type_id = 3; +pub const PERF_TYPE_RAW: perf_type_id = 4; +pub const PERF_TYPE_BREAKPOINT: perf_type_id = 5; +pub const PERF_TYPE_MAX: perf_type_id = 6; +pub type perf_type_id = ::std::os::raw::c_uint; +pub const PERF_COUNT_HW_CPU_CYCLES: perf_hw_id = 0; +pub const PERF_COUNT_HW_INSTRUCTIONS: perf_hw_id = 1; +pub const PERF_COUNT_HW_CACHE_REFERENCES: perf_hw_id = 2; +pub const PERF_COUNT_HW_CACHE_MISSES: perf_hw_id = 3; +pub const PERF_COUNT_HW_BRANCH_INSTRUCTIONS: perf_hw_id = 4; +pub const PERF_COUNT_HW_BRANCH_MISSES: perf_hw_id = 5; +pub const PERF_COUNT_HW_BUS_CYCLES: perf_hw_id = 6; +pub const PERF_COUNT_HW_STALLED_CYCLES_FRONTEND: perf_hw_id = 7; +pub const PERF_COUNT_HW_STALLED_CYCLES_BACKEND: perf_hw_id = 8; +pub const PERF_COUNT_HW_REF_CPU_CYCLES: perf_hw_id = 9; +pub const PERF_COUNT_HW_MAX: perf_hw_id = 10; +pub type perf_hw_id = ::std::os::raw::c_uint; +pub const PERF_COUNT_HW_CACHE_L1D: perf_hw_cache_id = 0; +pub const PERF_COUNT_HW_CACHE_L1I: perf_hw_cache_id = 1; +pub const PERF_COUNT_HW_CACHE_LL: perf_hw_cache_id = 2; +pub const PERF_COUNT_HW_CACHE_DTLB: perf_hw_cache_id = 3; +pub const PERF_COUNT_HW_CACHE_ITLB: perf_hw_cache_id = 4; +pub const PERF_COUNT_HW_CACHE_BPU: perf_hw_cache_id = 5; +pub const PERF_COUNT_HW_CACHE_NODE: perf_hw_cache_id = 6; +pub const PERF_COUNT_HW_CACHE_MAX: perf_hw_cache_id = 7; +pub type perf_hw_cache_id = ::std::os::raw::c_uint; +pub const PERF_COUNT_HW_CACHE_OP_READ: perf_hw_cache_op_id = 0; +pub const PERF_COUNT_HW_CACHE_OP_WRITE: perf_hw_cache_op_id = 1; +pub const PERF_COUNT_HW_CACHE_OP_PREFETCH: perf_hw_cache_op_id = 2; +pub const PERF_COUNT_HW_CACHE_OP_MAX: perf_hw_cache_op_id = 3; +pub type perf_hw_cache_op_id = ::std::os::raw::c_uint; +pub const PERF_COUNT_HW_CACHE_RESULT_ACCESS: perf_hw_cache_op_result_id = 0; +pub const PERF_COUNT_HW_CACHE_RESULT_MISS: perf_hw_cache_op_result_id = 1; +pub const PERF_COUNT_HW_CACHE_RESULT_MAX: perf_hw_cache_op_result_id = 2; +pub type perf_hw_cache_op_result_id = ::std::os::raw::c_uint; +pub const PERF_COUNT_SW_CPU_CLOCK: perf_sw_ids = 0; +pub const PERF_COUNT_SW_TASK_CLOCK: perf_sw_ids = 1; +pub const PERF_COUNT_SW_PAGE_FAULTS: perf_sw_ids = 2; +pub const PERF_COUNT_SW_CONTEXT_SWITCHES: perf_sw_ids = 3; +pub const PERF_COUNT_SW_CPU_MIGRATIONS: perf_sw_ids = 4; +pub const PERF_COUNT_SW_PAGE_FAULTS_MIN: perf_sw_ids = 5; +pub const PERF_COUNT_SW_PAGE_FAULTS_MAJ: perf_sw_ids = 6; +pub const PERF_COUNT_SW_ALIGNMENT_FAULTS: perf_sw_ids = 7; +pub const PERF_COUNT_SW_EMULATION_FAULTS: perf_sw_ids = 8; +pub const PERF_COUNT_SW_DUMMY: perf_sw_ids = 9; +pub const PERF_COUNT_SW_BPF_OUTPUT: perf_sw_ids = 10; +pub const PERF_COUNT_SW_CGROUP_SWITCHES: perf_sw_ids = 11; +pub const PERF_COUNT_SW_MAX: perf_sw_ids = 12; +pub type perf_sw_ids = ::std::os::raw::c_uint; +pub const PERF_SAMPLE_IP: perf_event_sample_format = 1; +pub const PERF_SAMPLE_TID: perf_event_sample_format = 2; +pub const PERF_SAMPLE_TIME: perf_event_sample_format = 4; +pub const PERF_SAMPLE_ADDR: perf_event_sample_format = 8; +pub const PERF_SAMPLE_READ: perf_event_sample_format = 16; +pub const PERF_SAMPLE_CALLCHAIN: perf_event_sample_format = 32; +pub const PERF_SAMPLE_ID: perf_event_sample_format = 64; +pub const PERF_SAMPLE_CPU: perf_event_sample_format = 128; +pub const PERF_SAMPLE_PERIOD: perf_event_sample_format = 256; +pub const PERF_SAMPLE_STREAM_ID: perf_event_sample_format = 512; +pub const PERF_SAMPLE_RAW: perf_event_sample_format = 1024; +pub const PERF_SAMPLE_BRANCH_STACK: perf_event_sample_format = 2048; +pub const PERF_SAMPLE_REGS_USER: perf_event_sample_format = 4096; +pub const PERF_SAMPLE_STACK_USER: perf_event_sample_format = 8192; +pub const PERF_SAMPLE_WEIGHT: perf_event_sample_format = 16384; +pub const PERF_SAMPLE_DATA_SRC: perf_event_sample_format = 32768; +pub const PERF_SAMPLE_IDENTIFIER: perf_event_sample_format = 65536; +pub const PERF_SAMPLE_TRANSACTION: perf_event_sample_format = 131072; +pub const PERF_SAMPLE_REGS_INTR: perf_event_sample_format = 262144; +pub const PERF_SAMPLE_PHYS_ADDR: perf_event_sample_format = 524288; +pub const PERF_SAMPLE_AUX: perf_event_sample_format = 1048576; +pub const PERF_SAMPLE_CGROUP: perf_event_sample_format = 2097152; +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 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; +pub const PERF_SAMPLE_BRANCH_ANY_SHIFT: perf_branch_sample_type_shift = 3; +pub const PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT: perf_branch_sample_type_shift = 4; +pub const PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT: perf_branch_sample_type_shift = 5; +pub const PERF_SAMPLE_BRANCH_IND_CALL_SHIFT: perf_branch_sample_type_shift = 6; +pub const PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT: perf_branch_sample_type_shift = 7; +pub const PERF_SAMPLE_BRANCH_IN_TX_SHIFT: perf_branch_sample_type_shift = 8; +pub const PERF_SAMPLE_BRANCH_NO_TX_SHIFT: perf_branch_sample_type_shift = 9; +pub const PERF_SAMPLE_BRANCH_COND_SHIFT: perf_branch_sample_type_shift = 10; +pub const PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT: perf_branch_sample_type_shift = 11; +pub const PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT: perf_branch_sample_type_shift = 12; +pub const PERF_SAMPLE_BRANCH_CALL_SHIFT: perf_branch_sample_type_shift = 13; +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 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; +pub const PERF_SAMPLE_BRANCH_HV: perf_branch_sample_type = 4; +pub const PERF_SAMPLE_BRANCH_ANY: perf_branch_sample_type = 8; +pub const PERF_SAMPLE_BRANCH_ANY_CALL: perf_branch_sample_type = 16; +pub const PERF_SAMPLE_BRANCH_ANY_RETURN: perf_branch_sample_type = 32; +pub const PERF_SAMPLE_BRANCH_IND_CALL: perf_branch_sample_type = 64; +pub const PERF_SAMPLE_BRANCH_ABORT_TX: perf_branch_sample_type = 128; +pub const PERF_SAMPLE_BRANCH_IN_TX: perf_branch_sample_type = 256; +pub const PERF_SAMPLE_BRANCH_NO_TX: perf_branch_sample_type = 512; +pub const PERF_SAMPLE_BRANCH_COND: perf_branch_sample_type = 1024; +pub const PERF_SAMPLE_BRANCH_CALL_STACK: perf_branch_sample_type = 2048; +pub const PERF_SAMPLE_BRANCH_IND_JUMP: perf_branch_sample_type = 4096; +pub const PERF_SAMPLE_BRANCH_CALL: perf_branch_sample_type = 8192; +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 type perf_branch_sample_type = ::std::os::raw::c_uint; +pub const PERF_BR_UNKNOWN: ::std::os::raw::c_uint = 0; +pub const PERF_BR_COND: ::std::os::raw::c_uint = 1; +pub const PERF_BR_UNCOND: ::std::os::raw::c_uint = 2; +pub const PERF_BR_IND: ::std::os::raw::c_uint = 3; +pub const PERF_BR_CALL: ::std::os::raw::c_uint = 4; +pub const PERF_BR_IND_CALL: ::std::os::raw::c_uint = 5; +pub const PERF_BR_RET: ::std::os::raw::c_uint = 6; +pub const PERF_BR_SYSCALL: ::std::os::raw::c_uint = 7; +pub const PERF_BR_SYSRET: ::std::os::raw::c_uint = 8; +pub const PERF_BR_COND_CALL: ::std::os::raw::c_uint = 9; +pub const PERF_BR_COND_RET: ::std::os::raw::c_uint = 10; +pub const PERF_BR_ERET: ::std::os::raw::c_uint = 11; +pub const PERF_BR_IRQ: ::std::os::raw::c_uint = 12; +pub const PERF_BR_MAX: ::std::os::raw::c_uint = 13; +pub type _bindgen_ty_1 = ::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: ::std::os::raw::c_ulong = 1; +pub const PERF_TXN_TRANSACTION: ::std::os::raw::c_ulong = 2; +pub const PERF_TXN_SYNC: ::std::os::raw::c_ulong = 4; +pub const PERF_TXN_ASYNC: ::std::os::raw::c_ulong = 8; +pub const PERF_TXN_RETRY: ::std::os::raw::c_ulong = 16; +pub const PERF_TXN_CONFLICT: ::std::os::raw::c_ulong = 32; +pub const PERF_TXN_CAPACITY_WRITE: ::std::os::raw::c_ulong = 64; +pub const PERF_TXN_CAPACITY_READ: ::std::os::raw::c_ulong = 128; +pub const PERF_TXN_MAX: ::std::os::raw::c_ulong = 256; +pub const PERF_TXN_ABORT_MASK: ::std::os::raw::c_ulong = 18446744069414584320; +pub const PERF_TXN_ABORT_SHIFT: ::std::os::raw::c_ulong = 32; +pub type _bindgen_ty_2 = ::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 type perf_event_read_format = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] pub struct perf_event_attr { @@ -875,7 +894,8 @@ pub struct perf_event_attr { pub __bindgen_anon_1: perf_event_attr__bindgen_ty_1, pub sample_type: __u64, pub read_format: __u64, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u32>, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, pub __bindgen_anon_2: perf_event_attr__bindgen_ty_2, pub bp_type: __u32, pub __bindgen_anon_3: perf_event_attr__bindgen_ty_3, @@ -890,13 +910,13 @@ pub struct perf_event_attr { pub __reserved_2: __u16, pub aux_sample_size: __u32, pub __reserved_3: __u32, + pub sig_data: __u64, } #[repr(C)] #[derive(Copy, Clone)] pub union perf_event_attr__bindgen_ty_1 { pub sample_period: __u64, pub sample_freq: __u64, - _bindgen_union_align: u64, } #[test] fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { @@ -939,7 +959,11 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_1() { } impl Default for perf_event_attr__bindgen_ty_1 { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } #[repr(C)] @@ -947,7 +971,6 @@ impl Default for perf_event_attr__bindgen_ty_1 { pub union perf_event_attr__bindgen_ty_2 { pub wakeup_events: __u32, pub wakeup_watermark: __u32, - _bindgen_union_align: u32, } #[test] fn bindgen_test_layout_perf_event_attr__bindgen_ty_2() { @@ -990,7 +1013,11 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_2() { } impl Default for perf_event_attr__bindgen_ty_2 { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } #[repr(C)] @@ -1000,7 +1027,6 @@ pub union perf_event_attr__bindgen_ty_3 { pub kprobe_func: __u64, pub uprobe_path: __u64, pub config1: __u64, - _bindgen_union_align: u64, } #[test] fn bindgen_test_layout_perf_event_attr__bindgen_ty_3() { @@ -1067,7 +1093,11 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_3() { } impl Default for perf_event_attr__bindgen_ty_3 { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } #[repr(C)] @@ -1077,7 +1107,6 @@ pub union perf_event_attr__bindgen_ty_4 { pub kprobe_addr: __u64, pub probe_offset: __u64, pub config2: __u64, - _bindgen_union_align: u64, } #[test] fn bindgen_test_layout_perf_event_attr__bindgen_ty_4() { @@ -1144,14 +1173,18 @@ fn bindgen_test_layout_perf_event_attr__bindgen_ty_4() { } impl Default for perf_event_attr__bindgen_ty_4 { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } #[test] fn bindgen_test_layout_perf_event_attr() { assert_eq!( ::std::mem::size_of::<perf_event_attr>(), - 120usize, + 128usize, concat!("Size of: ", stringify!(perf_event_attr)) ); assert_eq!( @@ -1329,10 +1362,24 @@ fn bindgen_test_layout_perf_event_attr() { stringify!(__reserved_3) ) ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<perf_event_attr>())).sig_data as *const _ as usize }, + 120usize, + concat!( + "Offset of field: ", + stringify!(perf_event_attr), + "::", + stringify!(sig_data) + ) + ); } impl Default for perf_event_attr { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } impl perf_event_attr { @@ -1678,14 +1725,80 @@ impl perf_event_attr { } } #[inline] + pub fn cgroup(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 1u8) as u64) } + } + #[inline] + pub fn set_cgroup(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(32usize, 1u8, val as u64) + } + } + #[inline] + pub fn text_poke(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(33usize, 1u8) as u64) } + } + #[inline] + pub fn set_text_poke(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(33usize, 1u8, val as u64) + } + } + #[inline] + pub fn build_id(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(34usize, 1u8) as u64) } + } + #[inline] + pub fn set_build_id(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(34usize, 1u8, val as u64) + } + } + #[inline] + pub fn inherit_thread(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(35usize, 1u8) as u64) } + } + #[inline] + pub fn set_inherit_thread(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(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) } + } + #[inline] + pub fn set_remove_on_exec(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(36usize, 1u8, val as u64) + } + } + #[inline] + pub fn sigtrap(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(37usize, 1u8) as u64) } + } + #[inline] + pub fn set_sigtrap(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(37usize, 1u8, val as u64) + } + } + #[inline] pub fn __reserved_1(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(32usize, 32u8) as u64) } + unsafe { ::std::mem::transmute(self._bitfield_1.get(38usize, 26u8) as u64) } } #[inline] pub fn set___reserved_1(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(32usize, 32u8, val as u64) + self._bitfield_1.set(38usize, 26u8, val as u64) } } #[inline] @@ -1721,10 +1834,15 @@ impl perf_event_attr { ksymbol: __u64, bpf_event: __u64, aux_output: __u64, + cgroup: __u64, + text_poke: __u64, + build_id: __u64, + inherit_thread: __u64, + remove_on_exec: __u64, + sigtrap: __u64, __reserved_1: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u32> = - Default::default(); + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let disabled: u64 = unsafe { ::std::mem::transmute(disabled) }; disabled as u64 @@ -1851,7 +1969,31 @@ impl perf_event_attr { let aux_output: u64 = unsafe { ::std::mem::transmute(aux_output) }; aux_output as u64 }); - __bindgen_bitfield_unit.set(32usize, 32u8, { + __bindgen_bitfield_unit.set(32usize, 1u8, { + let cgroup: u64 = unsafe { ::std::mem::transmute(cgroup) }; + cgroup as u64 + }); + __bindgen_bitfield_unit.set(33usize, 1u8, { + let text_poke: u64 = unsafe { ::std::mem::transmute(text_poke) }; + text_poke as u64 + }); + __bindgen_bitfield_unit.set(34usize, 1u8, { + let build_id: u64 = unsafe { ::std::mem::transmute(build_id) }; + build_id as u64 + }); + __bindgen_bitfield_unit.set(35usize, 1u8, { + let inherit_thread: u64 = unsafe { ::std::mem::transmute(inherit_thread) }; + inherit_thread as u64 + }); + __bindgen_bitfield_unit.set(36usize, 1u8, { + let remove_on_exec: u64 = unsafe { ::std::mem::transmute(remove_on_exec) }; + remove_on_exec as u64 + }); + __bindgen_bitfield_unit.set(37usize, 1u8, { + let sigtrap: u64 = unsafe { ::std::mem::transmute(sigtrap) }; + sigtrap as u64 + }); + __bindgen_bitfield_unit.set(38usize, 26u8, { let __reserved_1: u64 = unsafe { ::std::mem::transmute(__reserved_1) }; __reserved_1 as u64 }); @@ -1908,8 +2050,8 @@ fn bindgen_test_layout_perf_event_query_bpf() { ) ); } -pub const perf_event_ioc_flags_PERF_IOC_FLAG_GROUP: perf_event_ioc_flags = 1; -pub type perf_event_ioc_flags = u32; +pub const PERF_IOC_FLAG_GROUP: perf_event_ioc_flags = 1; +pub type perf_event_ioc_flags = ::std::os::raw::c_uint; #[repr(C)] #[derive(Copy, Clone)] pub struct perf_event_mmap_page { @@ -1927,7 +2069,10 @@ pub struct perf_event_mmap_page { pub time_offset: __u64, pub time_zero: __u64, pub size: __u32, - pub __reserved: [__u8; 948usize], + pub __reserved_1: __u32, + pub time_cycles: __u64, + pub time_mask: __u64, + pub __reserved: [__u8; 928usize], pub data_head: __u64, pub data_tail: __u64, pub data_offset: __u64, @@ -1942,13 +2087,13 @@ pub struct perf_event_mmap_page { pub union perf_event_mmap_page__bindgen_ty_1 { pub capabilities: __u64, pub __bindgen_anon_1: perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1, - _bindgen_union_align: u64, } #[repr(C)] #[repr(align(8))] #[derive(Debug, Default, Copy, Clone)] pub struct perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u64>, + 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() { @@ -2026,14 +2171,25 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { } } #[inline] + pub fn cap_user_time_short(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u64) } + } + #[inline] + pub fn set_cap_user_time_short(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(5usize, 1u8, val as u64) + } + } + #[inline] pub fn cap_____res(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(5usize, 59u8) as u64) } + unsafe { ::std::mem::transmute(self._bitfield_1.get(6usize, 58u8) as u64) } } #[inline] pub fn set_cap_____res(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(5usize, 59u8, val as u64) + self._bitfield_1.set(6usize, 58u8, val as u64) } } #[inline] @@ -2043,10 +2199,10 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { cap_user_rdpmc: __u64, cap_user_time: __u64, cap_user_time_zero: __u64, + cap_user_time_short: __u64, cap_____res: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> = - Default::default(); + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let cap_bit0: u64 = unsafe { ::std::mem::transmute(cap_bit0) }; cap_bit0 as u64 @@ -2068,7 +2224,11 @@ impl perf_event_mmap_page__bindgen_ty_1__bindgen_ty_1 { let cap_user_time_zero: u64 = unsafe { ::std::mem::transmute(cap_user_time_zero) }; cap_user_time_zero as u64 }); - __bindgen_bitfield_unit.set(5usize, 59u8, { + __bindgen_bitfield_unit.set(5usize, 1u8, { + let cap_user_time_short: u64 = unsafe { ::std::mem::transmute(cap_user_time_short) }; + cap_user_time_short as u64 + }); + __bindgen_bitfield_unit.set(6usize, 58u8, { let cap_____res: u64 = unsafe { ::std::mem::transmute(cap_____res) }; cap_____res as u64 }); @@ -2106,7 +2266,11 @@ fn bindgen_test_layout_perf_event_mmap_page__bindgen_ty_1() { } impl Default for perf_event_mmap_page__bindgen_ty_1 { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } #[test] @@ -2260,12 +2424,46 @@ fn bindgen_test_layout_perf_event_mmap_page() { ) ); assert_eq!( - unsafe { &(*(::std::ptr::null::<perf_event_mmap_page>())).__reserved as *const _ as usize }, + unsafe { + &(*(::std::ptr::null::<perf_event_mmap_page>())).__reserved_1 as *const _ as usize + }, 76usize, concat!( "Offset of field: ", stringify!(perf_event_mmap_page), "::", + stringify!(__reserved_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<perf_event_mmap_page>())).time_cycles as *const _ as usize + }, + 80usize, + concat!( + "Offset of field: ", + stringify!(perf_event_mmap_page), + "::", + stringify!(time_cycles) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<perf_event_mmap_page>())).time_mask as *const _ as usize }, + 88usize, + concat!( + "Offset of field: ", + stringify!(perf_event_mmap_page), + "::", + stringify!(time_mask) + ) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<perf_event_mmap_page>())).__reserved as *const _ as usize }, + 96usize, + concat!( + "Offset of field: ", + stringify!(perf_event_mmap_page), + "::", stringify!(__reserved) ) ); @@ -2354,7 +2552,11 @@ fn bindgen_test_layout_perf_event_mmap_page() { } impl Default for perf_event_mmap_page { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } #[repr(C)] @@ -2446,66 +2648,68 @@ fn bindgen_test_layout_perf_ns_link_info() { ) ); } -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 = u32; -pub const perf_event_type_PERF_RECORD_MMAP: perf_event_type = 1; -pub const perf_event_type_PERF_RECORD_LOST: perf_event_type = 2; -pub const perf_event_type_PERF_RECORD_COMM: perf_event_type = 3; -pub const perf_event_type_PERF_RECORD_EXIT: perf_event_type = 4; -pub const perf_event_type_PERF_RECORD_THROTTLE: perf_event_type = 5; -pub const perf_event_type_PERF_RECORD_UNTHROTTLE: perf_event_type = 6; -pub const perf_event_type_PERF_RECORD_FORK: perf_event_type = 7; -pub const perf_event_type_PERF_RECORD_READ: perf_event_type = 8; -pub const perf_event_type_PERF_RECORD_SAMPLE: perf_event_type = 9; -pub const perf_event_type_PERF_RECORD_MMAP2: perf_event_type = 10; -pub const perf_event_type_PERF_RECORD_AUX: perf_event_type = 11; -pub const perf_event_type_PERF_RECORD_ITRACE_START: perf_event_type = 12; -pub const perf_event_type_PERF_RECORD_LOST_SAMPLES: perf_event_type = 13; -pub const perf_event_type_PERF_RECORD_SWITCH: perf_event_type = 14; -pub const perf_event_type_PERF_RECORD_SWITCH_CPU_WIDE: perf_event_type = 15; -pub const perf_event_type_PERF_RECORD_NAMESPACES: perf_event_type = 16; -pub const perf_event_type_PERF_RECORD_KSYMBOL: perf_event_type = 17; -pub const perf_event_type_PERF_RECORD_BPF_EVENT: perf_event_type = 18; -pub const perf_event_type_PERF_RECORD_MAX: perf_event_type = 19; -pub type perf_event_type = u32; -pub const perf_record_ksymbol_type_PERF_RECORD_KSYMBOL_TYPE_UNKNOWN: perf_record_ksymbol_type = 0; -pub const perf_record_ksymbol_type_PERF_RECORD_KSYMBOL_TYPE_BPF: perf_record_ksymbol_type = 1; -pub const perf_record_ksymbol_type_PERF_RECORD_KSYMBOL_TYPE_MAX: perf_record_ksymbol_type = 2; -pub type perf_record_ksymbol_type = u32; -pub const perf_bpf_event_type_PERF_BPF_EVENT_UNKNOWN: perf_bpf_event_type = 0; -pub const perf_bpf_event_type_PERF_BPF_EVENT_PROG_LOAD: perf_bpf_event_type = 1; -pub const perf_bpf_event_type_PERF_BPF_EVENT_PROG_UNLOAD: perf_bpf_event_type = 2; -pub const perf_bpf_event_type_PERF_BPF_EVENT_MAX: perf_bpf_event_type = 3; -pub type perf_bpf_event_type = u32; -pub const perf_callchain_context_PERF_CONTEXT_HV: perf_callchain_context = 18446744073709551584; -pub const perf_callchain_context_PERF_CONTEXT_KERNEL: perf_callchain_context = 18446744073709551488; -pub const perf_callchain_context_PERF_CONTEXT_USER: perf_callchain_context = 18446744073709551104; -pub const perf_callchain_context_PERF_CONTEXT_GUEST: perf_callchain_context = 18446744073709549568; -pub const perf_callchain_context_PERF_CONTEXT_GUEST_KERNEL: perf_callchain_context = - 18446744073709549440; -pub const perf_callchain_context_PERF_CONTEXT_GUEST_USER: perf_callchain_context = - 18446744073709549056; -pub const perf_callchain_context_PERF_CONTEXT_MAX: perf_callchain_context = 18446744073709547521; -pub type perf_callchain_context = u64; +pub const NET_NS_INDEX: ::std::os::raw::c_uint = 0; +pub const UTS_NS_INDEX: ::std::os::raw::c_uint = 1; +pub const IPC_NS_INDEX: ::std::os::raw::c_uint = 2; +pub const PID_NS_INDEX: ::std::os::raw::c_uint = 3; +pub const USER_NS_INDEX: ::std::os::raw::c_uint = 4; +pub const MNT_NS_INDEX: ::std::os::raw::c_uint = 5; +pub const CGROUP_NS_INDEX: ::std::os::raw::c_uint = 6; +pub const NR_NAMESPACES: ::std::os::raw::c_uint = 7; +pub type _bindgen_ty_3 = ::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; +pub const PERF_RECORD_EXIT: perf_event_type = 4; +pub const PERF_RECORD_THROTTLE: perf_event_type = 5; +pub const PERF_RECORD_UNTHROTTLE: perf_event_type = 6; +pub const PERF_RECORD_FORK: perf_event_type = 7; +pub const PERF_RECORD_READ: perf_event_type = 8; +pub const PERF_RECORD_SAMPLE: perf_event_type = 9; +pub const PERF_RECORD_MMAP2: perf_event_type = 10; +pub const PERF_RECORD_AUX: perf_event_type = 11; +pub const PERF_RECORD_ITRACE_START: perf_event_type = 12; +pub const PERF_RECORD_LOST_SAMPLES: perf_event_type = 13; +pub const PERF_RECORD_SWITCH: perf_event_type = 14; +pub const PERF_RECORD_SWITCH_CPU_WIDE: perf_event_type = 15; +pub const PERF_RECORD_NAMESPACES: perf_event_type = 16; +pub const PERF_RECORD_KSYMBOL: perf_event_type = 17; +pub const PERF_RECORD_BPF_EVENT: perf_event_type = 18; +pub const PERF_RECORD_CGROUP: perf_event_type = 19; +pub const PERF_RECORD_TEXT_POKE: perf_event_type = 20; +pub const PERF_RECORD_AUX_OUTPUT_HW_ID: perf_event_type = 21; +pub const PERF_RECORD_MAX: perf_event_type = 22; +pub type perf_event_type = ::std::os::raw::c_uint; +pub const PERF_RECORD_KSYMBOL_TYPE_UNKNOWN: perf_record_ksymbol_type = 0; +pub const PERF_RECORD_KSYMBOL_TYPE_BPF: perf_record_ksymbol_type = 1; +pub const PERF_RECORD_KSYMBOL_TYPE_OOL: perf_record_ksymbol_type = 2; +pub const PERF_RECORD_KSYMBOL_TYPE_MAX: perf_record_ksymbol_type = 3; +pub type perf_record_ksymbol_type = ::std::os::raw::c_uint; +pub const PERF_BPF_EVENT_UNKNOWN: perf_bpf_event_type = 0; +pub const PERF_BPF_EVENT_PROG_LOAD: perf_bpf_event_type = 1; +pub const PERF_BPF_EVENT_PROG_UNLOAD: perf_bpf_event_type = 2; +pub const PERF_BPF_EVENT_MAX: perf_bpf_event_type = 3; +pub type perf_bpf_event_type = ::std::os::raw::c_uint; +pub const PERF_CONTEXT_HV: perf_callchain_context = 18446744073709551584; +pub const PERF_CONTEXT_KERNEL: perf_callchain_context = 18446744073709551488; +pub const PERF_CONTEXT_USER: perf_callchain_context = 18446744073709551104; +pub const PERF_CONTEXT_GUEST: perf_callchain_context = 18446744073709549568; +pub const PERF_CONTEXT_GUEST_KERNEL: perf_callchain_context = 18446744073709549440; +pub const PERF_CONTEXT_GUEST_USER: perf_callchain_context = 18446744073709549056; +pub const PERF_CONTEXT_MAX: perf_callchain_context = 18446744073709547521; +pub type perf_callchain_context = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Copy, Clone)] pub union perf_mem_data_src { pub val: __u64, pub __bindgen_anon_1: perf_mem_data_src__bindgen_ty_1, - _bindgen_union_align: u64, } #[repr(C)] #[repr(align(8))] #[derive(Debug, Default, Copy, Clone)] pub struct perf_mem_data_src__bindgen_ty_1 { - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u32>, + pub _bitfield_align_1: [u32; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] fn bindgen_test_layout_perf_mem_data_src__bindgen_ty_1() { @@ -2610,14 +2814,36 @@ impl perf_mem_data_src__bindgen_ty_1 { } } #[inline] + pub fn mem_blk(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 3u8) as u64) } + } + #[inline] + pub fn set_mem_blk(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(40usize, 3u8, val as u64) + } + } + #[inline] + pub fn mem_hops(&self) -> __u64 { + unsafe { ::std::mem::transmute(self._bitfield_1.get(43usize, 3u8) as u64) } + } + #[inline] + pub fn set_mem_hops(&mut self, val: __u64) { + unsafe { + let val: u64 = ::std::mem::transmute(val); + self._bitfield_1.set(43usize, 3u8, val as u64) + } + } + #[inline] pub fn mem_rsvd(&self) -> __u64 { - unsafe { ::std::mem::transmute(self._bitfield_1.get(40usize, 24u8) as u64) } + unsafe { ::std::mem::transmute(self._bitfield_1.get(46usize, 18u8) as u64) } } #[inline] pub fn set_mem_rsvd(&mut self, val: __u64) { unsafe { let val: u64 = ::std::mem::transmute(val); - self._bitfield_1.set(40usize, 24u8, val as u64) + self._bitfield_1.set(46usize, 18u8, val as u64) } } #[inline] @@ -2630,10 +2856,11 @@ impl perf_mem_data_src__bindgen_ty_1 { mem_lvl_num: __u64, mem_remote: __u64, mem_snoopx: __u64, + mem_blk: __u64, + mem_hops: __u64, mem_rsvd: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize], u32> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u32> = - Default::default(); + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 5u8, { let mem_op: u64 = unsafe { ::std::mem::transmute(mem_op) }; mem_op as u64 @@ -2666,7 +2893,15 @@ impl perf_mem_data_src__bindgen_ty_1 { let mem_snoopx: u64 = unsafe { ::std::mem::transmute(mem_snoopx) }; mem_snoopx as u64 }); - __bindgen_bitfield_unit.set(40usize, 24u8, { + __bindgen_bitfield_unit.set(40usize, 3u8, { + let mem_blk: u64 = unsafe { ::std::mem::transmute(mem_blk) }; + mem_blk as u64 + }); + __bindgen_bitfield_unit.set(43usize, 3u8, { + let mem_hops: u64 = unsafe { ::std::mem::transmute(mem_hops) }; + mem_hops as u64 + }); + __bindgen_bitfield_unit.set(46usize, 18u8, { let mem_rsvd: u64 = unsafe { ::std::mem::transmute(mem_rsvd) }; mem_rsvd as u64 }); @@ -2698,7 +2933,11 @@ fn bindgen_test_layout_perf_mem_data_src() { } impl Default for perf_mem_data_src { fn default() -> Self { - unsafe { ::std::mem::zeroed() } + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } } } #[repr(C)] @@ -2706,7 +2945,8 @@ impl Default for perf_mem_data_src { pub struct perf_branch_entry { pub from: __u64, pub to: __u64, - pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize], u64>, + pub _bitfield_align_1: [u64; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 8usize]>, } #[test] fn bindgen_test_layout_perf_branch_entry() { @@ -2828,9 +3068,8 @@ impl perf_branch_entry { cycles: __u64, type_: __u64, reserved: __u64, - ) -> __BindgenBitfieldUnit<[u8; 8usize], u64> { - let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize], u64> = - Default::default(); + ) -> __BindgenBitfieldUnit<[u8; 8usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 8usize]> = Default::default(); __bindgen_bitfield_unit.set(0usize, 1u8, { let mispred: u64 = unsafe { ::std::mem::transmute(mispred) }; mispred as u64 @@ -2862,36 +3101,134 @@ impl perf_branch_entry { __bindgen_bitfield_unit } } -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 = u32; -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 = u32; -pub const bp_type_idx_TYPE_INST: bp_type_idx = 0; -pub const bp_type_idx_TYPE_DATA: bp_type_idx = 1; -pub const bp_type_idx_TYPE_MAX: bp_type_idx = 2; -pub type bp_type_idx = u32; -pub const perf_event_ioctls_ENABLE: perf_event_ioctls = 9216; -pub const perf_event_ioctls_DISABLE: perf_event_ioctls = 9217; -pub const perf_event_ioctls_REFRESH: perf_event_ioctls = 9218; -pub const perf_event_ioctls_RESET: perf_event_ioctls = 9219; -pub const perf_event_ioctls_PERIOD: perf_event_ioctls = 1074275332; -pub const perf_event_ioctls_SET_OUTPUT: perf_event_ioctls = 9221; -pub const perf_event_ioctls_SET_FILTER: perf_event_ioctls = 1074275334; -pub const perf_event_ioctls_ID: perf_event_ioctls = 2148017159; -pub const perf_event_ioctls_SET_BPF: perf_event_ioctls = 1074013192; -pub const perf_event_ioctls_PAUSE_OUTPUT: perf_event_ioctls = 1074013193; -pub const perf_event_ioctls_QUERY_BPF: perf_event_ioctls = 3221758986; -pub const perf_event_ioctls_MODIFY_ATTRIBUTES: perf_event_ioctls = 1074275339; -pub type perf_event_ioctls = u32; +#[repr(C)] +#[derive(Copy, Clone)] +pub union perf_sample_weight { + pub full: __u64, + pub __bindgen_anon_1: perf_sample_weight__bindgen_ty_1, +} +#[repr(C)] +#[derive(Debug, Default, Copy, Clone)] +pub struct perf_sample_weight__bindgen_ty_1 { + pub var1_dw: __u32, + pub var2_w: __u16, + pub var3_w: __u16, +} +#[test] +fn bindgen_test_layout_perf_sample_weight__bindgen_ty_1() { + assert_eq!( + ::std::mem::size_of::<perf_sample_weight__bindgen_ty_1>(), + 8usize, + concat!("Size of: ", stringify!(perf_sample_weight__bindgen_ty_1)) + ); + assert_eq!( + ::std::mem::align_of::<perf_sample_weight__bindgen_ty_1>(), + 4usize, + concat!( + "Alignment of ", + stringify!(perf_sample_weight__bindgen_ty_1) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<perf_sample_weight__bindgen_ty_1>())).var1_dw as *const _ + as usize + }, + 0usize, + concat!( + "Offset of field: ", + stringify!(perf_sample_weight__bindgen_ty_1), + "::", + stringify!(var1_dw) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<perf_sample_weight__bindgen_ty_1>())).var2_w as *const _ as usize + }, + 4usize, + concat!( + "Offset of field: ", + stringify!(perf_sample_weight__bindgen_ty_1), + "::", + stringify!(var2_w) + ) + ); + assert_eq!( + unsafe { + &(*(::std::ptr::null::<perf_sample_weight__bindgen_ty_1>())).var3_w as *const _ 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() { + assert_eq!( + ::std::mem::size_of::<perf_sample_weight>(), + 8usize, + concat!("Size of: ", stringify!(perf_sample_weight)) + ); + assert_eq!( + ::std::mem::align_of::<perf_sample_weight>(), + 8usize, + concat!("Alignment of ", stringify!(perf_sample_weight)) + ); + assert_eq!( + unsafe { &(*(::std::ptr::null::<perf_sample_weight>())).full as *const _ as usize }, + 0usize, + concat!( + "Offset of field: ", + stringify!(perf_sample_weight), + "::", + stringify!(full) + ) + ); +} +impl Default for perf_sample_weight { + fn default() -> Self { + let mut s = ::std::mem::MaybeUninit::<Self>::uninit(); + unsafe { + ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); + s.assume_init() + } + } +} +pub const HW_BREAKPOINT_LEN_1: ::std::os::raw::c_uint = 1; +pub const HW_BREAKPOINT_LEN_2: ::std::os::raw::c_uint = 2; +pub const HW_BREAKPOINT_LEN_3: ::std::os::raw::c_uint = 3; +pub const HW_BREAKPOINT_LEN_4: ::std::os::raw::c_uint = 4; +pub const HW_BREAKPOINT_LEN_5: ::std::os::raw::c_uint = 5; +pub const HW_BREAKPOINT_LEN_6: ::std::os::raw::c_uint = 6; +pub const HW_BREAKPOINT_LEN_7: ::std::os::raw::c_uint = 7; +pub const HW_BREAKPOINT_LEN_8: ::std::os::raw::c_uint = 8; +pub type _bindgen_ty_4 = ::std::os::raw::c_uint; +pub const HW_BREAKPOINT_EMPTY: ::std::os::raw::c_uint = 0; +pub const HW_BREAKPOINT_R: ::std::os::raw::c_uint = 1; +pub const HW_BREAKPOINT_W: ::std::os::raw::c_uint = 2; +pub const HW_BREAKPOINT_RW: ::std::os::raw::c_uint = 3; +pub const HW_BREAKPOINT_X: ::std::os::raw::c_uint = 4; +pub const HW_BREAKPOINT_INVALID: ::std::os::raw::c_uint = 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; +pub const ENABLE: perf_event_ioctls = 9216; +pub const DISABLE: perf_event_ioctls = 9217; +pub const REFRESH: perf_event_ioctls = 9218; +pub const RESET: perf_event_ioctls = 9219; +pub const PERIOD: perf_event_ioctls = 1074275332; +pub const SET_OUTPUT: perf_event_ioctls = 9221; +pub const SET_FILTER: perf_event_ioctls = 1074275334; +pub const ID: perf_event_ioctls = 2148017159; +pub const SET_BPF: perf_event_ioctls = 1074013192; +pub const PAUSE_OUTPUT: perf_event_ioctls = 1074013193; +pub const QUERY_BPF: perf_event_ioctls = 3221758986; +pub const MODIFY_ATTRIBUTES: perf_event_ioctls = 1074275339; +pub type perf_event_ioctls = ::std::os::raw::c_uint; diff --git a/vendor/perf-event-open-sys/src/lib.rs b/vendor/perf-event-open-sys/src/lib.rs index 314428045..d426dccfe 100644 --- a/vendor/perf-event-open-sys/src/lib.rs +++ b/vendor/perf-event-open-sys/src/lib.rs @@ -70,8 +70,8 @@ //! ## Kernel versions //! //! The bindings in this crate are generated from the Linux kernel headers -//! packaged by Fedora as `kernel-headers-5.6.11-100.fc30.x86_64`, which -//! corresponds to `PERF_EVENT_ATTR_SIZE_VER6`. +//! packaged by Fedora as `kernel-headers-5.18.4-200.fc36`, which +//! corresponds to `PERF_EVENT_ATTR_SIZE_VER7`. //! //! 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 @@ -106,7 +106,7 @@ //! headers should run on an older kernel, as long as it only requests features //! the old kernel actually supports. That is, simply compiling against newer //! headers should not be disqualifying - only using those new headers to -//! request features the running kernel can't provide should cause an error. +//! request new features the running kernel can't provide should cause an error. //! //! Consider the specific case of passing a struct like `perf_event_attr` to a //! system call like `perf_event_open`. In general, there are two versions of @@ -123,7 +123,7 @@ //! `request` value. //! //! - Fields are never deleted from structs. At most, newer kernel headers may -//! rename them to '__reserved_foo' or something like that, but once a field +//! rename them to `__reserved_foo` or something like that, but once a field //! has been placed, its layout in the struct never changes. //! //! - New fields are added to the end of structs. @@ -131,11 +131,11 @@ //! - New fields' semantics are chosen such that filling them with zeros //! preserves the old behavior. That is, turning an old struct into a new //! struct by extending it with zero bytes should always give you a new -//! struct with the same meaning the old struct had. +//! struct with the same meaning as the old struct. //! -//! Then, the kernel's strategy for receiving structs from userspace (explained -//! by the kernel comments for `copy_struct_from_user` in -//! `include/linux/uaccess.h`) is as follows: +//! Then, the kernel's strategy for receiving structs from userspace is as +//! follows (according to the comments for `copy_struct_from_user` in +//! the kernel source `include/linux/uaccess.h`): //! //! - If the kernel's struct is larger than the one passed from userspace, //! then that means the kernel is newer than the userspace program. The @@ -185,6 +185,12 @@ use std::os::raw::{c_int, c_ulong}; /// is too small or too large, the kernel writes the size it was expecing back /// into that field. It might do other things as well. /// +/// # Safety +/// +/// The `attrs` argument must point to a properly initialized +/// `perf_event_attr` struct. The measurements and other behaviors its +/// contents request must be safe. +/// /// [man]: http://man7.org/linux/man-pages/man2/perf_event_open.2.html pub unsafe fn perf_event_open( attrs: *mut bindings::perf_event_attr, @@ -225,6 +231,7 @@ pub mod ioctls { macro_rules! define_ioctl { ({ $name:ident, $ioctl:ident, $arg_type:ty }) => { + #[allow(clippy::missing_safety_doc)] pub unsafe fn $name(fd: c_int, arg: $arg_type) -> c_int { untyped_ioctl(fd, bindings::$ioctl, arg) } @@ -232,29 +239,25 @@ pub mod ioctls { } define_ioctls! { - { ENABLE, perf_event_ioctls_ENABLE, c_uint } - { DISABLE, perf_event_ioctls_DISABLE, c_uint } - { REFRESH, perf_event_ioctls_REFRESH, c_int } - { RESET, perf_event_ioctls_RESET, c_uint } - { PERIOD, perf_event_ioctls_PERIOD, u64 } - { SET_OUTPUT, perf_event_ioctls_SET_OUTPUT, c_int } - { SET_FILTER, perf_event_ioctls_SET_FILTER, *mut c_char } - { ID, perf_event_ioctls_ID, *mut u64 } - { SET_BPF, perf_event_ioctls_SET_BPF, u32 } - { PAUSE_OUTPUT, perf_event_ioctls_PAUSE_OUTPUT, u32 } - { QUERY_BPF, perf_event_ioctls_QUERY_BPF, *mut perf_event_query_bpf } - { MODIFY_ATTRIBUTES, perf_event_ioctls_MODIFY_ATTRIBUTES, *mut perf_event_attr } + { ENABLE, ENABLE, c_uint } + { DISABLE, DISABLE, c_uint } + { REFRESH, REFRESH, c_int } + { RESET, RESET, c_uint } + { PERIOD, PERIOD, u64 } + { SET_OUTPUT, SET_OUTPUT, c_int } + { SET_FILTER, SET_FILTER, *mut c_char } + { ID, ID, *mut u64 } + { SET_BPF, SET_BPF, u32 } + { PAUSE_OUTPUT, PAUSE_OUTPUT, u32 } + { QUERY_BPF, QUERY_BPF, *mut perf_event_query_bpf } + { MODIFY_ATTRIBUTES, MODIFY_ATTRIBUTES, *mut perf_event_attr } } - unsafe fn untyped_ioctl<A>( - fd: c_int, - ioctl: bindings::perf_event_ioctls, - arg: A, - ) -> c_int { - #[cfg(target_env = "musl")] + unsafe fn untyped_ioctl<A>(fd: c_int, ioctl: bindings::perf_event_ioctls, arg: A) -> c_int { + #[cfg(any(target_env = "musl", target_os = "android"))] return libc::ioctl(fd, ioctl as c_int, arg); - #[cfg(not(target_env = "musl"))] + #[cfg(not(any(target_env = "musl", target_os = "android")))] libc::ioctl(fd, ioctl as c_ulong, arg) } } |