diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-04-08 09:01:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-08 12:53:28 -0400 |
commit | 6b6e5486b3a168f0328c82a8d4376caf901472b1 (patch) | |
tree | f47c942f813f1348b5218d2a8df0c76378faff0b /include/linux/perf_counter.h | |
parent | 6fab01927e8bdbbc77bafba2abb4810c5591ad52 (diff) |
perf_counter: use misc field to widen type
Push the PERF_EVENT_COUNTER_OVERFLOW bit into the misc field so that
we can have the full 32bit for PERF_RECORD_ bits.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
LKML-Reference: <20090408130408.891867663@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/perf_counter.h')
-rw-r--r-- | include/linux/perf_counter.h | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 5bd8817b12d4..4809ae18a940 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -201,8 +201,9 @@ struct perf_counter_mmap_page { | |||
201 | __u32 data_head; /* head in the data section */ | 201 | __u32 data_head; /* head in the data section */ |
202 | }; | 202 | }; |
203 | 203 | ||
204 | #define PERF_EVENT_MISC_KERNEL (1 << 0) | 204 | #define PERF_EVENT_MISC_KERNEL (1 << 0) |
205 | #define PERF_EVENT_MISC_USER (1 << 1) | 205 | #define PERF_EVENT_MISC_USER (1 << 1) |
206 | #define PERF_EVENT_MISC_OVERFLOW (1 << 2) | ||
206 | 207 | ||
207 | struct perf_event_header { | 208 | struct perf_event_header { |
208 | __u32 type; | 209 | __u32 type; |
@@ -230,36 +231,27 @@ enum perf_event_type { | |||
230 | PERF_EVENT_MUNMAP = 2, | 231 | PERF_EVENT_MUNMAP = 2, |
231 | 232 | ||
232 | /* | 233 | /* |
233 | * Half the event type space is reserved for the counter overflow | 234 | * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field |
234 | * bitfields, as found in hw_event.record_type. | 235 | * will be PERF_RECORD_* |
235 | * | ||
236 | * These events will have types of the form: | ||
237 | * PERF_EVENT_COUNTER_OVERFLOW { | __PERF_EVENT_* } * | ||
238 | * | 236 | * |
239 | * struct { | 237 | * struct { |
240 | * struct perf_event_header header; | 238 | * struct perf_event_header header; |
241 | * | 239 | * |
242 | * { u64 ip; } && __PERF_EVENT_IP | 240 | * { u64 ip; } && PERF_RECORD_IP |
243 | * { u32 pid, tid; } && __PERF_EVENT_TID | 241 | * { u32 pid, tid; } && PERF_RECORD_TID |
244 | * | 242 | * |
245 | * { u64 nr; | 243 | * { u64 nr; |
246 | * { u64 event, val; } cnt[nr]; } && __PERF_EVENT_GROUP | 244 | * { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP |
247 | * | 245 | * |
248 | * { u16 nr, | 246 | * { u16 nr, |
249 | * hv, | 247 | * hv, |
250 | * kernel, | 248 | * kernel, |
251 | * user; | 249 | * user; |
252 | * u64 ips[nr]; } && __PERF_EVENT_CALLCHAIN | 250 | * u64 ips[nr]; } && PERF_RECORD_CALLCHAIN |
253 | * | 251 | * |
254 | * { u64 time; } && __PERF_EVENT_TIME | 252 | * { u64 time; } && PERF_RECORD_TIME |
255 | * }; | 253 | * }; |
256 | */ | 254 | */ |
257 | PERF_EVENT_COUNTER_OVERFLOW = 1UL << 31, | ||
258 | __PERF_EVENT_IP = PERF_RECORD_IP, | ||
259 | __PERF_EVENT_TID = PERF_RECORD_TID, | ||
260 | __PERF_EVENT_GROUP = PERF_RECORD_GROUP, | ||
261 | __PERF_EVENT_CALLCHAIN = PERF_RECORD_CALLCHAIN, | ||
262 | __PERF_EVENT_TIME = PERF_RECORD_TIME, | ||
263 | }; | 255 | }; |
264 | 256 | ||
265 | #ifdef __KERNEL__ | 257 | #ifdef __KERNEL__ |