core.sys.linux.perf_event

D header file for perf_event_open system call.

Converted from linux userspace header, comments included.

Members

Enums

PERF_BR_UNKNOWN
anonymousenum PERF_BR_UNKNOWN

Common flow change classification

PERF_TXN_ELISION
anonymousenum PERF_TXN_ELISION

Values for the memory transaction event qualifier, mostly for abort events. Multiple bits can be set.

perf_branch_sample_type
enum perf_branch_sample_type
perf_branch_sample_type_shift
enum perf_branch_sample_type_shift

values to program into branch_sample_type when PERF_SAMPLE_BRANCH is set

perf_callchain_context
enum perf_callchain_context
perf_event_ioc_flags
enum perf_event_ioc_flags
perf_event_read_format
enum perf_event_read_format

The format of the data returned by read() on a perf event fd, as specified by attr.read_format:

perf_event_sample_format
enum perf_event_sample_format

Bits that can be set in attr.sample_type to request information in the overflow packets.

perf_event_type
enum perf_event_type
perf_hw_cache_id
enum perf_hw_cache_id

Generalized hardware cache events:

perf_hw_cache_op_id
enum perf_hw_cache_op_id
perf_hw_cache_op_result_id
enum perf_hw_cache_op_result_id
perf_hw_id
enum perf_hw_id

Generalized performance event event_id types, used by the attr.event_id parameter of the sys_perf_event_open() syscall:

perf_sample_regs_abi
enum perf_sample_regs_abi

Values to determine ABI of the registers dump.

perf_sw_ids
enum perf_sw_ids

Special "software" events provided by the kernel, even if the hardware does not support performance events. These events measure various physical and sw events of the kernel (and allow the profiling of them as well):

perf_type_id
enum perf_type_id

attr.type

Functions

perf_flags
auto perf_flags(T attr)

Manifest constants

PERF_ATTR_SIZE_VER0
enum PERF_ATTR_SIZE_VER0;

sizeof first published struct

PERF_ATTR_SIZE_VER1
enum PERF_ATTR_SIZE_VER1;

add: config2

PERF_ATTR_SIZE_VER2
enum PERF_ATTR_SIZE_VER2;

add: branch_sample_type

PERF_ATTR_SIZE_VER3
enum PERF_ATTR_SIZE_VER3;

add: sample_regs_user

PERF_ATTR_SIZE_VER4
enum PERF_ATTR_SIZE_VER4;

add: sample_regs_intr

PERF_ATTR_SIZE_VER5
enum PERF_ATTR_SIZE_VER5;

add: aux_watermark

PERF_AUX_FLAG_COLLISION
enum PERF_AUX_FLAG_COLLISION;

sample collided with another

PERF_AUX_FLAG_OVERWRITE
enum PERF_AUX_FLAG_OVERWRITE;

snapshot from overwrite mode

PERF_AUX_FLAG_PARTIAL
enum PERF_AUX_FLAG_PARTIAL;

record contains gaps

PERF_AUX_FLAG_TRUNCATED
enum PERF_AUX_FLAG_TRUNCATED;

* PERF_RECORD_AUX::flags bits *//** record was truncated to fit

PERF_EVENT_IOC_DISABLE
enum PERF_EVENT_IOC_DISABLE;
PERF_EVENT_IOC_ENABLE
enum PERF_EVENT_IOC_ENABLE;

Ioctls that can be done on a perf event fd:

PERF_EVENT_IOC_ID
enum PERF_EVENT_IOC_ID;
PERF_EVENT_IOC_PAUSE_OUTPUT
enum PERF_EVENT_IOC_PAUSE_OUTPUT;
PERF_EVENT_IOC_PERIOD
enum PERF_EVENT_IOC_PERIOD;
PERF_EVENT_IOC_REFRESH
enum PERF_EVENT_IOC_REFRESH;
PERF_EVENT_IOC_RESET
enum PERF_EVENT_IOC_RESET;
PERF_EVENT_IOC_SET_BPF
enum PERF_EVENT_IOC_SET_BPF;
PERF_EVENT_IOC_SET_FILTER
enum PERF_EVENT_IOC_SET_FILTER;
PERF_EVENT_IOC_SET_OUTPUT
enum PERF_EVENT_IOC_SET_OUTPUT;
PERF_FLAG_FD_CLOEXEC
enum PERF_FLAG_FD_CLOEXEC;

