On Sat, 2011-04-23 at 22:36 +0800, Lin Ming wrote:
> On Sat, Apr 23, 2011 at 12:37 AM, David Ahern <[email protected]> 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 <[email protected]>
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 <[email protected]>
---
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
> > > 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?
i have done some quick tests with this patch applied on linus/master ... works
fine for me, thanks a lot!
> >From 89f1ab02cd8da55f8829b2f2d7e700fdae77b3af Mon Sep 17 00:00:00 2001
>
> From: Lin Ming <[email protected]>
> 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 <[email protected]>
Tested-by: Tim Blechmann <[email protected]>
cheers, tim
--
[email protected]
http://tim.klingt.org
When you open windows, bugs get in.
On 04/24/11 05:47, Tim Blechmann 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?
>
> i have done some quick tests with this patch applied on linus/master ... works
> fine for me, thanks a lot!
Works for me as well.
>
>> >From 89f1ab02cd8da55f8829b2f2d7e700fdae77b3af Mon Sep 17 00:00:00 2001
>>
>> From: Lin Ming <[email protected]>
>> 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 <[email protected]>
>
> Tested-by: Tim Blechmann <[email protected]>
>
> cheers, tim
>
On Sun, 2011-04-24 at 21:45 +0800, David Ahern wrote:
>
> On 04/24/11 05:47, Tim Blechmann 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?
> >
> > i have done some quick tests with this patch applied on linus/master ... works
> > fine for me, thanks a lot!
>
> Works for me as well.
Thanks for test.
I have send out the format patch.
http://marc.info/?l=linux-kernel&m=130365710014862&w=2
Lin Ming
>
> >
> >> >From 89f1ab02cd8da55f8829b2f2d7e700fdae77b3af Mon Sep 17 00:00:00 2001
> >>
> >> From: Lin Ming <[email protected]>
> >> 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 <[email protected]>
> >
> > Tested-by: Tim Blechmann <[email protected]>
> >
> > cheers, tim
> >