[LinuxPPS] cross posting [time-nuts] NTP API on Linux 2.6.26

Hal V. Engel hvengel at astound.net
Sun Jan 11 10:42:00 CET 2009


On Sunday 11 January 2009 00:45:40 Udo van den Heuvel wrote:
> Hal V. Engel wrote:
> > You configure like this:
> >
> > ./configure LIBS="-lrt" <what ever options you need for your refclocks>
>
> Fedora's ntp rpm patches the makfiles like I posted for -lrt, does that
> have a similar effect?
>
> > If you parse through the output from the configure you should see:
> >
> > checking for clock_gettime... yes
> > checking for clock_settime... yes
>
> I see it with teh more or less stock fedora rpm.
>
> Still the precision is in 1.x us. Not 0.00x us....
>
> I use:
> Name        : glibc                        Relocations: (not relocatable)
> Version     : 2.9                               Vendor: Fedora Project
> Release     : 2                             Build Date: Fri 14 Nov 2008
> 12:41:55 AM CET
>
> So what could be lacking?
> How can I check why it doesn't give me the extra precision?
>
> Udo

Have you patched glibc with the nanosecond patch set located here 
http://sourceware.org/ml/libc-alpha/2008-03/msg00076.html ?  Without this or 
the ntp patch that Michael Meier posted to the list yesterday 
http://www.mulder.franken.de/blogfiles/timex.h ntp will only be capable to 
doing microsecond timing.

When I run ntptime I get: 

# ntptime
ntp_gettime() returns code 0 (OK)
  time cd137e25.947b02a0  Sat, Jan 10 2009 12:05:57.580, (.580002806),
  maximum error 8294508 us, estimated error 2 us, TAI offset 0
ntp_adjtime() returns code 0 (OK)
  modes 0x0 (),
  offset -0.426 us, frequency -39.298 ppm, interval 1 s,
  maximum error 8294508 us, estimated error 2 us,
  status 0x2001 (PLL,NANO),
  time constant 4, precision 0.001 us, tolerance 500 ppm,

The precision listed here is different from the precision you see in your sys 
log.  In this case it will be 1.000 us if ntp is running in microsecond mode 
and 0.001 us if ntp is in nanosecond mode.   And to change this you need to 
use one of the patches listed above.  I was seeing this even before I linked 
in librt and linking in librt will not change this.

Hal




More information about the LinuxPPS mailing list