O_CLOEXEC

PERF_FLAG_FD_NO_GROUP
enum PERF_FLAG_FD_NO_GROUP;
PERF_FLAG_FD_OUTPUT
enum PERF_FLAG_FD_OUTPUT;
PERF_FLAG_PID_CGROUP
enum PERF_FLAG_PID_CGROUP;

pid=cgroup id, per-cpu mode only

PERF_MAX_CONTEXTS_PER_STACK
enum PERF_MAX_CONTEXTS_PER_STACK;
PERF_MAX_STACK_DEPTH
enum PERF_MAX_STACK_DEPTH;
PERF_MEM_LOCK_LOCKED
enum PERF_MEM_LOCK_LOCKED;

locked transaction

PERF_MEM_LOCK_NA
enum PERF_MEM_LOCK_NA;

locked instruction *//** not available

PERF_MEM_LOCK_SHIFT
enum PERF_MEM_LOCK_SHIFT;
PERF_MEM_LVLNUM_ANY_CACHE
enum PERF_MEM_LVLNUM_ANY_CACHE;

Any cache

PERF_MEM_LVLNUM_L1
enum PERF_MEM_LVLNUM_L1;

L1

PERF_MEM_LVLNUM_L2
enum PERF_MEM_LVLNUM_L2;

L2

PERF_MEM_LVLNUM_L3
enum PERF_MEM_LVLNUM_L3;

L3

PERF_MEM_LVLNUM_L4
enum PERF_MEM_LVLNUM_L4;

L4

PERF_MEM_LVLNUM_LFB
enum PERF_MEM_LVLNUM_LFB;

LFB

PERF_MEM_LVLNUM_NA
enum PERF_MEM_LVLNUM_NA;

N/A

PERF_MEM_LVLNUM_PMEM
enum PERF_MEM_LVLNUM_PMEM;

PMEM

PERF_MEM_LVLNUM_RAM
enum PERF_MEM_LVLNUM_RAM;

RAM

PERF_MEM_LVLNUM_SHIFT
enum PERF_MEM_LVLNUM_SHIFT;
PERF_MEM_LVL_HIT
enum PERF_MEM_LVL_HIT;

hit level

PERF_MEM_LVL_IO
enum PERF_MEM_LVL_IO;

I/O memory

PERF_MEM_LVL_L1
enum PERF_MEM_LVL_L1;

L1

PERF_MEM_LVL_L2
enum PERF_MEM_LVL_L2;

L2

PERF_MEM_LVL_L3
enum PERF_MEM_LVL_L3;

L3

PERF_MEM_LVL_LFB
enum PERF_MEM_LVL_LFB;

Line Fill Buffer

PERF_MEM_LVL_LOC_RAM
enum PERF_MEM_LVL_LOC_RAM;

Local DRAM

PERF_MEM_LVL_MISS
enum PERF_MEM_LVL_MISS;

miss level

PERF_MEM_LVL_NA
enum PERF_MEM_LVL_NA;

not available

PERF_MEM_LVL_REM_CCE1
enum PERF_MEM_LVL_REM_CCE1;

Remote Cache (1 hop)

PERF_MEM_LVL_REM_CCE2
enum PERF_MEM_LVL_REM_CCE2;

Remote Cache (2 hops)

PERF_MEM_LVL_REM_RAM1
enum PERF_MEM_LVL_REM_RAM1;

Remote DRAM (1 hop)

PERF_MEM_LVL_REM_RAM2
enum PERF_MEM_LVL_REM_RAM2;

Remote DRAM (2 hops)

PERF_MEM_LVL_SHIFT
enum PERF_MEM_LVL_SHIFT;
PERF_MEM_LVL_UNC
enum PERF_MEM_LVL_UNC;

Uncached memory

PERF_MEM_OP_EXEC
enum PERF_MEM_OP_EXEC;

code (execution)

PERF_MEM_OP_LOAD
enum PERF_MEM_OP_LOAD;

load instruction

PERF_MEM_OP_NA
enum PERF_MEM_OP_NA;

type of opcode (load/store/prefetch,code) *//** not available

PERF_MEM_OP_PFETCH
enum PERF_MEM_OP_PFETCH;

prefetch

PERF_MEM_OP_STORE
enum PERF_MEM_OP_STORE;

store instruction

PERF_MEM_REMOTE_REMOTE
enum PERF_MEM_REMOTE_REMOTE;

