[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1303657064.2239.25.camel@localhost>
Date: Sun, 24 Apr 2011 22:57:44 +0800
From: Lin Ming <ming.m.lin@...el.com>
To: Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc: Ingo Molnar <mingo@...e.hu>,
Arnaldo Carvalho de Melo <acme@...radead.org>,
Tim Blechmann <tim@...ngt.org>,
David Ahern <dsahern@...il.com>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: [PATCH] perf: Allow set output buffer for tasks in the same thread
group
Currently, kernel only allows an event to redirect its output to other
events of the same task.
This causes PERF_EVENT_IOC_SET_OUTPUT ioctl fails when an event is
trying to redirect its output to other events in the same thread group.
This patch fixes the bug reported at,
https://lkml.org/lkml/2011/4/6/499
Tested-by: Tim Blechmann <tim@...ngt.org>
Tested-by: David Ahern <dsahern@...il.com>
Signed-off-by: Lin Ming <ming.m.lin@...el.com>
---
kernel/perf_event.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 8e81a98..216a617 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -6379,9 +6379,12 @@ perf_event_set_output(struct perf_event *event, struct perf_event *output_event)
goto out;
/*
- * If its not a per-cpu buffer, it must be the same task.
+ * If its not a per-cpu buffer,
+ * it must be the same task or in the same thread group.
*/
- if (output_event->cpu == -1 && output_event->ctx != event->ctx)
+ if (output_event->cpu == -1 &&
+ !same_thread_group(output_event->ctx->task,
+ event->ctx->task))
goto out;
set:
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists