1 /****************************************************************************
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 #include <asm/byteorder.h>
24 enum perf_type_id {
25   PERF_TYPE_HARDWARE = 0,
26   PERF_TYPE_SOFTWARE = 1,
27   PERF_TYPE_TRACEPOINT = 2,
28   PERF_TYPE_HW_CACHE = 3,
29   PERF_TYPE_RAW = 4,
30   PERF_TYPE_BREAKPOINT = 5,
31   PERF_TYPE_MAX,
32 };
33 enum perf_hw_id {
34   PERF_COUNT_HW_CPU_CYCLES = 0,
35   PERF_COUNT_HW_INSTRUCTIONS = 1,
36   PERF_COUNT_HW_CACHE_REFERENCES = 2,
37   PERF_COUNT_HW_CACHE_MISSES = 3,
38   PERF_COUNT_HW_BRANCH_INSTRUCTIONS = 4,
39   PERF_COUNT_HW_BRANCH_MISSES = 5,
40   PERF_COUNT_HW_BUS_CYCLES = 6,
41   PERF_COUNT_HW_STALLED_CYCLES_FRONTEND = 7,
42   PERF_COUNT_HW_STALLED_CYCLES_BACKEND = 8,
43   PERF_COUNT_HW_REF_CPU_CYCLES = 9,
44   PERF_COUNT_HW_MAX,
45 };
46 enum perf_hw_cache_id {
47   PERF_COUNT_HW_CACHE_L1D = 0,
48   PERF_COUNT_HW_CACHE_L1I = 1,
49   PERF_COUNT_HW_CACHE_LL = 2,
50   PERF_COUNT_HW_CACHE_DTLB = 3,
51   PERF_COUNT_HW_CACHE_ITLB = 4,
52   PERF_COUNT_HW_CACHE_BPU = 5,
53   PERF_COUNT_HW_CACHE_NODE = 6,
54   PERF_COUNT_HW_CACHE_MAX,
55 };
56 enum perf_hw_cache_op_id {
57   PERF_COUNT_HW_CACHE_OP_READ = 0,
58   PERF_COUNT_HW_CACHE_OP_WRITE = 1,
59   PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,
60   PERF_COUNT_HW_CACHE_OP_MAX,
61 };
62 enum perf_hw_cache_op_result_id {
63   PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
64   PERF_COUNT_HW_CACHE_RESULT_MISS = 1,
65   PERF_COUNT_HW_CACHE_RESULT_MAX,
66 };
67 enum perf_sw_ids {
68   PERF_COUNT_SW_CPU_CLOCK = 0,
69   PERF_COUNT_SW_TASK_CLOCK = 1,
70   PERF_COUNT_SW_PAGE_FAULTS = 2,
71   PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
72   PERF_COUNT_SW_CPU_MIGRATIONS = 4,
73   PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
74   PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
75   PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
76   PERF_COUNT_SW_EMULATION_FAULTS = 8,
77   PERF_COUNT_SW_DUMMY = 9,
78   PERF_COUNT_SW_BPF_OUTPUT = 10,
79   PERF_COUNT_SW_MAX,
80 };
81 enum perf_event_sample_format {
82   PERF_SAMPLE_IP = 1U << 0,
83   PERF_SAMPLE_TID = 1U << 1,
84   PERF_SAMPLE_TIME = 1U << 2,
85   PERF_SAMPLE_ADDR = 1U << 3,
86   PERF_SAMPLE_READ = 1U << 4,
87   PERF_SAMPLE_CALLCHAIN = 1U << 5,
88   PERF_SAMPLE_ID = 1U << 6,
89   PERF_SAMPLE_CPU = 1U << 7,
90   PERF_SAMPLE_PERIOD = 1U << 8,
91   PERF_SAMPLE_STREAM_ID = 1U << 9,
92   PERF_SAMPLE_RAW = 1U << 10,
93   PERF_SAMPLE_BRANCH_STACK = 1U << 11,
94   PERF_SAMPLE_REGS_USER = 1U << 12,
95   PERF_SAMPLE_STACK_USER = 1U << 13,
96   PERF_SAMPLE_WEIGHT = 1U << 14,
97   PERF_SAMPLE_DATA_SRC = 1U << 15,
98   PERF_SAMPLE_IDENTIFIER = 1U << 16,
99   PERF_SAMPLE_TRANSACTION = 1U << 17,
100   PERF_SAMPLE_REGS_INTR = 1U << 18,
101   PERF_SAMPLE_PHYS_ADDR = 1U << 19,
102   PERF_SAMPLE_AUX = 1U << 20,
103   PERF_SAMPLE_CGROUP = 1U << 21,
104   PERF_SAMPLE_MAX = 1U << 22,
105   __PERF_SAMPLE_CALLCHAIN_EARLY = 1ULL << 63,
106 };
107 enum perf_branch_sample_type_shift {
108   PERF_SAMPLE_BRANCH_USER_SHIFT = 0,
109   PERF_SAMPLE_BRANCH_KERNEL_SHIFT = 1,
110   PERF_SAMPLE_BRANCH_HV_SHIFT = 2,
111   PERF_SAMPLE_BRANCH_ANY_SHIFT = 3,
112   PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT = 4,
113   PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT = 5,
114   PERF_SAMPLE_BRANCH_IND_CALL_SHIFT = 6,
115   PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT = 7,
116   PERF_SAMPLE_BRANCH_IN_TX_SHIFT = 8,
117   PERF_SAMPLE_BRANCH_NO_TX_SHIFT = 9,
118   PERF_SAMPLE_BRANCH_COND_SHIFT = 10,
119   PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT = 11,
120   PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT = 12,
121   PERF_SAMPLE_BRANCH_CALL_SHIFT = 13,
122   PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT = 14,
123   PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT = 15,
124   PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT = 16,
125   PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT = 17,
126   PERF_SAMPLE_BRANCH_MAX_SHIFT
127 };
128 enum perf_branch_sample_type {
129   PERF_SAMPLE_BRANCH_USER = 1U << PERF_SAMPLE_BRANCH_USER_SHIFT,
130   PERF_SAMPLE_BRANCH_KERNEL = 1U << PERF_SAMPLE_BRANCH_KERNEL_SHIFT,
131   PERF_SAMPLE_BRANCH_HV = 1U << PERF_SAMPLE_BRANCH_HV_SHIFT,
132   PERF_SAMPLE_BRANCH_ANY = 1U << PERF_SAMPLE_BRANCH_ANY_SHIFT,
133   PERF_SAMPLE_BRANCH_ANY_CALL = 1U << PERF_SAMPLE_BRANCH_ANY_CALL_SHIFT,
134   PERF_SAMPLE_BRANCH_ANY_RETURN = 1U << PERF_SAMPLE_BRANCH_ANY_RETURN_SHIFT,
135   PERF_SAMPLE_BRANCH_IND_CALL = 1U << PERF_SAMPLE_BRANCH_IND_CALL_SHIFT,
136   PERF_SAMPLE_BRANCH_ABORT_TX = 1U << PERF_SAMPLE_BRANCH_ABORT_TX_SHIFT,
137   PERF_SAMPLE_BRANCH_IN_TX = 1U << PERF_SAMPLE_BRANCH_IN_TX_SHIFT,
138   PERF_SAMPLE_BRANCH_NO_TX = 1U << PERF_SAMPLE_BRANCH_NO_TX_SHIFT,
139   PERF_SAMPLE_BRANCH_COND = 1U << PERF_SAMPLE_BRANCH_COND_SHIFT,
140   PERF_SAMPLE_BRANCH_CALL_STACK = 1U << PERF_SAMPLE_BRANCH_CALL_STACK_SHIFT,
141   PERF_SAMPLE_BRANCH_IND_JUMP = 1U << PERF_SAMPLE_BRANCH_IND_JUMP_SHIFT,
142   PERF_SAMPLE_BRANCH_CALL = 1U << PERF_SAMPLE_BRANCH_CALL_SHIFT,
143   PERF_SAMPLE_BRANCH_NO_FLAGS = 1U << PERF_SAMPLE_BRANCH_NO_FLAGS_SHIFT,
144   PERF_SAMPLE_BRANCH_NO_CYCLES = 1U << PERF_SAMPLE_BRANCH_NO_CYCLES_SHIFT,
145   PERF_SAMPLE_BRANCH_TYPE_SAVE = 1U << PERF_SAMPLE_BRANCH_TYPE_SAVE_SHIFT,
146   PERF_SAMPLE_BRANCH_HW_INDEX = 1U << PERF_SAMPLE_BRANCH_HW_INDEX_SHIFT,
147   PERF_SAMPLE_BRANCH_MAX = 1U << PERF_SAMPLE_BRANCH_MAX_SHIFT,
148 };
149 enum {
150   PERF_BR_UNKNOWN = 0,
151   PERF_BR_COND = 1,
152   PERF_BR_UNCOND = 2,
153   PERF_BR_IND = 3,
154   PERF_BR_CALL = 4,
155   PERF_BR_IND_CALL = 5,
156   PERF_BR_RET = 6,
157   PERF_BR_SYSCALL = 7,
158   PERF_BR_SYSRET = 8,
159   PERF_BR_COND_CALL = 9,
160   PERF_BR_COND_RET = 10,
161   PERF_BR_MAX,
162 };
163 #define PERF_SAMPLE_BRANCH_PLM_ALL (PERF_SAMPLE_BRANCH_USER | PERF_SAMPLE_BRANCH_KERNEL | PERF_SAMPLE_BRANCH_HV)
164 enum perf_sample_regs_abi {
165   PERF_SAMPLE_REGS_ABI_NONE = 0,
166   PERF_SAMPLE_REGS_ABI_32 = 1,
167   PERF_SAMPLE_REGS_ABI_64 = 2,
168 };
169 enum {
170   PERF_TXN_ELISION = (1 << 0),
171   PERF_TXN_TRANSACTION = (1 << 1),
172   PERF_TXN_SYNC = (1 << 2),
173   PERF_TXN_ASYNC = (1 << 3),
174   PERF_TXN_RETRY = (1 << 4),
175   PERF_TXN_CONFLICT = (1 << 5),
176   PERF_TXN_CAPACITY_WRITE = (1 << 6),
177   PERF_TXN_CAPACITY_READ = (1 << 7),
178   PERF_TXN_MAX = (1 << 8),
179   PERF_TXN_ABORT_MASK = (0xffffffffULL << 32),
180   PERF_TXN_ABORT_SHIFT = 32,
181 };
182 enum perf_event_read_format {
183   PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
184   PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
185   PERF_FORMAT_ID = 1U << 2,
186   PERF_FORMAT_GROUP = 1U << 3,
187   PERF_FORMAT_MAX = 1U << 4,
188 };
189 #define PERF_ATTR_SIZE_VER0 64
190 #define PERF_ATTR_SIZE_VER1 72
191 #define PERF_ATTR_SIZE_VER2 80
192 #define PERF_ATTR_SIZE_VER3 96
193 #define PERF_ATTR_SIZE_VER4 104
194 #define PERF_ATTR_SIZE_VER5 112
195 #define PERF_ATTR_SIZE_VER6 120
196 struct perf_event_attr {
197   __u32 type;
198   __u32 size;
199   __u64 config;
200   union {
201     __u64 sample_period;
202     __u64 sample_freq;
203   };
204   __u64 sample_type;
205   __u64 read_format;
206   __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, use_clockid : 1, context_switch : 1, write_backward : 1, namespaces : 1, ksymbol : 1, bpf_event : 1, aux_output : 1, cgroup : 1, __reserved_1 : 31;
207   union {
208     __u32 wakeup_events;
209     __u32 wakeup_watermark;
210   };
211   __u32 bp_type;
212   union {
213     __u64 bp_addr;
214     __u64 kprobe_func;
215     __u64 uprobe_path;
216     __u64 config1;
217   };
218   union {
219     __u64 bp_len;
220     __u64 kprobe_addr;
221     __u64 probe_offset;
222     __u64 config2;
223   };
224   __u64 branch_sample_type;
225   __u64 sample_regs_user;
226   __u32 sample_stack_user;
227   __s32 clockid;
228   __u64 sample_regs_intr;
229   __u32 aux_watermark;
230   __u16 sample_max_stack;
231   __u16 __reserved_2;
232   __u32 aux_sample_size;
233   __u32 __reserved_3;
234 };
235 struct perf_event_query_bpf {
236   __u32 ids_len;
237   __u32 prog_cnt;
238   __u32 ids[0];
239 };
240 #define PERF_EVENT_IOC_ENABLE _IO('$', 0)
241 #define PERF_EVENT_IOC_DISABLE _IO('$', 1)
242 #define PERF_EVENT_IOC_REFRESH _IO('$', 2)
243 #define PERF_EVENT_IOC_RESET _IO('$', 3)
244 #define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
245 #define PERF_EVENT_IOC_SET_OUTPUT _IO('$', 5)
246 #define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
247 #define PERF_EVENT_IOC_ID _IOR('$', 7, __u64 *)
248 #define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, __u32)
249 #define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, __u32)
250 #define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *)
251 #define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *)
252 enum perf_event_ioc_flags {
253   PERF_IOC_FLAG_GROUP = 1U << 0,
254 };
255 struct perf_event_mmap_page {
256   __u32 version;
257   __u32 compat_version;
258   __u32 lock;
259   __u32 index;
260   __s64 offset;
261   __u64 time_enabled;
262   __u64 time_running;
263   union {
264     __u64 capabilities;
265     struct {
266       __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;
267     };
268   };
269   __u16 pmc_width;
270   __u16 time_shift;
271   __u32 time_mult;
272   __u64 time_offset;
273   __u64 time_zero;
274   __u32 size;
275   __u8 __reserved[118 * 8 + 4];
276   __u64 data_head;
277   __u64 data_tail;
278   __u64 data_offset;
279   __u64 data_size;
280   __u64 aux_head;
281   __u64 aux_tail;
282   __u64 aux_offset;
283   __u64 aux_size;
284 };
285 #define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
286 #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
287 #define PERF_RECORD_MISC_KERNEL (1 << 0)
288 #define PERF_RECORD_MISC_USER (2 << 0)
289 #define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
290 #define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
291 #define PERF_RECORD_MISC_GUEST_USER (5 << 0)
292 #define PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT (1 << 12)
293 #define PERF_RECORD_MISC_MMAP_DATA (1 << 13)
294 #define PERF_RECORD_MISC_COMM_EXEC (1 << 13)
295 #define PERF_RECORD_MISC_FORK_EXEC (1 << 13)
296 #define PERF_RECORD_MISC_SWITCH_OUT (1 << 13)
297 #define PERF_RECORD_MISC_EXACT_IP (1 << 14)
298 #define PERF_RECORD_MISC_SWITCH_OUT_PREEMPT (1 << 14)
299 #define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
300 struct perf_event_header {
301   __u32 type;
302   __u16 misc;
303   __u16 size;
304 };
305 struct perf_ns_link_info {
306   __u64 dev;
307   __u64 ino;
308 };
309 enum {
310   NET_NS_INDEX = 0,
311   UTS_NS_INDEX = 1,
312   IPC_NS_INDEX = 2,
313   PID_NS_INDEX = 3,
314   USER_NS_INDEX = 4,
315   MNT_NS_INDEX = 5,
316   CGROUP_NS_INDEX = 6,
317   NR_NAMESPACES,
318 };
319 enum perf_event_type {
320   PERF_RECORD_MMAP = 1,
321   PERF_RECORD_LOST = 2,
322   PERF_RECORD_COMM = 3,
323   PERF_RECORD_EXIT = 4,
324   PERF_RECORD_THROTTLE = 5,
325   PERF_RECORD_UNTHROTTLE = 6,
326   PERF_RECORD_FORK = 7,
327   PERF_RECORD_READ = 8,
328   PERF_RECORD_SAMPLE = 9,
329   PERF_RECORD_MMAP2 = 10,
330   PERF_RECORD_AUX = 11,
331   PERF_RECORD_ITRACE_START = 12,
332   PERF_RECORD_LOST_SAMPLES = 13,
333   PERF_RECORD_SWITCH = 14,
334   PERF_RECORD_SWITCH_CPU_WIDE = 15,
335   PERF_RECORD_NAMESPACES = 16,
336   PERF_RECORD_KSYMBOL = 17,
337   PERF_RECORD_BPF_EVENT = 18,
338   PERF_RECORD_CGROUP = 19,
339   PERF_RECORD_MAX,
340 };
341 enum perf_record_ksymbol_type {
342   PERF_RECORD_KSYMBOL_TYPE_UNKNOWN = 0,
343   PERF_RECORD_KSYMBOL_TYPE_BPF = 1,
344   PERF_RECORD_KSYMBOL_TYPE_MAX
345 };
346 #define PERF_RECORD_KSYMBOL_FLAGS_UNREGISTER (1 << 0)
347 enum perf_bpf_event_type {
348   PERF_BPF_EVENT_UNKNOWN = 0,
349   PERF_BPF_EVENT_PROG_LOAD = 1,
350   PERF_BPF_EVENT_PROG_UNLOAD = 2,
351   PERF_BPF_EVENT_MAX,
352 };
353 #define PERF_MAX_STACK_DEPTH 127
354 #define PERF_MAX_CONTEXTS_PER_STACK 8
355 enum perf_callchain_context {
356   PERF_CONTEXT_HV = (__u64) - 32,
357   PERF_CONTEXT_KERNEL = (__u64) - 128,
358   PERF_CONTEXT_USER = (__u64) - 512,
359   PERF_CONTEXT_GUEST = (__u64) - 2048,
360   PERF_CONTEXT_GUEST_KERNEL = (__u64) - 2176,
361   PERF_CONTEXT_GUEST_USER = (__u64) - 2560,
362   PERF_CONTEXT_MAX = (__u64) - 4095,
363 };
364 #define PERF_AUX_FLAG_TRUNCATED 0x01
365 #define PERF_AUX_FLAG_OVERWRITE 0x02
366 #define PERF_AUX_FLAG_PARTIAL 0x04
367 #define PERF_AUX_FLAG_COLLISION 0x08
368 #define PERF_FLAG_FD_NO_GROUP (1UL << 0)
369 #define PERF_FLAG_FD_OUTPUT (1UL << 1)
370 #define PERF_FLAG_PID_CGROUP (1UL << 2)
371 #define PERF_FLAG_FD_CLOEXEC (1UL << 3)
372 #ifdef __LITTLE_ENDIAN_BITFIELD
373 union perf_mem_data_src {
374   __u64 val;
375   struct {
376     __u64 mem_op : 5, mem_lvl : 14, mem_snoop : 5, mem_lock : 2, mem_dtlb : 7, mem_lvl_num : 4, mem_remote : 1, mem_snoopx : 2, mem_rsvd : 24;
377   };
378 };
379 #elif defined(__BIG_ENDIAN_BITFIELD)
380 union perf_mem_data_src {
381   __u64 val;
382   struct {
383     __u64 mem_rsvd : 24, mem_snoopx : 2, mem_remote : 1, mem_lvl_num : 4, mem_dtlb : 7, mem_lock : 2, mem_snoop : 5, mem_lvl : 14, mem_op : 5;
384   };
385 };
386 #else
387 #error "Unknown endianness"
388 #endif
389 #define PERF_MEM_OP_NA 0x01
390 #define PERF_MEM_OP_LOAD 0x02
391 #define PERF_MEM_OP_STORE 0x04
392 #define PERF_MEM_OP_PFETCH 0x08
393 #define PERF_MEM_OP_EXEC 0x10
394 #define PERF_MEM_OP_SHIFT 0
395 #define PERF_MEM_LVL_NA 0x01
396 #define PERF_MEM_LVL_HIT 0x02
397 #define PERF_MEM_LVL_MISS 0x04
398 #define PERF_MEM_LVL_L1 0x08
399 #define PERF_MEM_LVL_LFB 0x10
400 #define PERF_MEM_LVL_L2 0x20
401 #define PERF_MEM_LVL_L3 0x40
402 #define PERF_MEM_LVL_LOC_RAM 0x80
403 #define PERF_MEM_LVL_REM_RAM1 0x100
404 #define PERF_MEM_LVL_REM_RAM2 0x200
405 #define PERF_MEM_LVL_REM_CCE1 0x400
406 #define PERF_MEM_LVL_REM_CCE2 0x800
407 #define PERF_MEM_LVL_IO 0x1000
408 #define PERF_MEM_LVL_UNC 0x2000
409 #define PERF_MEM_LVL_SHIFT 5
410 #define PERF_MEM_REMOTE_REMOTE 0x01
411 #define PERF_MEM_REMOTE_SHIFT 37
412 #define PERF_MEM_LVLNUM_L1 0x01
413 #define PERF_MEM_LVLNUM_L2 0x02
414 #define PERF_MEM_LVLNUM_L3 0x03
415 #define PERF_MEM_LVLNUM_L4 0x04
416 #define PERF_MEM_LVLNUM_ANY_CACHE 0x0b
417 #define PERF_MEM_LVLNUM_LFB 0x0c
418 #define PERF_MEM_LVLNUM_RAM 0x0d
419 #define PERF_MEM_LVLNUM_PMEM 0x0e
420 #define PERF_MEM_LVLNUM_NA 0x0f
421 #define PERF_MEM_LVLNUM_SHIFT 33
422 #define PERF_MEM_SNOOP_NA 0x01
423 #define PERF_MEM_SNOOP_NONE 0x02
424 #define PERF_MEM_SNOOP_HIT 0x04
425 #define PERF_MEM_SNOOP_MISS 0x08
426 #define PERF_MEM_SNOOP_HITM 0x10
427 #define PERF_MEM_SNOOP_SHIFT 19
428 #define PERF_MEM_SNOOPX_FWD 0x01
429 #define PERF_MEM_SNOOPX_SHIFT 37
430 #define PERF_MEM_LOCK_NA 0x01
431 #define PERF_MEM_LOCK_LOCKED 0x02
432 #define PERF_MEM_LOCK_SHIFT 24
433 #define PERF_MEM_TLB_NA 0x01
434 #define PERF_MEM_TLB_HIT 0x02
435 #define PERF_MEM_TLB_MISS 0x04
436 #define PERF_MEM_TLB_L1 0x08
437 #define PERF_MEM_TLB_L2 0x10
438 #define PERF_MEM_TLB_WK 0x20
439 #define PERF_MEM_TLB_OS 0x40
440 #define PERF_MEM_TLB_SHIFT 26
441 #define PERF_MEM_S(a,s) (((__u64) PERF_MEM_ ##a ##_ ##s) << PERF_MEM_ ##a ##_SHIFT)
442 struct perf_branch_entry {
443   __u64 from;
444   __u64 to;
445   __u64 mispred : 1, predicted : 1, in_tx : 1, abort : 1, cycles : 16, type : 4, reserved : 40;
446 };
447 #endif
448