Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

perf_event_mmap_page

Public Struct
std.os.linux.perf_event_mmap_page
pub const perf_event_mmap_page = extern struct

Fields

version: u32

Version number of this struct

compt_version: u32

Lowest version this is compatible with

lock: u32

Seqlock for synchronization

index: u32

Hardware counter identifier

offset: i64

Add to hardware counter value

time_enabled: u64

Time the event was active

time_running: u64

Time the event was running

capabilities: packed struct(u64) { /// If kernel version < 3.12 /// this rapresents both user_rdpmc and user_time (user_rdpmc | user_time) /// otherwise deprecated. bit0: bool, /// Set if bit0 is deprecated bit0_is_deprecated: bool, /// Hardware support for userspace read of performance counters user_rdpmc: bool, /// Hardware support for a constant non stop timestamp counter (Eg. TSC on x86) user_time: bool, /// The time_zero field is used user_time_zero: bool, /// The time_{cycle,mask} fields are used user_time_short: bool, ____res: u58, }
pcm_width: u16

If capabilities.user_rdpmc this field reports the bit-width of the value read with rdpmc() or equivalent

time_shift: u16

If capabilities.user_time the following fields can be used to compute the time delta since time_enabled (in ns) using RDTSC or similar

time_mult: u32
time_offset: u64
time_zero: u64

If capabilities.user_time_zero the hardware clock can be calculated from sample timestamps

size: u32

Header size

__reserved_1: u32
time_cycles: u64

The following fields are used to compute the timestamp when the hardware clock is less than 64bit wide

time_mask: u64
__reserved: [116 * 8]u8
data_head: u64

Head in the data section

data_tail: u64

Userspace written tail

data_offset: u64

Where the buffer starts

data_size: u64

Data buffer size

aux_head: u64

if aux is used, head in the data section

aux_tail: u64

if aux is used, userspace written tail

aux_offset: u64

if aux is used, where the buffer starts

aux_size: u64

if aux is used, data buffer size

File

os/linux.zig:10482
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
pub const perf_event_mmap_page = extern struct {
    /// Version number of this struct
    version: u32,
    /// Lowest version this is compatible with
    compt_version: u32,
    /// Seqlock for synchronization
    lock: u32,
    /// Hardware counter identifier
    index: u32,
    /// Add to hardware counter value
    offset: i64,
    /// Time the event was active
    time_enabled: u64,
    /// Time the event was running
    time_running: u64,
    capabilities: packed struct(u64) {
        /// If kernel version < 3.12
        /// this rapresents both user_rdpmc and user_time (user_rdpmc | user_time)
        /// otherwise deprecated.
        bit0: bool,
        /// Set if bit0 is deprecated
        bit0_is_deprecated: bool,
        /// Hardware support for userspace read of performance counters
        user_rdpmc: bool,
        /// Hardware support for a constant non stop timestamp counter (Eg. TSC on x86)
        user_time: bool,
        /// The time_zero field is used
        user_time_zero: bool,
        /// The time_{cycle,mask} fields are used
        user_time_short: bool,
        ____res: u58,
    },
    /// If capabilities.user_rdpmc
    /// this field reports the bit-width of the value read with rdpmc() or equivalent
    pcm_width: u16,
    /// If capabilities.user_time the following fields can be used to compute the time
    /// delta since time_enabled (in ns) using RDTSC or similar
    time_shift: u16,
    time_mult: u32,
    time_offset: u64,
    /// If capabilities.user_time_zero the hardware clock can be calculated from
    /// sample timestamps
    time_zero: u64,
    /// Header size
    size: u32,
    __reserved_1: u32,
    /// The following fields are used to compute the timestamp when the hardware clock
    /// is less than 64bit wide
    time_cycles: u64,
    time_mask: u64,
    __reserved: [116 * 8]u8,
    /// Head in the data section
    data_head: u64,
    /// Userspace written tail
    data_tail: u64,
    /// Where the buffer starts
    data_offset: u64,
    /// Data buffer size
    data_size: u64,
    // if aux is used, head in the data section
    aux_head: u64,
    // if aux is used, userspace written tail
    aux_tail: u64,
    // if aux is used, where the buffer starts
    aux_offset: u64,
    // if aux is used, data buffer size
    aux_size: u64,
}