perf-event-open-sys
Unsafe, direct bindings for Linux's perf_event_open system call, with associated types and constants.
6.0.0
9.3M downloads/mo
#3229 most downloaded on crates.io
jimblandy/perf-event
What this package is like to depend on
Last release 6 months ago
12 Feb 2026
Release timing varies
gaps range from 9 days to 2.4 years
Some releases are documented
notes for 4 of 15 stable releases
Nothing withdrawn
no release was ever pulled
7 years old
15 releases · first in 2019
1 release in the last 12 months
see the full history below
Release timeline
15 releases · Dec 2019 to Feb 2026Releases
latest 15-
6.0.012 Feb 2026Release notes
Open source →-
All bindings have been regenerated from the headers for Linux v6.13.9.
-
The bindings no longer include a large number of types and constants that are not related to
perf_event_open.
-
-
5.0.004 Apr 2025Release notes
Open source →-
Regenerated
x86_64bindings from Fedora'skernel-headers-6.13.3-200.fc41.x86_64package. -
Added support for 64-bit RISCV (
riscv64).
-
-
4.0.007 Nov 2022Release notes
Open source →-
Regenerated
x86_64bindings from Fedora'skernel-headers-5.19.4-200.fc36.x86_64package. -
Added support for 64-bit ARM (
aarch64). -
The
perf_event_open_syscrate now builds on Windows and Mac. Although the system call and ioctl wrapper functions are not available, the types in thebindingsmodule are still provided for use by code on other platforms that would like to parse perf data produced on Linux or Android. -
Contrary to the documentation,
perf_event_opendoes seterrno. The documentation has been fixed.
-
-
3.0.004 Jul 2022Release notes
Open source →-
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
bindingsconstants 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
sedyour 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_
-
-
2.0.131 May 2022Nothing published for this version
-
2.0.031 May 2022Nothing published for this version
-
1.0.121 Aug 2020Nothing published for this version
-
1.0.018 Aug 2020Nothing published for this version
-
0.3.318 Aug 2020Nothing published for this version
-
0.3.211 Aug 2020Nothing published for this version
-
0.3.108 Jul 2020Nothing published for this version
-
0.3.021 Dec 2019Nothing published for this version
-
0.2.119 Dec 2019Nothing published for this version
-
0.2.019 Dec 2019Nothing published for this version
-
0.1.018 Dec 2019Nothing published for this version