Context: the FFclock mechanism supports more than one kind of FF clock.
The foundation is the "native" FF clock (natFFC) synchronized by the
FFclock daemon. This clock is not guaranteed to be causal (monotonically
increasing). The FFclock therefore also makes available a monotonized
form (monoFFC), used as the basis of normal system clock read functions.
This commit improves the structure and clarity of the core FFclock code.
Comment blocks are improved throughout, including the consistent use of
natFFC and monoFFC terminology. The naming convention _lerp, and _LERP
for monoFF variables and constants is replaced by _mono and _MONO.
The majority of the changes are in the core function ffclock_windup.
It has been reorganised to improve :
- separation of natFFC and monoFFC processing
- separation of code needed for each tc-tick, from code which depends on whether the daemon has updated the natFFC data since the last tick.
- efficiency: some code was executed needlessly or repeatedly.
- alignment with the structure of ffclock_change_tc.
Addition of update code for a new bintime member, "tick_error", of
struct fftimehands, that tracks the evolution of a bound on the error
of natFCC. It is efficient to calculate this per-tick in ffclock_windup
leveraging existing calculations.
This member is used in sysclock_getsnapshot to reduce snapshot overhead,
down to zero in the fast case.
Other changes in ffclock_windup :
- gap_lerp replaced by the neater "gap".
- new verbosity to flag the exceptional jump case of monoFFC updating.
kern_tc.c:ffclock_init
- adding explicit null initialization of global ffclock_boottime