diff options
author | Peter Zijlstra <peterz@infradead.org> | 2013-07-16 11:09:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-07-23 06:17:08 -0400 |
commit | a5cdd40c9877e9aba704c020fd65d26b5cfecf18 (patch) | |
tree | c982579a4e7dc506c16b822b02b768a28616af35 /kernel/events | |
parent | 17f41571bb2c4a398785452ac2718a6c5d77180e (diff) |
perf: Update perf_event_type documentation
Due to a discussion with Adrian I had a good look at the perf_event_type record
layout and found the documentation to be somewhat unclear.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20130716150907.GL23818@dyad.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 5e2bce90b477..127411400116 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -4462,20 +4462,6 @@ void perf_output_sample(struct perf_output_handle *handle, | |||
4462 | } | 4462 | } |
4463 | } | 4463 | } |
4464 | 4464 | ||
4465 | if (!event->attr.watermark) { | ||
4466 | int wakeup_events = event->attr.wakeup_events; | ||
4467 | |||
4468 | if (wakeup_events) { | ||
4469 | struct ring_buffer *rb = handle->rb; | ||
4470 | int events = local_inc_return(&rb->events); | ||
4471 | |||
4472 | if (events >= wakeup_events) { | ||
4473 | local_sub(wakeup_events, &rb->events); | ||
4474 | local_inc(&rb->wakeup); | ||
4475 | } | ||
4476 | } | ||
4477 | } | ||
4478 | |||
4479 | if (sample_type & PERF_SAMPLE_BRANCH_STACK) { | 4465 | if (sample_type & PERF_SAMPLE_BRANCH_STACK) { |
4480 | if (data->br_stack) { | 4466 | if (data->br_stack) { |
4481 | size_t size; | 4467 | size_t size; |
@@ -4511,16 +4497,31 @@ void perf_output_sample(struct perf_output_handle *handle, | |||
4511 | } | 4497 | } |
4512 | } | 4498 | } |
4513 | 4499 | ||
4514 | if (sample_type & PERF_SAMPLE_STACK_USER) | 4500 | if (sample_type & PERF_SAMPLE_STACK_USER) { |
4515 | perf_output_sample_ustack(handle, | 4501 | perf_output_sample_ustack(handle, |
4516 | data->stack_user_size, | 4502 | data->stack_user_size, |
4517 | data->regs_user.regs); | 4503 | data->regs_user.regs); |
4504 | } | ||
4518 | 4505 | ||
4519 | if (sample_type & PERF_SAMPLE_WEIGHT) | 4506 | if (sample_type & PERF_SAMPLE_WEIGHT) |
4520 | perf_output_put(handle, data->weight); | 4507 | perf_output_put(handle, data->weight); |
4521 | 4508 | ||
4522 | if (sample_type & PERF_SAMPLE_DATA_SRC) | 4509 | if (sample_type & PERF_SAMPLE_DATA_SRC) |
4523 | perf_output_put(handle, data->data_src.val); | 4510 | perf_output_put(handle, data->data_src.val); |
4511 | |||
4512 | if (!event->attr.watermark) { | ||
4513 | int wakeup_events = event->attr.wakeup_events; | ||
4514 | |||
4515 | if (wakeup_events) { | ||
4516 | struct ring_buffer *rb = handle->rb; | ||
4517 | int events = local_inc_return(&rb->events); | ||
4518 | |||
4519 | if (events >= wakeup_events) { | ||
4520 | local_sub(wakeup_events, &rb->events); | ||
4521 | local_inc(&rb->wakeup); | ||
4522 | } | ||
4523 | } | ||
4524 | } | ||
4524 | } | 4525 | } |
4525 | 4526 | ||
4526 | void perf_prepare_sample(struct perf_event_header *header, | 4527 | void perf_prepare_sample(struct perf_event_header *header, |