diff options
author | Steven Rostedt <[email protected]> | 2008-07-07 19:49:41 -0400 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2008-07-11 15:53:26 +0200 |
commit | 2b8a0cf4890d7537a77b51caa8f508e4a05a0e67 (patch) | |
tree | a591ef66a6340bf03e6380b6f2aa76ef2fc45ce2 /net/unix/sysctl_net_unix.c | |
parent | af52a90a14cdaa54ecbfb6e6982abb13466a4b56 (diff) |
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 <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: john stultz <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions