Steven Rostedt 2b8a0cf489 sched_clock: fix calculation of other CPU
The algorithm to calculate the 'now' of another CPU is not correct.
At each scheduler tick, each CPU records the last sched_clock and
gtod (tick_raw and tick_gtod respectively). If the TSC is somewhat the
same in speed between two clocks the algorithm would be:

  tick_gtod1 + (now1 - tick_raw1) = tick_gtod2 + (now2 - tick_raw2)

To calculate now2 we would have:

  now2 = (tick_gtod1 - tick_gtod2) + (tick_raw2 - tick_raw1) + now1

Currently the algorithm is:

  now2 = (tick_gtod1 - tick_gtod2) + (tick_raw1 - tick_raw2) + now1

This solves most of the rest of the issues I've had with timestamps in
ftace.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: john stultz <johnstul@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-07-11 15:53:26 +02:00
..
2008-05-01 08:03:59 -07:00
2008-05-16 17:22:26 -04:00
2008-03-30 14:18:41 -07:00
2008-01-25 21:08:29 +01:00
2007-07-16 09:05:50 -07:00
2008-06-24 10:52:55 -05:00
2008-05-01 13:08:16 -04:00
2008-04-30 08:29:48 -07:00
2008-04-30 08:29:49 -07:00
2008-02-08 09:22:31 -08:00
2008-04-29 08:05:59 -07:00
2008-04-30 08:29:48 -07:00
2008-05-01 08:03:58 -07:00
2008-05-01 10:21:54 -07:00
2008-07-01 09:27:17 +02:00
2008-02-13 16:21:18 -08:00
2008-01-25 21:08:24 +01:00
2008-04-19 19:45:00 +02:00
2007-07-16 09:05:50 -07:00
2008-05-10 20:43:22 -07:00
2008-01-30 13:31:20 +01:00
2008-02-06 10:41:02 -08:00
2008-02-05 09:44:07 -08:00
2008-04-30 08:29:48 -07:00
2008-04-30 08:29:53 -07:00
2008-02-08 09:22:31 -08:00
2008-07-04 10:40:04 -07:00