summaryrefslogtreecommitdiffstats
path: root/vendor/perf-event-open-sys/RELEASE-NOTES.md
blob: f1222ec363a048653a9f9689d6589b1ff44e21bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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_