Remote

PERF_MEM_REMOTE_SHIFT
enum PERF_MEM_REMOTE_SHIFT;
PERF_MEM_SNOOPX_FWD
enum PERF_MEM_SNOOPX_FWD;

forward

PERF_MEM_SNOOPX_SHIFT
enum PERF_MEM_SNOOPX_SHIFT;

1 free

PERF_MEM_SNOOP_HIT
enum PERF_MEM_SNOOP_HIT;

snoop hit

PERF_MEM_SNOOP_HITM
enum PERF_MEM_SNOOP_HITM;

snoop hit modified

PERF_MEM_SNOOP_MISS
enum PERF_MEM_SNOOP_MISS;

snoop miss

PERF_MEM_SNOOP_NA
enum PERF_MEM_SNOOP_NA;

not available

PERF_MEM_SNOOP_NONE
enum PERF_MEM_SNOOP_NONE;

no snoop

PERF_MEM_SNOOP_SHIFT
enum PERF_MEM_SNOOP_SHIFT;
PERF_MEM_TLB_HIT
enum PERF_MEM_TLB_HIT;

hit level

PERF_MEM_TLB_L1
enum PERF_MEM_TLB_L1;

L1

PERF_MEM_TLB_L2
enum PERF_MEM_TLB_L2;

L2

PERF_MEM_TLB_MISS
enum PERF_MEM_TLB_MISS;

miss level

PERF_MEM_TLB_NA
enum PERF_MEM_TLB_NA;

not available

PERF_MEM_TLB_OS
enum PERF_MEM_TLB_OS;

OS fault handler

PERF_MEM_TLB_SHIFT
enum PERF_MEM_TLB_SHIFT;
PERF_MEM_TLB_WK
enum PERF_MEM_TLB_WK;

Hardware Walker

PERF_RECORD_MISC_COMM_EXEC
enum PERF_RECORD_MISC_COMM_EXEC;
PERF_RECORD_MISC_CPUMODE_MASK
enum PERF_RECORD_MISC_CPUMODE_MASK;
PERF_RECORD_MISC_CPUMODE_UNKNOWN
enum PERF_RECORD_MISC_CPUMODE_UNKNOWN;
PERF_RECORD_MISC_EXACT_IP
enum PERF_RECORD_MISC_EXACT_IP;

Indicates that the content of PERF_SAMPLE_IP points to the actual instruction that triggered the event. See also

PERF_RECORD_MISC_EXT_RESERVED
enum PERF_RECORD_MISC_EXT_RESERVED;

Reserve the last bit to indicate some extended misc field

PERF_RECORD_MISC_GUEST_KERNEL
enum PERF_RECORD_MISC_GUEST_KERNEL;
PERF_RECORD_MISC_GUEST_USER
enum PERF_RECORD_MISC_GUEST_USER;
PERF_RECORD_MISC_HYPERVISOR
enum PERF_RECORD_MISC_HYPERVISOR;
PERF_RECORD_MISC_KERNEL
enum PERF_RECORD_MISC_KERNEL;
PERF_RECORD_MISC_MMAP_DATA
enum PERF_RECORD_MISC_MMAP_DATA;

PERF_RECORD_MISC_MMAP_DATA and PERF_RECORD_MISC_COMM_EXEC are used on different events so can reuse the same bit position. Ditto PERF_RECORD_MISC_SWITCH_OUT.

PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT
enum PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT;

Indicates that /proc/PID/maps parsing are truncated by time out.

PERF_RECORD_MISC_SWITCH_OUT
enum PERF_RECORD_MISC_SWITCH_OUT;
PERF_RECORD_MISC_USER
enum PERF_RECORD_MISC_USER;
PERF_SAMPLE_BRANCH_PLM_ALL
enum PERF_SAMPLE_BRANCH_PLM_ALL;

Structs

perf_branch_entry
struct perf_branch_entry

single taken branch record layout:

perf_event_attr
struct perf_event_attr

Hardware event_id to monitor via a performance monitoring event:

perf_event_header
struct perf_event_header
perf_event_mmap_page
struct perf_event_mmap_page

Structure of the page that can be mapped via mmap

perf_ns_link_info
struct perf_ns_link_info

Unions

perf_mem_data_src
union perf_mem_data_src
perf_mem_data_src
union perf_mem_data_src

Meta

Authors

Max Haughton