Re: [chrony-dev] [PATCH v2 2/2] refclock: Add a new "tai" option |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: Re: [chrony-dev] [PATCH v2 2/2] refclock: Add a new "tai" option
- From: Chris Perl <cperl@xxxxxxxxxxxxxx>
- Date: Wed, 11 Oct 2017 11:31:37 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=aLnsdK5GfTA7WNGjphHBR0nfLA3HHr3rbHv4pkUMUYY=; b=y+lxy7cA+HkZaPExTcRd+KGthH1b60ScnNUKe9g8yZkrgxNEeo1N/tLaLuXDQ/H1Ai pTSKQcXLKFAYzhj32iE6ddf5MvIE+Avg3FcnB9Fxc/G6i4fokGIa+5TeRAn7D+cEBno7 FAmbswuc8jzndT6XGrifEXT5qQKsYy65Ry0WY=
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.