Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22e19085 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar
Browse files

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: default avatarAnton Blanchard <anton@samba.org>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: default avatarAnton Blanchard <anton@samba.org>
LKML-Reference: <1263459187.4244.265.camel@laptop>
CC: stable@kernel.org
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent fe432200
Loading
Loading
Loading
Loading
+9 −0
Original line number Original line Diff line number Diff line
@@ -3268,6 +3268,9 @@ static void perf_event_task_output(struct perf_event *event,


static int perf_event_task_match(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())
	if (event->cpu != -1 && event->cpu != smp_processor_id())
		return 0;
		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)
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())
	if (event->cpu != -1 && event->cpu != smp_processor_id())
		return 0;
		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,
static int perf_event_mmap_match(struct perf_event *event,
				   struct perf_mmap_event *mmap_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())
	if (event->cpu != -1 && event->cpu != smp_processor_id())
		return 0;
		return 0;