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_attr

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

Fields

type: PERF.TYPE = undefined

Major type: hardware/software/tracepoint/etc.

size: u32 = @sizeOf(perf_event_attr)

Size of the attr structure, for fwd/bwd compat.

config: u64 = 0

Type specific configuration information.

sample_period_or_freq: u64 = 0
sample_type: u64 = 0
read_format: u64 = 0
flags: packed struct(u64) { /// off by default disabled: bool = false, /// children inherit it inherit: bool = false, /// must always be on PMU pinned: bool = false, /// only group on PMU exclusive: bool = false, /// don't count user exclude_user: bool = false, /// ditto kernel exclude_kernel: bool = false, /// ditto hypervisor exclude_hv: bool = false, /// don't count when idle exclude_idle: bool = false, /// include mmap data mmap: bool = false, /// include comm data comm: bool = false, /// use freq, not period freq: bool = false, /// per task counts inherit_stat: bool = false, /// next exec enables enable_on_exec: bool = false, /// trace fork/exit task: bool = false, /// wakeup_watermark watermark: bool = false, /// precise_ip: /// /// 0 - SAMPLE_IP can have arbitrary skid /// 1 - SAMPLE_IP must have constant skid /// 2 - SAMPLE_IP requested to have 0 skid /// 3 - SAMPLE_IP must have 0 skid /// /// See also PERF_RECORD_MISC_EXACT_IP /// skid constraint precise_ip: u2 = 0, /// non-exec mmap data mmap_data: bool = false, /// sample_type all events sample_id_all: bool = false, /// don't count in host exclude_host: bool = false, /// don't count in guest exclude_guest: bool = false, /// exclude kernel callchains exclude_callchain_kernel: bool = false, /// exclude user callchains exclude_callchain_user: bool = false, /// include mmap with inode data mmap2: bool = false, /// flag comm events that are due to an exec comm_exec: bool = false, /// use @clockid for time fields use_clockid: bool = false, /// context switch data context_switch: bool = false, /// Write ring buffer from end to beginning write_backward: bool = false, /// include namespaces data namespaces: bool = false, /// include ksymbol events ksymbol: bool = false, /// include BPF events bpf_event: bool = false, /// generate AUX records instead of events aux_output: bool = false, /// include cgroup events cgroup: bool = false, /// include text poke events text_poke: bool = false, /// use build ID in mmap2 events build_id: bool = false, /// children only inherit if cloned with CLONE_THREAD inherit_thread: bool = false, /// event is removed from task on exec remove_on_exec: bool = false, /// send synchronous SIGTRAP on event sigtrap: bool = false, __reserved_1: u26 = 0, } = .{}
wakeup_events_or_watermark: u32 = 0

wakeup every n events, or bytes before wakeup

bp_type: u32 = 0
config1: u64 = 0

This field is also used for: bp_addr kprobe_func for perf_kprobe uprobe_path for perf_uprobe

config2: u64 = 0

This field is also used for: bp_len kprobe_addr when kprobe_func == null probe_offset for perf_[k,u]probe

branch_sample_type: u64 = 0

enum perf_branch_sample_type

sample_regs_user: u64 = 0

Defines set of user regs to dump on samples. See asm/perf_regs.h for details.

sample_stack_user: u32 = 0

Defines size of the user stack to dump on samples.

clockid: clockid_t = .REALTIME
sample_regs_intr: u64 = 0

Defines set of regs to dump for each sample state captured on:

  • precise = 0: PMU interrupt
  • precise > 0: sampled instruction

See asm/perf_regs.h for details.

aux_watermark: u32 = 0

Wakeup watermark for AUX area

sample_max_stack: u16 = 0
__reserved_2: u16 = 0

Align to u64

aux_sample_size: u32 = 0
aux_action: packed struct(u32) { /// start AUX area tracing paused start_paused: bool = false, /// on overflow, pause AUX area tracing pause: bool = false, /// on overflow, resume AUX area tracing @"resume": bool = false, __reserved_3: u29 = 0, } = .{}
sig_data: u64 = 0

User provided data if sigtrap == true

config3: u64 = 0

Extension of config2

File

os/linux.zig:10296
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
pub const perf_event_attr = extern struct {
    /// Major type: hardware/software/tracepoint/etc.
    type: PERF.TYPE = undefined,
    /// Size of the attr structure, for fwd/bwd compat.
    size: u32 = @sizeOf(perf_event_attr),
    /// Type specific configuration information.
    config: u64 = 0,

    sample_period_or_freq: u64 = 0,
    sample_type: u64 = 0,
    read_format: u64 = 0,

    flags: packed struct(u64) {
        /// off by default
        disabled: bool = false,
        /// children inherit it
        inherit: bool = false,
        /// must always be on PMU
        pinned: bool = false,
        /// only group on PMU
        exclusive: bool = false,
        /// don't count user
        exclude_user: bool = false,
        /// ditto kernel
        exclude_kernel: bool = false,
        /// ditto hypervisor
        exclude_hv: bool = false,
        /// don't count when idle
        exclude_idle: bool = false,
        /// include mmap data
        mmap: bool = false,
        /// include comm data
        comm: bool = false,
        /// use freq, not period
        freq: bool = false,
        /// per task counts
        inherit_stat: bool = false,
        /// next exec enables
        enable_on_exec: bool = false,
        /// trace fork/exit
        task: bool = false,
        /// wakeup_watermark
        watermark: bool = false,
        /// precise_ip:
        ///
        ///  0 - SAMPLE_IP can have arbitrary skid
        ///  1 - SAMPLE_IP must have constant skid
        ///  2 - SAMPLE_IP requested to have 0 skid
        ///  3 - SAMPLE_IP must have 0 skid
        ///
        ///  See also PERF_RECORD_MISC_EXACT_IP
        /// skid constraint
        precise_ip: u2 = 0,
        /// non-exec mmap data
        mmap_data: bool = false,
        /// sample_type all events
        sample_id_all: bool = false,

        /// don't count in host
        exclude_host: bool = false,
        /// don't count in guest
        exclude_guest: bool = false,

        /// exclude kernel callchains
        exclude_callchain_kernel: bool = false,
        /// exclude user callchains
        exclude_callchain_user: bool = false,
        /// include mmap with inode data
        mmap2: bool = false,
        /// flag comm events that are due to an exec
        comm_exec: bool = false,
        /// use @clockid for time fields
        use_clockid: bool = false,
        /// context switch data
        context_switch: bool = false,
        /// Write ring buffer from end to beginning
        write_backward: bool = false,
        /// include namespaces data
        namespaces: bool = false,
        /// include ksymbol events
        ksymbol: bool = false,
        /// include BPF events
        bpf_event: bool = false,
        /// generate AUX records instead of events
        aux_output: bool = false,
        /// include cgroup events
        cgroup: bool = false,
        /// include text poke events
        text_poke: bool = false,
        /// use build ID in mmap2 events
        build_id: bool = false,
        /// children only inherit if cloned with CLONE_THREAD
        inherit_thread: bool = false,
        /// event is removed from task on exec
        remove_on_exec: bool = false,
        /// send synchronous SIGTRAP on event
        sigtrap: bool = false,

        __reserved_1: u26 = 0,
    } = .{},
    /// wakeup every n events, or
    /// bytes before wakeup
    wakeup_events_or_watermark: u32 = 0,

    bp_type: u32 = 0,

    /// This field is also used for:
    /// bp_addr
    /// kprobe_func for perf_kprobe
    /// uprobe_path for perf_uprobe
    config1: u64 = 0,
    /// This field is also used for:
    /// bp_len
    /// kprobe_addr when kprobe_func == null
    /// probe_offset for perf_[k,u]probe
    config2: u64 = 0,

    /// enum perf_branch_sample_type
    branch_sample_type: u64 = 0,

    /// Defines set of user regs to dump on samples.
    /// See asm/perf_regs.h for details.
    sample_regs_user: u64 = 0,

    /// Defines size of the user stack to dump on samples.
    sample_stack_user: u32 = 0,

    clockid: clockid_t = .REALTIME,
    /// Defines set of regs to dump for each sample
    /// state captured on:
    ///  - precise = 0: PMU interrupt
    ///  - precise > 0: sampled instruction
    ///
    /// See asm/perf_regs.h for details.
    sample_regs_intr: u64 = 0,

    /// Wakeup watermark for AUX area
    aux_watermark: u32 = 0,
    sample_max_stack: u16 = 0,
    /// Align to u64
    __reserved_2: u16 = 0,

    aux_sample_size: u32 = 0,
    aux_action: packed struct(u32) {
        /// start AUX area tracing paused
        start_paused: bool = false,
        /// on overflow, pause AUX area tracing
        pause: bool = false,
        /// on overflow, resume AUX area tracing
        @"resume": bool = false,

        __reserved_3: u29 = 0,
    } = .{},

    /// User provided data if sigtrap == true
    sig_data: u64 = 0,

    /// Extension of config2
    config3: u64 = 0,
}