linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lin Ming <ming.m.lin@intel.com>
To: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
	Tim Blechmann <tim@klingt.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [2.6.39-rc2] perf top fails to mmap - bisected to 70db7533
Date: Sat, 23 Apr 2011 22:51:11 +0800	[thread overview]
Message-ID: <1303570271.3363.4.camel@localhost> (raw)
In-Reply-To: <BANLkTikWpnnHAfO2n2rN6ExtQyrsVaiqEQ@mail.gmail.com>

On Sat, 2011-04-23 at 22:36 +0800, Lin Ming wrote:
> On Sat, Apr 23, 2011 at 12:37 AM, David Ahern <dsahern@gmail.com> wrote:
> > I know you've been busy with other stuff the past few weeks, but have
> > you had a chance to look into this? Basically, perf in 2.6.39 is broken
> > when trying to profile a process (-p argument to record or top).
> 
> Let me take a look at this.

Below patch fixes the same problem on my box.
Could you have a try it? 

>From 89f1ab02cd8da55f8829b2f2d7e700fdae77b3af Mon Sep 17 00:00:00 2001
From: Lin Ming <ming.m.lin@intel.com>
Date: Sat, 23 Apr 2011 14:54:33 +0000
Subject: [PATCH] perf: Allow set output event for task in the same thread group

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
---
 kernel/perf_event.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index 8e81a98..17dbc49 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -6379,9 +6379,10 @@ 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:


> 
> Lin Ming
> 
> >
> > David



  parent reply	other threads:[~2011-04-23 14:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-06 10:51 [2.6.39-rc2] perf top fails to mmap Tim Blechmann
2011-04-06 15:20 ` David Ahern
2011-04-06 17:52   ` Arnaldo Carvalho de Melo
2011-04-06 20:48     ` Tim Blechmann
2011-04-06 22:15       ` David Ahern
2011-04-06 22:45         ` [2.6.39-rc2] perf top fails to mmap - bisected to 70db7533 David Ahern
2011-04-07  0:13           ` Arnaldo Carvalho de Melo
2011-04-22 16:37           ` David Ahern
2011-04-23 13:45             ` Lin Ming
     [not found]               ` <BANLkTikWpnnHAfO2n2rN6ExtQyrsVaiqEQ@mail.gmail.com>
2011-04-23 14:51                 ` Lin Ming [this message]
2011-04-24 11:47                   ` Tim Blechmann
2011-04-24 13:45                     ` David Ahern
2011-04-24 15:02                       ` Lin Ming

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1303570271.3363.4.camel@localhost \
    --to=ming.m.lin@intel.com \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tim@klingt.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).