diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-04-02 05:11:59 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-06 03:30:45 -0400 |
commit | 8a057d84912f36e53f970c4d177cb4bb6b2f9e08 (patch) | |
tree | dc69399ed13b6290064f38c1f67921bce7c8fc27 /include/linux/perf_counter.h | |
parent | 9dd499889bdb12ac0e412ccdd718fe0d348258f2 (diff) |
perf_counter: move the event overflow output bits to record_type
Per suggestion from Paul, move the event overflow bits to record_type
and sanitize the enums a bit.
Breaks the ABI -- again ;-)
Suggested-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Orig-LKML-Reference: <20090402091319.151921176@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 | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 43083afffe0f..06a6fba9f531 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -73,15 +73,6 @@ enum sw_event_ids { | |||
73 | PERF_SW_EVENTS_MAX = 7, | 73 | PERF_SW_EVENTS_MAX = 7, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | /* | ||
77 | * IRQ-notification data record type: | ||
78 | */ | ||
79 | enum perf_counter_record_type { | ||
80 | PERF_RECORD_SIMPLE = 0, | ||
81 | PERF_RECORD_IRQ = 1, | ||
82 | PERF_RECORD_GROUP = 2, | ||
83 | }; | ||
84 | |||
85 | #define __PERF_COUNTER_MASK(name) \ | 76 | #define __PERF_COUNTER_MASK(name) \ |
86 | (((1ULL << PERF_COUNTER_##name##_BITS) - 1) << \ | 77 | (((1ULL << PERF_COUNTER_##name##_BITS) - 1) << \ |
87 | PERF_COUNTER_##name##_SHIFT) | 78 | PERF_COUNTER_##name##_SHIFT) |
@@ -103,6 +94,17 @@ enum perf_counter_record_type { | |||
103 | #define PERF_COUNTER_EVENT_MASK __PERF_COUNTER_MASK(EVENT) | 94 | #define PERF_COUNTER_EVENT_MASK __PERF_COUNTER_MASK(EVENT) |
104 | 95 | ||
105 | /* | 96 | /* |
97 | * Bits that can be set in hw_event.record_type to request information | ||
98 | * in the overflow packets. | ||
99 | */ | ||
100 | enum perf_counter_record_format { | ||
101 | PERF_RECORD_IP = 1U << 0, | ||
102 | PERF_RECORD_TID = 1U << 1, | ||
103 | PERF_RECORD_GROUP = 1U << 2, | ||
104 | PERF_RECORD_CALLCHAIN = 1U << 3, | ||
105 | }; | ||
106 | |||
107 | /* | ||
106 | * Bits that can be set in hw_event.read_format to request that | 108 | * Bits that can be set in hw_event.read_format to request that |
107 | * reads on the counter should return the indicated quantities, | 109 | * reads on the counter should return the indicated quantities, |
108 | * in increasing order of bit value, after the counter value. | 110 | * in increasing order of bit value, after the counter value. |
@@ -125,8 +127,8 @@ struct perf_counter_hw_event { | |||
125 | __u64 config; | 127 | __u64 config; |
126 | 128 | ||
127 | __u64 irq_period; | 129 | __u64 irq_period; |
128 | __u64 record_type; | 130 | __u32 record_type; |
129 | __u64 read_format; | 131 | __u32 read_format; |
130 | 132 | ||
131 | __u64 disabled : 1, /* off by default */ | 133 | __u64 disabled : 1, /* off by default */ |
132 | nmi : 1, /* NMI sampling */ | 134 | nmi : 1, /* NMI sampling */ |
@@ -137,12 +139,10 @@ struct perf_counter_hw_event { | |||
137 | exclude_kernel : 1, /* ditto kernel */ | 139 | exclude_kernel : 1, /* ditto kernel */ |
138 | exclude_hv : 1, /* ditto hypervisor */ | 140 | exclude_hv : 1, /* ditto hypervisor */ |
139 | exclude_idle : 1, /* don't count when idle */ | 141 | exclude_idle : 1, /* don't count when idle */ |
140 | include_tid : 1, /* include the tid */ | ||
141 | mmap : 1, /* include mmap data */ | 142 | mmap : 1, /* include mmap data */ |
142 | munmap : 1, /* include munmap data */ | 143 | munmap : 1, /* include munmap data */ |
143 | callchain : 1, /* add callchain data */ | ||
144 | 144 | ||
145 | __reserved_1 : 51; | 145 | __reserved_1 : 53; |
146 | 146 | ||
147 | __u32 extra_config_len; | 147 | __u32 extra_config_len; |
148 | __u32 __reserved_4; | 148 | __u32 __reserved_4; |
@@ -212,15 +212,21 @@ struct perf_event_header { | |||
212 | 212 | ||
213 | enum perf_event_type { | 213 | enum perf_event_type { |
214 | 214 | ||
215 | PERF_EVENT_GROUP = 1, | 215 | PERF_EVENT_MMAP = 1, |
216 | 216 | PERF_EVENT_MUNMAP = 2, | |
217 | PERF_EVENT_MMAP = 2, | ||
218 | PERF_EVENT_MUNMAP = 3, | ||
219 | 217 | ||
220 | PERF_EVENT_OVERFLOW = 1UL << 31, | 218 | /* |
221 | __PERF_EVENT_IP = 1UL << 30, | 219 | * Half the event type space is reserved for the counter overflow |
222 | __PERF_EVENT_TID = 1UL << 29, | 220 | * bitfields, as found in hw_event.record_type. |
223 | __PERF_EVENT_CALLCHAIN = 1UL << 28, | 221 | * |
222 | * These events will have types of the form: | ||
223 | * PERF_EVENT_COUNTER_OVERFLOW { | __PERF_EVENT_* } * | ||
224 | */ | ||
225 | PERF_EVENT_COUNTER_OVERFLOW = 1UL << 31, | ||
226 | __PERF_EVENT_IP = PERF_RECORD_IP, | ||
227 | __PERF_EVENT_TID = PERF_RECORD_TID, | ||
228 | __PERF_EVENT_GROUP = PERF_RECORD_GROUP, | ||
229 | __PERF_EVENT_CALLCHAIN = PERF_RECORD_CALLCHAIN, | ||
224 | }; | 230 | }; |
225 | 231 | ||
226 | #ifdef __KERNEL__ | 232 | #ifdef __KERNEL__ |