]> git.karo-electronics.de Git - karo-tx-linux.git/commit
perf_counter: Start counting time enabled when group leader gets enabled
authorPaul Mackerras <paulus@samba.org>
Tue, 25 Aug 2009 05:17:20 +0000 (15:17 +1000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 24 Sep 2009 15:43:55 +0000 (08:43 -0700)
commit9db85a343cebff62b7d9e3448502a64b26ee1164
tree4d5639929dbc4c70b11e2000bfb210047e2b07f6
parent986ddf533c1dd6852196182084aefe1ca9eda34e
perf_counter: Start counting time enabled when group leader gets enabled

commit fa289beca9de9119c7760bd984f3640da21bc94c upstream.

Currently, if a group is created where the group leader is
initially disabled but a non-leader member is initially
enabled, and then the leader is subsequently enabled some time
later, the time_enabled for the non-leader member will reflect
the whole time since it was created, not just the time since
the leader was enabled.

This is incorrect, because all of the members are effectively
disabled while the leader is disabled, since none of the
members can go on the PMU if the leader can't.

Thus we have to update the ->tstamp_enabled for all the enabled
group members when a group leader is enabled, so that the
time_enabled computation only counts the time since the leader
was enabled.

Similarly, when disabling a group leader we have to update the
time_enabled and time_running for all of the group members.

Also, in update_counter_times, we have to treat a counter whose
group leader is disabled as being disabled.

Reported-by: Stephane Eranian <eranian@googlemail.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <19091.29664.342227.445006@drongo.ozlabs.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
kernel/perf_counter.c