Skip to content

Commit

Permalink
perf: Honour event state for aux stream data
Browse files Browse the repository at this point in the history
commit 22e1908 upstream.

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>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Peter Zijlstra authored and Greg Kroah-Hartman committed Jan 25, 2010
1 parent b0a9392 commit 9607f06
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kernel/perf_event.c
Original file line number Diff line number Diff line change
Expand Up @@ -3229,6 +3229,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;

Expand Down Expand Up @@ -3344,6 +3347,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;

Expand Down Expand Up @@ -3471,6 +3477,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;

Expand Down

0 comments on commit 9607f06

Please sign in to comment.