blob: ad5515f44cac4368361690c2664b8e5e01a6136a [file] [log] [blame]
Nick Pelly976c44b2010-08-23 14:47:38 -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 ***
Ben Cheng654325d2012-03-07 21:13:49 -080010 *** 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 ***
Nick Pelly976c44b2010-08-23 14:47:38 -070017 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_PERF_EVENT_H
20#define _LINUX_PERF_EVENT_H
Nick Pelly976c44b2010-08-23 14:47:38 -070021#include <linux/types.h>
22#include <linux/ioctl.h>
Ben Cheng654325d2012-03-07 21:13:49 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070024#include <asm/byteorder.h>
Nick Pelly976c44b2010-08-23 14:47:38 -070025enum perf_type_id {
26 PERF_TYPE_HARDWARE = 0,
27 PERF_TYPE_SOFTWARE = 1,
Ben Cheng654325d2012-03-07 21:13:49 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070029 PERF_TYPE_TRACEPOINT = 2,
30 PERF_TYPE_HW_CACHE = 3,
31 PERF_TYPE_RAW = 4,
32 PERF_TYPE_BREAKPOINT = 5,
Ben Cheng654325d2012-03-07 21:13:49 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070034 PERF_TYPE_MAX,
35};
Nick Pelly976c44b2010-08-23 14:47:38 -070036enum perf_hw_id {
Nick Pelly976c44b2010-08-23 14:47:38 -070037 PERF_COUNT_HW_CPU_CYCLES = 0,
Ben Cheng654325d2012-03-07 21:13:49 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070039 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 Cheng654325d2012-03-07 21:13:49 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070044 PERF_COUNT_HW_BRANCH_MISSES = 5,
45 PERF_COUNT_HW_BUS_CYCLES = 6,
Nick Pelly976c44b2010-08-23 14:47:38 -070046 PERF_COUNT_HW_MAX,
47};
Ben Cheng654325d2012-03-07 21:13:49 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070049enum perf_hw_cache_id {
50 PERF_COUNT_HW_CACHE_L1D = 0,
51 PERF_COUNT_HW_CACHE_L1I = 1,
52 PERF_COUNT_HW_CACHE_LL = 2,
Ben Cheng654325d2012-03-07 21:13:49 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070054 PERF_COUNT_HW_CACHE_DTLB = 3,
55 PERF_COUNT_HW_CACHE_ITLB = 4,
56 PERF_COUNT_HW_CACHE_BPU = 5,
Nick Pelly976c44b2010-08-23 14:47:38 -070057 PERF_COUNT_HW_CACHE_MAX,
Ben Cheng654325d2012-03-07 21:13:49 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070059};
Nick Pelly976c44b2010-08-23 14:47:38 -070060enum perf_hw_cache_op_id {
61 PERF_COUNT_HW_CACHE_OP_READ = 0,
62 PERF_COUNT_HW_CACHE_OP_WRITE = 1,
Ben Cheng654325d2012-03-07 21:13:49 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070064 PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,
Nick Pelly976c44b2010-08-23 14:47:38 -070065 PERF_COUNT_HW_CACHE_OP_MAX,
66};
Nick Pelly976c44b2010-08-23 14:47:38 -070067enum perf_hw_cache_op_result_id {
Ben Cheng654325d2012-03-07 21:13:49 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070069 PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
70 PERF_COUNT_HW_CACHE_RESULT_MISS = 1,
Nick Pelly976c44b2010-08-23 14:47:38 -070071 PERF_COUNT_HW_CACHE_RESULT_MAX,
72};
Ben Cheng654325d2012-03-07 21:13:49 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070074enum perf_sw_ids {
75 PERF_COUNT_SW_CPU_CLOCK = 0,
76 PERF_COUNT_SW_TASK_CLOCK = 1,
77 PERF_COUNT_SW_PAGE_FAULTS = 2,
Ben Cheng654325d2012-03-07 21:13:49 -080078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070079 PERF_COUNT_SW_CONTEXT_SWITCHES = 3,
80 PERF_COUNT_SW_CPU_MIGRATIONS = 4,
81 PERF_COUNT_SW_PAGE_FAULTS_MIN = 5,
82 PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6,
Ben Cheng654325d2012-03-07 21:13:49 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070084 PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
85 PERF_COUNT_SW_EMULATION_FAULTS = 8,
Nick Pelly976c44b2010-08-23 14:47:38 -070086 PERF_COUNT_SW_MAX,
87};
Ben Cheng654325d2012-03-07 21:13:49 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070089enum perf_event_sample_format {
90 PERF_SAMPLE_IP = 1U << 0,
91 PERF_SAMPLE_TID = 1U << 1,
92 PERF_SAMPLE_TIME = 1U << 2,
Ben Cheng654325d2012-03-07 21:13:49 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070094 PERF_SAMPLE_ADDR = 1U << 3,
95 PERF_SAMPLE_READ = 1U << 4,
96 PERF_SAMPLE_CALLCHAIN = 1U << 5,
97 PERF_SAMPLE_ID = 1U << 6,
Ben Cheng654325d2012-03-07 21:13:49 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -070099 PERF_SAMPLE_CPU = 1U << 7,
100 PERF_SAMPLE_PERIOD = 1U << 8,
101 PERF_SAMPLE_STREAM_ID = 1U << 9,
102 PERF_SAMPLE_RAW = 1U << 10,
Ben Cheng654325d2012-03-07 21:13:49 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700104 PERF_SAMPLE_MAX = 1U << 11,
105};
Nick Pelly976c44b2010-08-23 14:47:38 -0700106enum perf_event_read_format {
107 PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
Ben Cheng654325d2012-03-07 21:13:49 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700109 PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
110 PERF_FORMAT_ID = 1U << 2,
111 PERF_FORMAT_GROUP = 1U << 3,
Nick Pelly976c44b2010-08-23 14:47:38 -0700112 PERF_FORMAT_MAX = 1U << 4,
Ben Cheng654325d2012-03-07 21:13:49 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700114};
Elliott Hughesc95eb572013-01-29 18:15:55 -0800115#define PERF_ATTR_SIZE_VER0 64
Nick Pelly976c44b2010-08-23 14:47:38 -0700116struct perf_event_attr {
Nick Pelly976c44b2010-08-23 14:47:38 -0700117 __u32 type;
Ben Cheng654325d2012-03-07 21:13:49 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700119 __u32 size;
Nick Pelly976c44b2010-08-23 14:47:38 -0700120 __u64 config;
Nick Pelly976c44b2010-08-23 14:47:38 -0700121 union {
122 __u64 sample_period;
Ben Cheng654325d2012-03-07 21:13:49 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700124 __u64 sample_freq;
125 };
Nick Pelly976c44b2010-08-23 14:47:38 -0700126 __u64 sample_type;
127 __u64 read_format;
Ben Cheng654325d2012-03-07 21:13:49 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700129 __u64 disabled : 1,
130 inherit : 1,
131 pinned : 1,
132 exclusive : 1,
Ben Cheng654325d2012-03-07 21:13:49 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700134 exclude_user : 1,
135 exclude_kernel : 1,
136 exclude_hv : 1,
137 exclude_idle : 1,
Ben Cheng654325d2012-03-07 21:13:49 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700139 mmap : 1,
140 comm : 1,
141 freq : 1,
142 inherit_stat : 1,
Ben Cheng654325d2012-03-07 21:13:49 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700144 enable_on_exec : 1,
145 task : 1,
146 watermark : 1,
Nick Pelly976c44b2010-08-23 14:47:38 -0700147 precise_ip : 2,
Ben Cheng654325d2012-03-07 21:13:49 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700149 __reserved_1 : 47;
Nick Pelly976c44b2010-08-23 14:47:38 -0700150 union {
151 __u32 wakeup_events;
152 __u32 wakeup_watermark;
Ben Cheng654325d2012-03-07 21:13:49 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700154 };
Nick Pelly976c44b2010-08-23 14:47:38 -0700155 __u32 bp_type;
156 __u64 bp_addr;
157 __u64 bp_len;
Ben Cheng654325d2012-03-07 21:13:49 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700159};
Nick Pelly976c44b2010-08-23 14:47:38 -0700160#define PERF_EVENT_IOC_ENABLE _IO ('$', 0)
161#define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
162#define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
Ben Cheng654325d2012-03-07 21:13:49 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700164#define PERF_EVENT_IOC_RESET _IO ('$', 3)
165#define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64)
166#define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5)
167#define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *)
Ben Cheng654325d2012-03-07 21:13:49 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700169enum perf_event_ioc_flags {
170 PERF_IOC_FLAG_GROUP = 1U << 0,
171};
Nick Pelly976c44b2010-08-23 14:47:38 -0700172struct perf_event_mmap_page {
Ben Cheng654325d2012-03-07 21:13:49 -0800173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700174 __u32 version;
175 __u32 compat_version;
Nick Pelly976c44b2010-08-23 14:47:38 -0700176 __u32 lock;
177 __u32 index;
Ben Cheng654325d2012-03-07 21:13:49 -0800178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700179 __s64 offset;
180 __u64 time_enabled;
181 __u64 time_running;
Nick Pelly976c44b2010-08-23 14:47:38 -0700182 __u64 __reserved[123];
Ben Cheng654325d2012-03-07 21:13:49 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700184 __u64 data_head;
185 __u64 data_tail;
186};
Nick Pelly976c44b2010-08-23 14:47:38 -0700187#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
Ben Cheng654325d2012-03-07 21:13:49 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700189#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
190#define PERF_RECORD_MISC_KERNEL (1 << 0)
191#define PERF_RECORD_MISC_USER (2 << 0)
192#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
Ben Cheng654325d2012-03-07 21:13:49 -0800193/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700194#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
195#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
Nick Pelly976c44b2010-08-23 14:47:38 -0700196#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
Nick Pelly976c44b2010-08-23 14:47:38 -0700197#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
Ben Cheng654325d2012-03-07 21:13:49 -0800198/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700199struct perf_event_header {
200 __u32 type;
201 __u16 misc;
202 __u16 size;
Ben Cheng654325d2012-03-07 21:13:49 -0800203/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700204};
Nick Pelly976c44b2010-08-23 14:47:38 -0700205enum perf_event_type {
Nick Pelly976c44b2010-08-23 14:47:38 -0700206 PERF_RECORD_MMAP = 1,
Nick Pelly976c44b2010-08-23 14:47:38 -0700207 PERF_RECORD_LOST = 2,
Ben Cheng654325d2012-03-07 21:13:49 -0800208/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700209 PERF_RECORD_COMM = 3,
Nick Pelly976c44b2010-08-23 14:47:38 -0700210 PERF_RECORD_EXIT = 4,
Nick Pelly976c44b2010-08-23 14:47:38 -0700211 PERF_RECORD_THROTTLE = 5,
212 PERF_RECORD_UNTHROTTLE = 6,
Ben Cheng654325d2012-03-07 21:13:49 -0800213/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700214 PERF_RECORD_FORK = 7,
Nick Pelly976c44b2010-08-23 14:47:38 -0700215 PERF_RECORD_READ = 8,
Nick Pelly976c44b2010-08-23 14:47:38 -0700216 PERF_RECORD_SAMPLE = 9,
Nick Pelly976c44b2010-08-23 14:47:38 -0700217 PERF_RECORD_MAX,
Ben Cheng654325d2012-03-07 21:13:49 -0800218/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700219};
Nick Pelly976c44b2010-08-23 14:47:38 -0700220enum perf_callchain_context {
221 PERF_CONTEXT_HV = (__u64)-32,
222 PERF_CONTEXT_KERNEL = (__u64)-128,
Ben Cheng654325d2012-03-07 21:13:49 -0800223/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700224 PERF_CONTEXT_USER = (__u64)-512,
Nick Pelly976c44b2010-08-23 14:47:38 -0700225 PERF_CONTEXT_GUEST = (__u64)-2048,
226 PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
227 PERF_CONTEXT_GUEST_USER = (__u64)-2560,
Ben Cheng654325d2012-03-07 21:13:49 -0800228/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700229 PERF_CONTEXT_MAX = (__u64)-4095,
230};
Nick Pelly976c44b2010-08-23 14:47:38 -0700231#define PERF_FLAG_FD_NO_GROUP (1U << 0)
232#define PERF_FLAG_FD_OUTPUT (1U << 1)
Ben Cheng654325d2012-03-07 21:13:49 -0800233/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Nick Pelly976c44b2010-08-23 14:47:38 -0700234#endif