Page MenuHomeFreeBSD

FFclock: Addition of diffFFC to the FFclock family
Needs ReviewPublic

Authored by Darryl.Veitch_uts.edu.au on Dec 7 2023, 12:40 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Sep 5, 2:05 AM
Unknown Object (File)
Mon, Aug 26, 2:43 PM
Unknown Object (File)
Jul 11 2024, 5:14 AM
Unknown Object (File)
Jun 30 2024, 3:56 PM
Unknown Object (File)
May 9 2024, 11:39 AM
Unknown Object (File)
May 8 2024, 5:45 PM
Unknown Object (File)
May 8 2024, 1:23 PM
Unknown Object (File)
Feb 22 2024, 6:27 PM
Subscribers
None

Details

Reviewers
phk
imp
Summary

Context: The FFclock paradigm is a dual (absolute,difference) clock
design. The difference clock is defined as part of natFFC.
Reading a difference clock requires three quantities: {rts1,rts2,p}, to
enable the calculation of the time difference ∆T = p*(rts2-rts1), where
the value of p of the counter period must be local to the Raw TimeStamps
rts1, rts2 (which moreover must not be too far apart). To assist in
such difference clock reading, helper interfaces can be defined, for
example see kern_ffclock.c:ffclock_difftime.
This commit adds a new clock to the FFclock family, "diffFFC", to
support difference clock use via a traditional timestamp interface
consisting of a single absolute timestamp. Like natFFC, diffFFC tracks
absolute time per-tick using the counter period of natFFC, but the jumps
inherent in natFFC updates are excluded, as are leap seconds.
Thus diffFFC begins synchronized to UTC but will then gracefully drift
from it. It can be used to provide difference clock functionality via an
absolute timestamp interface via ∆T = ts2-ts1 where ts1, ts2 are two
diffFFC timestamps, with the added benefit that ts1, ts2 carry (roughly)
UTC meaning. The diffFFC is also monotonic and so can be used for
temporal ordering. The diffFFC should not be used for absolute timestamps,
instead natFFC or monoFFC are available.

A bintime member "tick_time_diff" is added to struct fftimehands
to hold the per-tick updated value of the diffFFC. Associated update
code is given in ffclock_windup.

To extent clock reading to the new FFclock, a FFCLOCK_DIFF flag value is
added in timeffc.h, and acted on in kern_tc.c functions
ffclock_last_tick, ffclock_convert_abs}, and sysclock_snap2bintime.
Improved comment blocks on the topic are given in timeffc.h and
kern_ffclock.c:ffclock_abstime.

Additionally in sysclock_snap2bintime:

  • addition of safeguards preventing incompatible flag combinations from producing flawed outputs, documented in the header comment block. In particular this ensures that the diffFFC comes in only a single flavour which obeys difference clock requirements.
  • bug: FAST flags were missing in some places (must make distinction between whether fast was used in the original capture, or here during defered conversion).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 54833
Build 51722: arc lint + arc unit