adj_systeim()

Gary E. Miller gem at rellim.com
Mon Mar 13 06:32:46 UTC 2017


Yo Hal!

On Sun, 12 Mar 2017 17:05:25 -0700
Hal Murray <hmurray at megapathdsl.net> wrote:

> gem at rellim.com said:
> > Please check your system to see if adj_systime() is called on your
> > system. Eric thinks otherwise.   
> 
> I copied your printf from a previous message.
> 
> I have a whole screen full of
> adj_systime: hello! 0.000000000
> adj_systime: hello! 0.000000000
> adj_systime: hello! 0.000000000
> 
> ntp classic does the same.  (I didn't wait for a whole screen full.)


I get similar, and it looks like there is code in adj_systine() to
not call through ladjtime() if the aoofset is zero, whcih is what we both
see.

New experiment:

# strace -o tmp ntpd -n -N 

Then in another window:

# tail -f tmp | fgrep adjtim

after a while I get output like this:

adjtimex({modes=ADJ_OFFSET|ADJ_MAXERROR|ADJ_ESTERROR|ADJ_STATUS|ADJ_TIMECONST|ADJ_NANO, offset=35043, freq=-53631, maxerror=7937535, esterror=12, status=STA_PLL|STA_NANO, constant=3, precision=1, tolerance=32768000, time={1489386179, 875805785}, tick=10000, ppsfreq=0, jitter=0, shift=0, stabil=0, jitcnt=0, calcnt=0, errcnt=0, stbcnt=0, tai=37}) = 0 (TIME_OK)
adjtimex({modes=ADJ_OFFSET|ADJ_MAXERROR|ADJ_ESTERROR|ADJ_STATUS|ADJ_TIMECONST|ADJ_NANO, offset=26370, freq=-52787, maxerror=3937570, esterror=11, status=STA_PLL|STA_NANO, constant=3, precision=1, tolerance=32768000, time={1489386187, 875386592}, tick=10000, ppsfreq=0, jitter=0, shift=0, stabil=0, jitcnt=0, calcnt=0, errcnt=0, stbcnt=0, tai=37}) = 0 (TIME_OK)


And indeed adnjtimex() is called with ADH_OFFSET to set the clock and 
ADJ_NANO to do it with nanoseconds.

So adjtime() system calls never happen, but adjtimex() is.  Strange is that
nowhere in the ntp code ia there the string ADJ_OFFSET

But MOD_OFFSET is in two places:

ntpd/ntp_loopfilter.c:#define MOD_BITS (MOD_OFFSET | MOD_MAXERROR | MOD_ESTERROR | \

I missed that because of the non POSIX flag names.  Eric was right, now
I just need to figure out why adj_systime() is called when it is
never used.

Seems to me what ntpd needs is some trace type output so people can
see what ntpd is actually doing.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170312/9e0e9cc5/attachment.bin>


More information about the devel mailing list