Crates.io | perf-event-open-sys2 |
lib.rs | perf-event-open-sys2 |
version | 5.0.5 |
source | src |
created_at | 2023-04-20 06:26:43.772256 |
updated_at | 2024-05-30 08:48:26.201545 |
description | Unsafe, direct bindings for Linux's perf_event_open system call, with associated types and constants. |
homepage | |
repository | https://github.com/Phantomical/perf-event.git |
max_upload_size | |
id | 844127 |
size | 398,766 |
perf_event_open
system callThis crate exports unsafe
Rust wrappers for Linux system calls for accessing
performance monitoring counters and tracing facilities. This includes:
This crate provides:
perf_event_open
system callperf_event_open
perf_event_open
's associated header files, automatically generated by bindgen
All functions are direct, unsafe
wrappers for the underlying calls. They
operate on raw pointers and raw file descriptors.
For a type-safe API for basic functionality, see the perf-event2 crate.
Even though Windows and Mac don't have the perf_event_open
system
call, the perf_event_open_sys
crate still builds on those platforms:
the type definitions in the bindings
module can be useful to code
that needs to parse perf-related data produced on Linux or Android
systems. The syscall and ioctl wrapper functions are not available.
The bindings
module defines Rust equivalents for the types and constants used
by the Linux perf_event_open
system call and its related ioctls. These are
generated automatically from the kernel's C header files, using bindgen. Both
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 into the
bindings
module's source code, preserving the documentation.
If this resulted in any changes to the API, update the crate's major or minor version as appropriate. Most updates to the kernel headers will not actually affect the API at all, and even those that do may not require a new major version.
You can use cargo-semver-checks
in order to verify that the
resulting changes are semver-compatible.