aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-01-18 03:12:32 -0500
committerIngo Molnar <mingo@elte.hu>2010-01-21 07:40:40 -0500
commit22e190851f8709c48baf00ed9ce6144cdc54d025 (patch)
tree52e4104e23a68282dce5dfe181c1234f8764bcd9
parentfe432200abb0d64f409895168d9ad8fbb9d8e6c6 (diff)
perf: Honour event state for aux stream data
Anton reported that perf record kept receiving events even after calling ioctl(PERF_EVENT_IOC_DISABLE). It turns out that FORK,COMM and MMAP events didn't respect the disabled state and kept flowing in. Reported-by: Anton Blanchard <anton@samba.org> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Tested-by: Anton Blanchard <anton@samba.org> LKML-Reference: <1263459187.4244.265.camel@laptop> CC: stable@kernel.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/perf_event.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 603c0d8b5df1..d27746bd3a06 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -3268,6 +3268,9 @@ static void perf_event_task_output(struct perf_event *event,
3268 3268
3269static int perf_event_task_match(struct perf_event *event) 3269static int perf_event_task_match(struct perf_event *event)
3270{ 3270{
3271 if (event->state != PERF_EVENT_STATE_ACTIVE)
3272 return 0;
3273
3271 if (event->cpu != -1 && event->cpu != smp_processor_id()) 3274 if (event->cpu != -1 && event->cpu != smp_processor_id())
3272 return 0; 3275 return 0;
3273 3276
@@ -3377,6 +3380,9 @@ static void perf_event_comm_output(struct perf_event *event,
3377 3380
3378static int perf_event_comm_match(struct perf_event *event) 3381static int perf_event_comm_match(struct perf_event *event)
3379{ 3382{
3383 if (event->state != PERF_EVENT_STATE_ACTIVE)
3384 return 0;
3385
3380 if (event->cpu != -1 && event->cpu != smp_processor_id()) 3386 if (event->cpu != -1 && event->cpu != smp_processor_id())
3381 return 0; 3387 return 0;
3382 3388
@@ -3494,6 +3500,9 @@ static void perf_event_mmap_output(struct perf_event *event,
3494static int perf_event_mmap_match(struct perf_event *event, 3500static int perf_event_mmap_match(struct perf_event *event,
3495 struct perf_mmap_event *mmap_event) 3501 struct perf_mmap_event *mmap_event)
3496{ 3502{
3503 if (event->state != PERF_EVENT_STATE_ACTIVE)
3504 return 0;
3505
3497 if (event->cpu != -1 && event->cpu != smp_processor_id()) 3506 if (event->cpu != -1 && event->cpu != smp_processor_id())
3498 return 0; 3507 return 0;
3499 3508