perf_counter: Complete counter swap
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Fri, 26 Jun 2009 11:10:23 +0000 (13:10 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 26 Jun 2009 15:48:54 +0000 (17:48 +0200)
Complete the counter swap by indeed switching the times too and
updating the userpage after modifying the counter values.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1246014623.31755.195.camel@twins>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_counter.c

index f2f2326965870aada63cbcf09681579d5597a099..66ab1e9d129468583869342f07c42bbbb674dfef 100644 (file)
@@ -1048,9 +1048,14 @@ static void __perf_counter_sync_stat(struct perf_counter *counter,
        value = atomic64_xchg(&counter->count, value);
        atomic64_set(&next_counter->count, value);
 
+       swap(counter->total_time_enabled, next_counter->total_time_enabled);
+       swap(counter->total_time_running, next_counter->total_time_running);
+
        /*
-        * XXX also sync time_enabled and time_running ?
+        * Since we swizzled the values, update the user visible data too.
         */
+       perf_counter_update_userpage(counter);
+       perf_counter_update_userpage(next_counter);
 }
 
 #define list_next_entry(pos, member) \