[ntp:questions] No PPSAPI WinNT with NMEA flag1 1 ntpd 4.2.7p238-o

Dave Hart hart at ntp.org
Wed Feb 8 08:40:24 UTC 2012


On Tue, Feb 7, 2012 at 01:11, Mark C. Stephens <marks at non-stop.com.au> wrote:
> ntpq> peer
>     remote           refid      st t when poll reach   delay   offset  jitter
> ==============================================================================
> *GPS_NMEA(1)     .GPS.            0 l    -   16  377    0.000   -0.145   0.006
> +ntp             .GPS.            1 s   44   64  376    0.285    0.624   0.051
>
> ntpq> rv 28263
> associd=28263 status=964a conf, reach, sel_sys.peer, 4 events, sys_peer,
> srcadr=GPS_NMEA(1), srcport=123, dstadr=127.0.0.1, dstport=123, leap=00,
> stratum=0, precision=-9, rootdelay=0.000, rootdisp=0.000, refid=GPS,
> reftime=d2daf4bf.814fa2d5  Tue, Feb  7 2012 11:54:23.505,
> rec=d2daf4c0.1efe3f37  Tue, Feb  7 2012 11:54:24.121, reach=377,
> unreach=0, hmode=3, pmode=4, hpoll=4, ppoll=4, headway=0, flash=00 ok,
> keyid=0, ttl=159, offset=-0.124, delay=0.000, dispersion=0.233,
> jitter=0.006,
> filtdelay=     0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00,
> filtoffset=   -0.12   -0.13   -0.13   -0.13   -0.13   -0.13   -0.13   -0.13,
> filtdisp=      0.00    0.24    0.48    0.72    0.96    1.20    1.44    1.68
> ntpq> cv 28263
> associd=28263 status=0011 1 event, clk_no_reply,
> device="NMEA GPS Clock", timecode="$GPZDA,005440,07,02,2012,+00,00",
> poll=1732, noreply=1, badformat=0, baddata=0, fudgetime2=-495.000,
> stratum=0, refid=GPS, flags=1
>
> ppsapi in use:
>
> C:\Program Files\NTP\bin>ntpd.exe -n  -M -N -c "C:\Program Files\NTP\etc\ntp.conf"
>  7 Feb 11:57:06 ntpd[2748]: ntpd 4.2.7p238-o Dec 10 4:46:28.43 (UTC-00:00) 2011  (1)
>  7 Feb 11:57:06 ntpd[2748]: Raised to realtime priority class
>  7 Feb 11:57:06 ntpd[2748]: MM timer resolution: 1..1000000 msec, set to 1 msec
>  7 Feb 11:57:06 ntpd[2748]: Performance counter frequency 1263.430 MHz
>  7 Feb 11:57:06 ntpd[2748]: Clock interrupt period 15.625 msec (startup slew 0.2 usec/period)
>  7 Feb 11:57:06 ntpd[2748]: Windows clock precision 15.625 msec, min. slew 6.400 ppm/s
>  7 Feb 11:57:06 ntpd[2748]: HZ 64.000 using 43 msec timer 23.256 Hz 64 deep
>  7 Feb 11:57:08 ntpd[2748]: proto: precision = 0.800 usec
>  7 Feb 11:57:08 ntpd[2748]: Listen and drop on 0 v4wildcard 0.0.0.0:123
>  7 Feb 11:57:09 ntpd[2748]: Listen normally on 1 NIC1 192.168.5.8:123
>  7 Feb 11:57:09 ntpd[2748]: Listen normally on 2 MS TCP Loopback interface 127.0.0.1:123
>  7 Feb 11:57:09 ntpd[2748]: peers refreshed
>  7 Feb 11:57:09 ntpd[2748]: GPS_NMEA(1) serial /dev/gps1 open at 9600 bps
> time_pps_create(4) got winhandle 00000620
> getenv(PPSAPI_DLLS) gives c:\serialpps\serialpps-ppsapi-provider\x86\serialpps-ppsapi-provider.dll
> loaded PPSAPI provider serialpps.sys, serial.sys with CD timestamping added caps 0x3011 provider 00B6F710
> serialpps prov_time_pps_create(00000620) returned 0

FYI 0 == success here

>  7 Feb 11:57:09 ntpd[2748]: 0.0.0.0 c012 02 freq_set ntpd 12.854 PPM
>  7 Feb 11:57:09 ntpd[2748]: 0.0.0.0 c016 06 restart
>  7 Feb 11:57:09 ntpd[2748]: DNS ntp.non-stop.com.au -> 192.168.5.112
>  7 Feb 11:57:09 ntpd[2748]: Using user-mode PPS timestamp for GPS_NMEA(1)
>  7 Feb 11:57:18 ntpd[2748]: 0.0.0.0 c61c 0c clock_step +0.171031 s
>  7 Feb 11:57:34 ntpd[2748]: HZ 64.000 using 43 msec timer 23.256 Hz 64 deep
>  7 Feb 11:57:36 ntpd[2748]: 0.0.0.0 c615 05 clock_sync
>  7 Feb 11:57:36 ntpd[2748]: 0.0.0.0 c618 08 no_sys_peer
>  7 Feb 11:58:24 ntpd[2748]: 0.0.0.0 0613 03 spike_detect -0.193186 s
>
> Config:
> keys "C:\Program Files\NTP\etc\ntp.key"
> trustedkey  <removed>
> requestkey <removed>
> controlkey <removed>
> driftfile "D:\NTP\ntp.drift"
> #
> # enable calibrate
> #
> #server 127.127.22.1 minpoll 4 maxpoll 4
> #fudge 127.127.22.1 time1 -0.525 flag3 1
> server 127.127.20.1 mode 24 minpoll 4 maxpoll 4 # prefer # noselect  # NMEA serial port, 16 = 9600 baud, 8 = $GPZDA
> fudge 127.127.20.1 flag1 1 time2 -0.495
> peer ntp.non-stop.com.au
> # Aussie time servers
> <removed>
> <removed>
> <removed>
> <removed>
> logconfig =clockevents +syncevents +sysevents +clockstatus +syncstatus +sysstatus +clockinfo +syncinfo +sysinfo +clockall +syncall +sysall
> enable stats
> statsdir D:\ntp\stats
> statistics loopstats peerstats clockstats

I'm baffled by the lack of 'o' for the PPS peer in ntpq output.  You
might double-check ntpq --version to be sure you're using a recent
one.  I think using a sufficiently old ntpq would result in seeing *
not o.

> Dave, does compiling in debug code affect performance and accuracy?

Not much.  In general, it means a bunch of code like this is compiled out:

#ifdef DEBUG
    if (debug >= X)
        printf("some trace output\n");
#endif DEBUG

which is sometimes written in the source as the functionally
equivalent but briefer

    /* in ntpd, which defines global debug only #ifdef DEBUG */
    DPRINTF(X, ("some trace output\n"));
    /* or, in libntp and utils, which always have the global debug */
    TRACE(X, ("some trace output\n"));

On Windows, the debug builds also use a debug C runtime which is
marginally slower due to extra checks which will do things like check
if a file descriptor passed to close() is already closed and trigger a
breakpoint (which does nothing if no debugger is attached) or popup
assertion dialog.

The reason it doesn't make much difference is ntpd uses so little CPU
either way when debug == 0, that is lacking -D or -d.

Cheers,
Dave Hart


More information about the questions mailing list