public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: Allow set output buffer for tasks in the same thread group
@ 2011-04-24 14:57 Lin Ming
  2011-04-24 17:05 ` Peter Zijlstra
  0 siblings, 1 reply; 10+ messages in thread
From: Lin Ming @ 2011-04-24 14:57 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Arnaldo Carvalho de Melo, Tim Blechmann, David Ahern,
	linux-kernel

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@klingt.org>
Tested-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.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:




^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2011-05-15 17:50 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-24 14:57 [PATCH] perf: Allow set output buffer for tasks in the same thread group Lin Ming
2011-04-24 17:05 ` Peter Zijlstra
2011-04-25 13:40   ` Lin Ming
2011-04-25 15:28     ` Arnaldo Carvalho de Melo
2011-04-26 20:44       ` [PATCH RFC] Fix per-task profiling " Arnaldo Carvalho de Melo
2011-04-26 21:28         ` David Ahern
2011-04-27  2:40         ` Lin Ming
2011-04-27 16:07           ` Arnaldo Carvalho de Melo
2011-05-15 17:49         ` [tip:perf/urgent] perf tools: Honour the cpu list parameter when also monitoring a thread list tip-bot for Arnaldo Carvalho de Melo
2011-05-15 17:49         ` [tip:perf/urgent] perf evlist: Fix per thread mmap setup tip-bot for Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox