Title | Inconsistent linearization of event times |
Status | open |
Priority | optional |
Assigned user | Nick Barnes |
Organization | Ravenbrook |
Description | The monitor converts the high-frequency timer value on each telemetry event to a wall-clock time, by linearizing between ClockSync events (which carry an mps_clock() wall-clock time). Because the mps_clock() values are discrete, the interval between consecutive ClockSync events may be understated or overstated. This can cause the intervals between each intervening event to be similarly under- or over- estimated. |
Analysis | See [1]. The worst case is several ClockSyncs with equal mps_clock values, causing all the intervening events to appear simultaneous. We handle this by disregarding ClockSyncs with matching clock values. The other case, of a rapid pair of ClockSyncs with different clock values, is somewhat harder. In a quick test I have seen effective TSC frequencies as low as 22 MHz (consecutive ClockSyncs differing by a millisecond clock tick and 22762 TSC cycles), where the true frequency is more like 3 GHz. We could put some heuristic bounds on the TSC frequency, and use those to correct the clock value's estimate of the true clock at each ClockSync (within the bounds established by the mps_clock() values), then linearise using those clock estimates rather than the raw clock values. |
How found | inspection |
Evidence | [1] https://info.ravenbrook.com/mail/2018/07/17/17-18-01/0/ |
Created by | Nick Barnes |
Created on | 2018-07-24 14:44:59 |
Last modified by | Nick Barnes |
Last modified on | 2018-07-24 14:44:59 |
History | 2018-07-24 NB Created. |