• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 _LINUX_PERF_EVENT_H
20 #define _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>
25 enum perf_type_id {
26  PERF_TYPE_HARDWARE = 0,
27  PERF_TYPE_SOFTWARE = 1,
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29  PERF_TYPE_TRACEPOINT = 2,
30  PERF_TYPE_HW_CACHE = 3,
31  PERF_TYPE_RAW = 4,
32  PERF_TYPE_BREAKPOINT = 5,
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34  PERF_TYPE_MAX,
35 };
36 enum perf_hw_id {
37  PERF_COUNT_HW_CPU_CYCLES = 0,
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39  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,
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44  PERF_COUNT_HW_BRANCH_MISSES = 5,
45  PERF_COUNT_HW_BUS_CYCLES = 6,
46  PERF_COUNT_HW_MAX,
47 };
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 enum 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,
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54  PERF_COUNT_HW_CACHE_DTLB = 3,
55  PERF_COUNT_HW_CACHE_ITLB = 4,
56  PERF_COUNT_HW_CACHE_BPU = 5,
57  PERF_COUNT_HW_CACHE_MAX,
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 };
60 enum perf_hw_cache_op_id {
61  PERF_COUNT_HW_CACHE_OP_READ = 0,
62  PERF_COUNT_HW_CACHE_OP_WRITE = 1,
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64  PERF_COUNT_HW_CACHE_OP_PREFETCH = 2,
65  PERF_COUNT_HW_CACHE_OP_MAX,
66 };
67 enum perf_hw_cache_op_result_id {
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69  PERF_COUNT_HW_CACHE_RESULT_ACCESS = 0,
70  PERF_COUNT_HW_CACHE_RESULT_MISS = 1,
71  PERF_COUNT_HW_CACHE_RESULT_MAX,
72 };
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 enum perf_sw_ids {
75  PERF_COUNT_SW_CPU_CLOCK = 0,
76  PERF_COUNT_SW_TASK_CLOCK = 1,
77  PERF_COUNT_SW_PAGE_FAULTS = 2,
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79  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,
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84  PERF_COUNT_SW_ALIGNMENT_FAULTS = 7,
85  PERF_COUNT_SW_EMULATION_FAULTS = 8,
86  PERF_COUNT_SW_MAX,
87 };
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 enum perf_event_sample_format {
90  PERF_SAMPLE_IP = 1U << 0,
91  PERF_SAMPLE_TID = 1U << 1,
92  PERF_SAMPLE_TIME = 1U << 2,
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94  PERF_SAMPLE_ADDR = 1U << 3,
95  PERF_SAMPLE_READ = 1U << 4,
96  PERF_SAMPLE_CALLCHAIN = 1U << 5,
97  PERF_SAMPLE_ID = 1U << 6,
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99  PERF_SAMPLE_CPU = 1U << 7,
100  PERF_SAMPLE_PERIOD = 1U << 8,
101  PERF_SAMPLE_STREAM_ID = 1U << 9,
102  PERF_SAMPLE_RAW = 1U << 10,
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104  PERF_SAMPLE_MAX = 1U << 11,
105 };
106 enum perf_event_read_format {
107  PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0,
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109  PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1,
110  PERF_FORMAT_ID = 1U << 2,
111  PERF_FORMAT_GROUP = 1U << 3,
112  PERF_FORMAT_MAX = 1U << 4,
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 };
115 #define PERF_ATTR_SIZE_VER0 64
116 struct perf_event_attr {
117  __u32 type;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119  __u32 size;
120  __u64 config;
121  union {
122  __u64 sample_period;
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124  __u64 sample_freq;
125  };
126  __u64 sample_type;
127  __u64 read_format;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129  __u64 disabled : 1,
130  inherit : 1,
131  pinned : 1,
132  exclusive : 1,
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134  exclude_user : 1,
135  exclude_kernel : 1,
136  exclude_hv : 1,
137  exclude_idle : 1,
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139  mmap : 1,
140  comm : 1,
141  freq : 1,
142  inherit_stat : 1,
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144  enable_on_exec : 1,
145  task : 1,
146  watermark : 1,
147  precise_ip : 2,
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149  __reserved_1 : 47;
150  union {
151  __u32 wakeup_events;
152  __u32 wakeup_watermark;
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154  };
155  __u32 bp_type;
156  __u64 bp_addr;
157  __u64 bp_len;
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 };
160 #define PERF_EVENT_IOC_ENABLE _IO ('$', 0)
161 #define PERF_EVENT_IOC_DISABLE _IO ('$', 1)
162 #define PERF_EVENT_IOC_REFRESH _IO ('$', 2)
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 #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 *)
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169 enum perf_event_ioc_flags {
170  PERF_IOC_FLAG_GROUP = 1U << 0,
171 };
172 struct perf_event_mmap_page {
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174  __u32 version;
175  __u32 compat_version;
176  __u32 lock;
177  __u32 index;
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179  __s64 offset;
180  __u64 time_enabled;
181  __u64 time_running;
182  __u64 __reserved[123];
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184  __u64 data_head;
185  __u64 data_tail;
186 };
187 #define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 #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)
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 #define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
195 #define PERF_RECORD_MISC_GUEST_USER (5 << 0)
196 #define PERF_RECORD_MISC_EXACT_IP (1 << 14)
197 #define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 struct perf_event_header {
200  __u32 type;
201  __u16 misc;
202  __u16 size;
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204 };
205 enum perf_event_type {
206  PERF_RECORD_MMAP = 1,
207  PERF_RECORD_LOST = 2,
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209  PERF_RECORD_COMM = 3,
210  PERF_RECORD_EXIT = 4,
211  PERF_RECORD_THROTTLE = 5,
212  PERF_RECORD_UNTHROTTLE = 6,
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214  PERF_RECORD_FORK = 7,
215  PERF_RECORD_READ = 8,
216  PERF_RECORD_SAMPLE = 9,
217  PERF_RECORD_MAX,
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219 };
220 enum perf_callchain_context {
221  PERF_CONTEXT_HV = (__u64)-32,
222  PERF_CONTEXT_KERNEL = (__u64)-128,
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224  PERF_CONTEXT_USER = (__u64)-512,
225  PERF_CONTEXT_GUEST = (__u64)-2048,
226  PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176,
227  PERF_CONTEXT_GUEST_USER = (__u64)-2560,
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229  PERF_CONTEXT_MAX = (__u64)-4095,
230 };
231 #define PERF_FLAG_FD_NO_GROUP (1U << 0)
232 #define PERF_FLAG_FD_OUTPUT (1U << 1)
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 #endif
235