Re: [chrony-dev] [PATCH v2 2/2] refclock: Add a new "tai" option

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


It is also possible that a leap second is subtracted rather than added, and
the code should take that into account. (But by now, it is doubtful that any
negative leap seconds will occur in the future, unless perhaps there are a
bunch of really powerful earthquakes which change the moment of intertia of
the earth.


William G. Unruh __| Canadian Institute for|____ Tel: +1(604)822-3273
Physics&Astronomy _|___ Advanced Research _|____ Fax: +1(604)822-5324
UBC, Vancouver,BC _|_ Program in Cosmology |____ unruh@xxxxxxxxxxxxxx
Canada V6T 1Z1 ____|____ and Gravity ______|_ www.theory.physics.ubc.ca/

On Wed, 11 Oct 2017, Chris Perl wrote:

On Wed, Oct 11, 2017 at 10:55 AM, Miroslav Lichvar <mlichvar@xxxxxxxxxx> wrote:

On Tue, Oct 10, 2017 at 01:23:21PM -0400, Chris Perl wrote:
+  if (instance->tai) {
+    tai_offset = REF_GetTaiOffset(sample_time);

It turned out, this doesn't actually handle the case I mentioned
before. We want to get the offset for the reference time, not the
local system time. For instance, if chronyd was started with local
clock in year 2000, it should apply the current TAI-UTC offset and not
the one from 2000. It seems this requires two separate calls of
REF_GetTaiOffset(). One to get an approximate reference time in UTC
and then get the actual TAI-UTC offset.

I'll apply your patches with some minor modifications and add the
improved conversion in a separate commit.

Thanks!

Ah.  Thanks.

+    if (!tai_offset) {
+      DEBUG_LOG("refclock sample ignored unknown TAI offset");
+      return 0;
+    }
+
+    /* REF_GetTaiOffset returns the number of leap seconds that have
+       been inserted into UTC.  To get from TAI to UTC, we have to
+       remove those seconds from the sample */

Strictly speaking, the offset between TAI and UTC is not the number of
leap seconds that have been applied so far. The offset already started
at 10. I'll just remove the comment.

Right, sorry.  I was trying to come up with a decent comment for why
we were subtracting rather than adding.  If you think its unnecessary,
that is fine by me.

--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble?  Email listmaster@xxxxxxxxxxxxxxxxxxxx.


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/