diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-05-25 16:03:26 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-05-25 16:02:23 -0400 |
commit | 0127c3ea082ee9f1034789b978dfc7fd83254617 (patch) | |
tree | d3d9f8bc4544359f2aa6f65b4881ffa625c93742 | |
parent | 53b441a565bf4036ab49c8ea04c5ad06ace7dd6b (diff) |
perf_counter: fix warning & lockup
- remove bogus warning
- fix wakeup from NMI path lockup
- also fix up whitespace noise in perf_counter.h
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: John Kacur <jkacur@redhat.com>
LKML-Reference: <20090525153931.703093461@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | include/linux/perf_counter.h | 78 | ||||
-rw-r--r-- | kernel/perf_counter.c | 4 |
2 files changed, 40 insertions, 42 deletions
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index e3a7585d3e43..2b16ed37b74c 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -73,7 +73,7 @@ enum sw_event_ids { | |||
73 | PERF_SW_EVENTS_MAX = 7, | 73 | PERF_SW_EVENTS_MAX = 7, |
74 | }; | 74 | }; |
75 | 75 | ||
76 | #define __PERF_COUNTER_MASK(name) \ | 76 | #define __PERF_COUNTER_MASK(name) \ |
77 | (((1ULL << PERF_COUNTER_##name##_BITS) - 1) << \ | 77 | (((1ULL << PERF_COUNTER_##name##_BITS) - 1) << \ |
78 | PERF_COUNTER_##name##_SHIFT) | 78 | PERF_COUNTER_##name##_SHIFT) |
79 | 79 | ||
@@ -98,14 +98,14 @@ enum sw_event_ids { | |||
98 | * in the overflow packets. | 98 | * in the overflow packets. |
99 | */ | 99 | */ |
100 | enum perf_counter_record_format { | 100 | enum perf_counter_record_format { |
101 | PERF_RECORD_IP = 1U << 0, | 101 | PERF_RECORD_IP = 1U << 0, |
102 | PERF_RECORD_TID = 1U << 1, | 102 | PERF_RECORD_TID = 1U << 1, |
103 | PERF_RECORD_TIME = 1U << 2, | 103 | PERF_RECORD_TIME = 1U << 2, |
104 | PERF_RECORD_ADDR = 1U << 3, | 104 | PERF_RECORD_ADDR = 1U << 3, |
105 | PERF_RECORD_GROUP = 1U << 4, | 105 | PERF_RECORD_GROUP = 1U << 4, |
106 | PERF_RECORD_CALLCHAIN = 1U << 5, | 106 | PERF_RECORD_CALLCHAIN = 1U << 5, |
107 | PERF_RECORD_CONFIG = 1U << 6, | 107 | PERF_RECORD_CONFIG = 1U << 6, |
108 | PERF_RECORD_CPU = 1U << 7, | 108 | PERF_RECORD_CPU = 1U << 7, |
109 | }; | 109 | }; |
110 | 110 | ||
111 | /* | 111 | /* |
@@ -235,13 +235,13 @@ enum perf_event_type { | |||
235 | * correlate userspace IPs to code. They have the following structure: | 235 | * correlate userspace IPs to code. They have the following structure: |
236 | * | 236 | * |
237 | * struct { | 237 | * struct { |
238 | * struct perf_event_header header; | 238 | * struct perf_event_header header; |
239 | * | 239 | * |
240 | * u32 pid, tid; | 240 | * u32 pid, tid; |
241 | * u64 addr; | 241 | * u64 addr; |
242 | * u64 len; | 242 | * u64 len; |
243 | * u64 pgoff; | 243 | * u64 pgoff; |
244 | * char filename[]; | 244 | * char filename[]; |
245 | * }; | 245 | * }; |
246 | */ | 246 | */ |
247 | PERF_EVENT_MMAP = 1, | 247 | PERF_EVENT_MMAP = 1, |
@@ -249,27 +249,27 @@ enum perf_event_type { | |||
249 | 249 | ||
250 | /* | 250 | /* |
251 | * struct { | 251 | * struct { |
252 | * struct perf_event_header header; | 252 | * struct perf_event_header header; |
253 | * | 253 | * |
254 | * u32 pid, tid; | 254 | * u32 pid, tid; |
255 | * char comm[]; | 255 | * char comm[]; |
256 | * }; | 256 | * }; |
257 | */ | 257 | */ |
258 | PERF_EVENT_COMM = 3, | 258 | PERF_EVENT_COMM = 3, |
259 | 259 | ||
260 | /* | 260 | /* |
261 | * struct { | 261 | * struct { |
262 | * struct perf_event_header header; | 262 | * struct perf_event_header header; |
263 | * u64 time; | 263 | * u64 time; |
264 | * u64 irq_period; | 264 | * u64 irq_period; |
265 | * }; | 265 | * }; |
266 | */ | 266 | */ |
267 | PERF_EVENT_PERIOD = 4, | 267 | PERF_EVENT_PERIOD = 4, |
268 | 268 | ||
269 | /* | 269 | /* |
270 | * struct { | 270 | * struct { |
271 | * struct perf_event_header header; | 271 | * struct perf_event_header header; |
272 | * u64 time; | 272 | * u64 time; |
273 | * }; | 273 | * }; |
274 | */ | 274 | */ |
275 | PERF_EVENT_THROTTLE = 5, | 275 | PERF_EVENT_THROTTLE = 5, |
@@ -280,23 +280,23 @@ enum perf_event_type { | |||
280 | * will be PERF_RECORD_* | 280 | * will be PERF_RECORD_* |
281 | * | 281 | * |
282 | * struct { | 282 | * struct { |
283 | * struct perf_event_header header; | 283 | * struct perf_event_header header; |
284 | * | 284 | * |
285 | * { u64 ip; } && PERF_RECORD_IP | 285 | * { u64 ip; } && PERF_RECORD_IP |
286 | * { u32 pid, tid; } && PERF_RECORD_TID | 286 | * { u32 pid, tid; } && PERF_RECORD_TID |
287 | * { u64 time; } && PERF_RECORD_TIME | 287 | * { u64 time; } && PERF_RECORD_TIME |
288 | * { u64 addr; } && PERF_RECORD_ADDR | 288 | * { u64 addr; } && PERF_RECORD_ADDR |
289 | * { u64 config; } && PERF_RECORD_CONFIG | 289 | * { u64 config; } && PERF_RECORD_CONFIG |
290 | * { u32 cpu, res; } && PERF_RECORD_CPU | 290 | * { u32 cpu, res; } && PERF_RECORD_CPU |
291 | * | 291 | * |
292 | * { u64 nr; | 292 | * { u64 nr; |
293 | * { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP | 293 | * { u64 event, val; } cnt[nr]; } && PERF_RECORD_GROUP |
294 | * | 294 | * |
295 | * { u16 nr, | 295 | * { u16 nr, |
296 | * hv, | 296 | * hv, |
297 | * kernel, | 297 | * kernel, |
298 | * user; | 298 | * user; |
299 | * u64 ips[nr]; } && PERF_RECORD_CALLCHAIN | 299 | * u64 ips[nr]; } && PERF_RECORD_CALLCHAIN |
300 | * }; | 300 | * }; |
301 | */ | 301 | */ |
302 | }; | 302 | }; |
@@ -406,7 +406,7 @@ struct perf_mmap_data { | |||
406 | atomic_t wakeup; /* needs a wakeup */ | 406 | atomic_t wakeup; /* needs a wakeup */ |
407 | 407 | ||
408 | struct perf_counter_mmap_page *user_page; | 408 | struct perf_counter_mmap_page *user_page; |
409 | void *data_pages[0]; | 409 | void *data_pages[0]; |
410 | }; | 410 | }; |
411 | 411 | ||
412 | struct perf_pending_entry { | 412 | struct perf_pending_entry { |
@@ -422,7 +422,7 @@ struct perf_counter { | |||
422 | struct list_head list_entry; | 422 | struct list_head list_entry; |
423 | struct list_head event_entry; | 423 | struct list_head event_entry; |
424 | struct list_head sibling_list; | 424 | struct list_head sibling_list; |
425 | int nr_siblings; | 425 | int nr_siblings; |
426 | struct perf_counter *group_leader; | 426 | struct perf_counter *group_leader; |
427 | const struct pmu *pmu; | 427 | const struct pmu *pmu; |
428 | 428 | ||
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index ec9c4007a7f9..070f92d3232a 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -2576,7 +2576,7 @@ static void perf_log_throttle(struct perf_counter *counter, int enable) | |||
2576 | .time = sched_clock(), | 2576 | .time = sched_clock(), |
2577 | }; | 2577 | }; |
2578 | 2578 | ||
2579 | ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 0, 0); | 2579 | ret = perf_output_begin(&handle, counter, sizeof(throttle_event), 1, 0); |
2580 | if (ret) | 2580 | if (ret) |
2581 | return; | 2581 | return; |
2582 | 2582 | ||
@@ -3449,8 +3449,6 @@ void perf_counter_exit_task(struct task_struct *child) | |||
3449 | struct perf_counter_context *child_ctx; | 3449 | struct perf_counter_context *child_ctx; |
3450 | unsigned long flags; | 3450 | unsigned long flags; |
3451 | 3451 | ||
3452 | WARN_ON_ONCE(child != current); | ||
3453 | |||
3454 | child_ctx = child->perf_counter_ctxp; | 3452 | child_ctx = child->perf_counter_ctxp; |
3455 | 3453 | ||
3456 | if (likely(!child_ctx)) | 3454 | if (likely(!child_ctx)) |