perf: Honour event state for aux stream data
A message that is not in the archive (sent off-list or not yet received): 1263459187.4244.265.camel@laptop
Commit-ID: 22e190851f8709c48baf00ed9ce6144cdc54d025 Gitweb: http://git.kernel.org/tip/22e190851f8709c48baf00ed9ce6144cdc54d025 Author: Peter Zijlstra <[email protected]> AuthorDate: Mon, 18 Jan 2010 09:12:32 +0100 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 21 Jan 2010 13:40:40 +0100
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 <[email protected]>
Signed-off-by Peter Zijlstra <[email protected]>
Tested-by Anton Blanchard <[email protected]>
LKML-Reference: <1263459187.4244.265.camel@laptop>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/perf_event.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
kernel/perf_event.c +9 -0
@@ -3268,6 +3268,9 @@ static void perf_event_task_output(struct perf_event *event,static int perf_event_task_match (struct perf_event *event) { +if (event->state !=PERF_EVENT_STATE_ACTIVE ) +return 0 ; +if (event->cpu !=-1 && event->cpu !=smp_processor_id ())return 0 ;
@@ -3377,6 +3380,9 @@ static void perf_event_comm_output(struct perf_event *event,static int perf_event_comm_match (struct perf_event *event) { +if (event->state !=PERF_EVENT_STATE_ACTIVE ) +return 0 ; +if (event->cpu !=-1 && event->cpu !=smp_processor_id ())return 0 ;
@@ -3494,6 +3500,9 @@ static void perf_event_mmap_output(struct perf_event *event,static int perf_event_mmap_match (struct perf_event *event,struct perf_mmap_event *mmap_event) { +if (event->state !=PERF_EVENT_STATE_ACTIVE ) +return 0 ; +if (event->cpu !=-1 && event->cpu !=smp_processor_id ())return 0 ;