blob: ccefa74ce6a62e276e1835cd047a3142903c55b0 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_PERF_EVENT_H
20#define _UAPI_LINUX_PERF_EVENT_H
21#include <linux/types.h>
22#include <linux/ioctl.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#include <asm/byteorder.h>
25enum perf_type_id {
Tao Baod7db5942015-01-28 10:07:51 -080026 PERF_TYPE_HARDWARE = 0,
27 PERF_TYPE_SOFTWARE = 1,
Ben Cheng655a7c02013-10-16 16:09:24 -070028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029 PERF_TYPE_TRACEPOINT = 2,
30 PERF_TYPE_HW_CACHE = 3,
31 PERF_TYPE_RAW = 4,
32 PERF_TYPE_BREAKPOINT = 5,
Ben Cheng655a7c02013-10-16 16:09:24 -070033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080034 PERF_TYPE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070035};
36enum perf_hw_id {
Tao Baod7db5942015-01-28 10:07:51 -080037 PERF_COUNT_HW_CPU_CYCLES = 0,
Ben Cheng655a7c02013-10-16 16:09:24 -070038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080039 PERF_COUNT_HW_INSTRUCTIONS = 1,
40 PERF_COUNT_HW_CACHE_REFERENCES = 2,
41 PERF_COUNT_HW_CACHE_MISSES = 3,
42 PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4,
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044 PERF_COUNT_HW_BRANCH_MISSES = 5,
45 PERF_COUNT_HW_BUS_CYCLES = 6,
46 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7,
47 PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8,
Ben Cheng655a7c02013-10-16 16:09:24 -070048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 PERF_COUNT_HW_REF_CPU_CYCLES = 9,
50 PERF_COUNT_HW_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070051};
52enum perf_hw_cache_id {
53/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 PERF_COUNT_HW_CACHE_L1D = 0,
55 PERF_COUNT_HW_CACHE_L1I = 1,
56 PERF_COUNT_HW_CACHE_LL = 2,
57 PERF_COUNT_HW_CACHE_DTLB = 3,
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080059 PERF_COUNT_HW_CACHE_ITLB = 4,
60 PERF_COUNT_HW_CACHE_BPU = 5,
61 PERF_COUNT_HW_CACHE_NODE = 6,
62 PERF_COUNT_HW_CACHE_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64};
65enum perf_hw_cache_op_id {
Tao Baod7db5942015-01-28 10:07:51 -080066 PERF_COUNT_HW_CACHE_OP_READ = 0,
67 PERF_COUNT_HW_CACHE_OP_WRITE = 1,
Ben Cheng655a7c02013-10-16 16:09:24 -070068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080069 PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,
70 PERF_COUNT_HW_CACHE_OP_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070071};
72enum perf_hw_cache_op_result_id {
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080074 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
75 PERF_COUNT_HW_CACHE_RESULT_MISS = 1,
76 PERF_COUNT_HW_CACHE_RESULT_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070077};
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79enum perf_sw_ids {
Tao Baod7db5942015-01-28 10:07:51 -080080 PERF_COUNT_SW_CPU_CLOCK = 0,
81 PERF_COUNT_SW_TASK_CLOCK = 1,
82 PERF_COUNT_SW_PAGE_FAULTS = 2,
Ben Cheng655a7c02013-10-16 16:09:24 -070083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080084 PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
85 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
86 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
87 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
Ben Cheng655a7c02013-10-16 16:09:24 -070088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080089 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
90 PERF_COUNT_SW_EMULATION_FAULTS = 8,
91 PERF_COUNT_SW_DUMMY = 9,
92 PERF_COUNT_SW_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris38062f92014-07-09 15:33:25 -070094};
Ben Cheng655a7c02013-10-16 16:09:24 -070095enum perf_event_sample_format {
Tao Baod7db5942015-01-28 10:07:51 -080096 PERF_SAMPLE_IP = 1U << 0,
97 PERF_SAMPLE_TID = 1U << 1,
Ben Cheng655a7c02013-10-16 16:09:24 -070098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 PERF_SAMPLE_TIME = 1U << 2,
100 PERF_SAMPLE_ADDR = 1U << 3,
101 PERF_SAMPLE_READ = 1U << 4,
102 PERF_SAMPLE_CALLCHAIN = 1U << 5,
Ben Cheng655a7c02013-10-16 16:09:24 -0700103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 PERF_SAMPLE_ID = 1U << 6,
105 PERF_SAMPLE_CPU = 1U << 7,
106 PERF_SAMPLE_PERIOD = 1U << 8,
107 PERF_SAMPLE_STREAM_ID = 1U << 9,
Ben Cheng655a7c02013-10-16 16:09:24 -0700108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 PERF_SAMPLE_RAW = 1U << 10,
110 PERF_SAMPLE_BRANCH_STACK = 1U << 11,
111 PERF_SAMPLE_REGS_USER = 1U << 12,
112 PERF_SAMPLE_STACK_USER = 1U << 13,
Ben Cheng655a7c02013-10-16 16:09:24 -0700113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 PERF_SAMPLE_WEIGHT = 1U << 14,
115 PERF_SAMPLE_DATA_SRC = 1U << 15,
116 PERF_SAMPLE_IDENTIFIER = 1U << 16,
117 PERF_SAMPLE_TRANSACTION = 1U << 17,
Christopher Ferris38062f92014-07-09 15:33:25 -0700118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800119 PERF_SAMPLE_MAX = 1U << 18,
Ben Cheng655a7c02013-10-16 16:09:24 -0700120};
121enum perf_branch_sample_type {
Tao Baod7db5942015-01-28 10:07:51 -0800122 PERF_SAMPLE_BRANCH_USER = 1U << 0,
Christopher Ferris38062f92014-07-09 15:33:25 -0700123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800124 PERF_SAMPLE_BRANCH_KERNEL = 1U << 1,
125 PERF_SAMPLE_BRANCH_HV = 1U << 2,
126 PERF_SAMPLE_BRANCH_ANY = 1U << 3,
127 PERF_SAMPLE_BRANCH_ANY_CALL = 1U << 4,
Christopher Ferris38062f92014-07-09 15:33:25 -0700128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800129 PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << 5,
130 PERF_SAMPLE_BRANCH_IND_CALL = 1U << 6,
131 PERF_SAMPLE_BRANCH_ABORT_TX = 1U << 7,
132 PERF_SAMPLE_BRANCH_IN_TX = 1U << 8,
Ben Cheng655a7c02013-10-16 16:09:24 -0700133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800134 PERF_SAMPLE_BRANCH_NO_TX = 1U << 9,
135 PERF_SAMPLE_BRANCH_COND = 1U << 10,
136 PERF_SAMPLE_BRANCH_MAX = 1U << 11,
Ben Cheng655a7c02013-10-16 16:09:24 -0700137};
Christopher Ferris38062f92014-07-09 15:33:25 -0700138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800139#define PERF_SAMPLE_BRANCH_PLM_ALL (PERF_SAMPLE_BRANCH_USER | PERF_SAMPLE_BRANCH_KERNEL | PERF_SAMPLE_BRANCH_HV)
Ben Cheng655a7c02013-10-16 16:09:24 -0700140enum perf_sample_regs_abi {
Tao Baod7db5942015-01-28 10:07:51 -0800141 PERF_SAMPLE_REGS_ABI_NONE = 0,
142 PERF_SAMPLE_REGS_ABI_32 = 1,
Christopher Ferris38062f92014-07-09 15:33:25 -0700143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800144 PERF_SAMPLE_REGS_ABI_64 = 2,
Christopher Ferris38062f92014-07-09 15:33:25 -0700145};
146enum {
Tao Baod7db5942015-01-28 10:07:51 -0800147 PERF_TXN_ELISION = (1 << 0),
Christopher Ferris38062f92014-07-09 15:33:25 -0700148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800149 PERF_TXN_TRANSACTION = (1 << 1),
150 PERF_TXN_SYNC = (1 << 2),
151 PERF_TXN_ASYNC = (1 << 3),
152 PERF_TXN_RETRY = (1 << 4),
Christopher Ferris38062f92014-07-09 15:33:25 -0700153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154 PERF_TXN_CONFLICT = (1 << 5),
155 PERF_TXN_CAPACITY_WRITE = (1 << 6),
156 PERF_TXN_CAPACITY_READ = (1 << 7),
157 PERF_TXN_MAX = (1 << 8),
Christopher Ferris38062f92014-07-09 15:33:25 -0700158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800159 PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
160 PERF_TXN_ABORT_SHIFT = 32,
Ben Cheng655a7c02013-10-16 16:09:24 -0700161};
162enum perf_event_read_format {
Christopher Ferris38062f92014-07-09 15:33:25 -0700163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
165 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
166 PERF_FORMAT_ID = 1U << 2,
167 PERF_FORMAT_GROUP = 1U << 3,
Christopher Ferris38062f92014-07-09 15:33:25 -0700168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800169 PERF_FORMAT_MAX = 1U << 4,
Ben Cheng655a7c02013-10-16 16:09:24 -0700170};
171#define PERF_ATTR_SIZE_VER0 64
172#define PERF_ATTR_SIZE_VER1 72
Christopher Ferris38062f92014-07-09 15:33:25 -0700173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700174#define PERF_ATTR_SIZE_VER2 80
Ben Cheng655a7c02013-10-16 16:09:24 -0700175#define PERF_ATTR_SIZE_VER3 96
176struct perf_event_attr {
Tao Baod7db5942015-01-28 10:07:51 -0800177 __u32 type;
Christopher Ferris38062f92014-07-09 15:33:25 -0700178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800179 __u32 size;
180 __u64 config;
181 union {
182 __u64 sample_period;
Christopher Ferris38062f92014-07-09 15:33:25 -0700183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 __u64 sample_freq;
185 };
186 __u64 sample_type;
187 __u64 read_format;
Christopher Ferris38062f92014-07-09 15:33:25 -0700188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800189 __u64 disabled : 1, inherit : 1, pinned : 1, exclusive : 1, exclude_user : 1, exclude_kernel : 1, exclude_hv : 1, exclude_idle : 1, mmap : 1, comm : 1, freq : 1, inherit_stat : 1, enable_on_exec : 1, task : 1, watermark : 1, precise_ip : 2, mmap_data : 1, sample_id_all : 1, exclude_host : 1, exclude_guest : 1, exclude_callchain_kernel : 1, exclude_callchain_user : 1, mmap2 : 1, comm_exec : 1, __reserved_1 : 39;
190 union {
191 __u32 wakeup_events;
192 __u32 wakeup_watermark;
Christopher Ferris38062f92014-07-09 15:33:25 -0700193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800194 };
195 __u32 bp_type;
196 union {
197 __u64 bp_addr;
Christopher Ferris38062f92014-07-09 15:33:25 -0700198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800199 __u64 config1;
200 };
201 union {
202 __u64 bp_len;
Christopher Ferris38062f92014-07-09 15:33:25 -0700203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800204 __u64 config2;
205 };
206 __u64 branch_sample_type;
207 __u64 sample_regs_user;
Christopher Ferris38062f92014-07-09 15:33:25 -0700208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800209 __u32 sample_stack_user;
210 __u32 __reserved_2;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800211};
Tao Baod7db5942015-01-28 10:07:51 -0800212#define perf_flags(attr) (* (& (attr)->read_format + 1))
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800214#define PERF_EVENT_IOC_ENABLE _IO('$', 0)
215#define PERF_EVENT_IOC_DISABLE _IO('$', 1)
216#define PERF_EVENT_IOC_REFRESH _IO('$', 2)
217#define PERF_EVENT_IOC_RESET _IO('$', 3)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700219#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
Tao Baod7db5942015-01-28 10:07:51 -0800220#define PERF_EVENT_IOC_SET_OUTPUT _IO('$', 5)
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800221#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
Christopher Ferris38062f92014-07-09 15:33:25 -0700222#define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700224enum perf_event_ioc_flags {
Tao Baod7db5942015-01-28 10:07:51 -0800225 PERF_IOC_FLAG_GROUP = 1U << 0,
Christopher Ferris38062f92014-07-09 15:33:25 -0700226};
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800227struct perf_event_mmap_page {
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800229 __u32 version;
230 __u32 compat_version;
231 __u32 lock;
232 __u32 index;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800234 __s64 offset;
235 __u64 time_enabled;
236 __u64 time_running;
237 union {
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700238/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800239 __u64 capabilities;
240 struct {
241 __u64 cap_bit0 : 1, cap_bit0_is_deprecated : 1, cap_user_rdpmc : 1, cap_user_time : 1, cap_user_time_zero : 1, cap_____res : 59;
242 };
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700243/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800244 };
245 __u16 pmc_width;
246 __u16 time_shift;
247 __u32 time_mult;
Christopher Ferris38062f92014-07-09 15:33:25 -0700248/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800249 __u64 time_offset;
250 __u64 time_zero;
251 __u32 size;
252 __u8 __reserved[118 * 8 + 4];
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700253/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800254 __u64 data_head;
255 __u64 data_tail;
Ben Cheng655a7c02013-10-16 16:09:24 -0700256};
257#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800258/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700259#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800260#define PERF_RECORD_MISC_KERNEL (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700261#define PERF_RECORD_MISC_USER (2 << 0)
262#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
Tao Baod7db5942015-01-28 10:07:51 -0800263/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700264#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800265#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700266#define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700267#define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
Tao Baod7db5942015-01-28 10:07:51 -0800268/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700269#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
270#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800271struct perf_event_header {
Tao Baod7db5942015-01-28 10:07:51 -0800272 __u32 type;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700273/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800274 __u16 misc;
275 __u16 size;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800276};
Ben Cheng655a7c02013-10-16 16:09:24 -0700277enum perf_event_type {
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700278/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800279 PERF_RECORD_MMAP = 1,
280 PERF_RECORD_LOST = 2,
281 PERF_RECORD_COMM = 3,
282 PERF_RECORD_EXIT = 4,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700283/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800284 PERF_RECORD_THROTTLE = 5,
285 PERF_RECORD_UNTHROTTLE = 6,
286 PERF_RECORD_FORK = 7,
287 PERF_RECORD_READ = 8,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700288/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800289 PERF_RECORD_SAMPLE = 9,
290 PERF_RECORD_MMAP2 = 10,
291 PERF_RECORD_MAX,
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800292};
Tao Baod7db5942015-01-28 10:07:51 -0800293/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700294#define PERF_MAX_STACK_DEPTH 127
295enum perf_callchain_context {
Tao Baod7db5942015-01-28 10:07:51 -0800296 PERF_CONTEXT_HV = (__u64) - 32,
297 PERF_CONTEXT_KERNEL = (__u64) - 128,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700298/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800299 PERF_CONTEXT_USER = (__u64) - 512,
300 PERF_CONTEXT_GUEST = (__u64) - 2048,
301 PERF_CONTEXT_GUEST_KERNEL = (__u64) - 2176,
302 PERF_CONTEXT_GUEST_USER = (__u64) - 2560,
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700303/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800304 PERF_CONTEXT_MAX = (__u64) - 4095,
Ben Cheng655a7c02013-10-16 16:09:24 -0700305};
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700306#define PERF_FLAG_FD_NO_GROUP (1UL << 0)
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700307#define PERF_FLAG_FD_OUTPUT (1UL << 1)
Tao Baod7db5942015-01-28 10:07:51 -0800308/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700309#define PERF_FLAG_PID_CGROUP (1UL << 2)
310#define PERF_FLAG_FD_CLOEXEC (1UL << 3)
Ben Cheng655a7c02013-10-16 16:09:24 -0700311union perf_mem_data_src {
Tao Baod7db5942015-01-28 10:07:51 -0800312 __u64 val;
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700313/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800314 struct {
315 __u64 mem_op : 5, mem_lvl : 14, mem_snoop : 5, mem_lock : 2, mem_dtlb : 7, mem_rsvd : 31;
316 };
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800317};
Tao Baod7db5942015-01-28 10:07:51 -0800318/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700319#define PERF_MEM_OP_NA 0x01
320#define PERF_MEM_OP_LOAD 0x02
321#define PERF_MEM_OP_STORE 0x04
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800322#define PERF_MEM_OP_PFETCH 0x08
Tao Baod7db5942015-01-28 10:07:51 -0800323/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700324#define PERF_MEM_OP_EXEC 0x10
325#define PERF_MEM_OP_SHIFT 0
326#define PERF_MEM_LVL_NA 0x01
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800327#define PERF_MEM_LVL_HIT 0x02
Tao Baod7db5942015-01-28 10:07:51 -0800328/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700329#define PERF_MEM_LVL_MISS 0x04
330#define PERF_MEM_LVL_L1 0x08
331#define PERF_MEM_LVL_LFB 0x10
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800332#define PERF_MEM_LVL_L2 0x20
Tao Baod7db5942015-01-28 10:07:51 -0800333/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700334#define PERF_MEM_LVL_L3 0x40
335#define PERF_MEM_LVL_LOC_RAM 0x80
336#define PERF_MEM_LVL_REM_RAM1 0x100
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800337#define PERF_MEM_LVL_REM_RAM2 0x200
Tao Baod7db5942015-01-28 10:07:51 -0800338/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700339#define PERF_MEM_LVL_REM_CCE1 0x400
340#define PERF_MEM_LVL_REM_CCE2 0x800
341#define PERF_MEM_LVL_IO 0x1000
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800342#define PERF_MEM_LVL_UNC 0x2000
Tao Baod7db5942015-01-28 10:07:51 -0800343/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700344#define PERF_MEM_LVL_SHIFT 5
345#define PERF_MEM_SNOOP_NA 0x01
346#define PERF_MEM_SNOOP_NONE 0x02
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800347#define PERF_MEM_SNOOP_HIT 0x04
Tao Baod7db5942015-01-28 10:07:51 -0800348/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700349#define PERF_MEM_SNOOP_MISS 0x08
350#define PERF_MEM_SNOOP_HITM 0x10
351#define PERF_MEM_SNOOP_SHIFT 19
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800352#define PERF_MEM_LOCK_NA 0x01
Tao Baod7db5942015-01-28 10:07:51 -0800353/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700354#define PERF_MEM_LOCK_LOCKED 0x02
355#define PERF_MEM_LOCK_SHIFT 24
356#define PERF_MEM_TLB_NA 0x01
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800357#define PERF_MEM_TLB_HIT 0x02
Tao Baod7db5942015-01-28 10:07:51 -0800358/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700359#define PERF_MEM_TLB_MISS 0x04
360#define PERF_MEM_TLB_L1 0x08
361#define PERF_MEM_TLB_L2 0x10
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800362#define PERF_MEM_TLB_WK 0x20
Tao Baod7db5942015-01-28 10:07:51 -0800363/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -0700364#define PERF_MEM_TLB_OS 0x40
Christopher Ferris38062f92014-07-09 15:33:25 -0700365#define PERF_MEM_TLB_SHIFT 26
Tao Baod7db5942015-01-28 10:07:51 -0800366#define PERF_MEM_S(a,s) (((__u64) PERF_MEM_ ##a ##_ ##s) << PERF_MEM_ ##a ##_SHIFT)
Christopher Ferris38062f92014-07-09 15:33:25 -0700367struct perf_branch_entry {
Christopher Ferrisba8d4f42014-09-03 19:56:49 -0700368/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800369 __u64 from;
370 __u64 to;
371 __u64 mispred : 1, predicted : 1, in_tx : 1, abort : 1, reserved : 60;
Christopher Ferris38062f92014-07-09 15:33:25 -0700372};
Tao Baod7db5942015-01-28 10:07:51 -0800373/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800374#endif