Re: [BUG] perf_event: when events are grouped, the time enabled /running values are incorrect

From: Corey Ashford
Date: Wed May 12 2010 - 13:25:23 EST


On 05/11/2010 07:42 AM, Peter Zijlstra wrote:
---
Subject: perf: Fix exit() vs event-groups
From: Peter Zijlstra<a.p.zijlstra@xxxxxxxxx>
Date: Tue May 11 16:19:10 CEST 2010

Corey reported that the value scale times of group siblings are not
updated when the monitored task dies.

The problem appears to be that we only update the group leader's
time values, fix it by updating the whole group.

Reported-by: Corey Ashford<cjashfor@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Peter Zijlstra<a.p.zijlstra@xxxxxxxxx>
Cc: Paul Mackerras<paulus@xxxxxxxxx>
Cc: stable@xxxxxxxxxx
---
kernel/perf_event.c | 44 +++++++++++++++++++++++---------------------
1 file changed, 23 insertions(+), 21 deletions(-)

Index: linux-2.6/kernel/perf_event.c
===================================================================
--- linux-2.6.orig/kernel/perf_event.c
+++ linux-2.6/kernel/perf_event.c
@@ -255,6 +255,18 @@ static void update_event_times(struct pe
event->total_time_running = run_end - event->tstamp_running;
}

+/*
+ * Update total_time_enabled and total_time_running for all events in a group.
+ */
...

Peter,

Thanks for looking into this problem! Unfortunately, I've been unable to test your patch. It doesn't apply to 2.6.33.3 and so I tried the -tip tree (which has this patch committed). The kernel built fine, but crashed almost immediately during the boot-up process on my Power5 machine.

I don't have the crash details at hand, but they didn't look related to this perf change.

- Corey
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/