+2000-09-04 Harlan Stenn <stenn@whimsy.udel.edu>
+
+ * ntpq/ntpq.c: report offset as "offset", not "phase". Lose
+ compliance.
+ * ntpd/refclock_local.c (local_poll): variance -> jitter
+ * ntpd/refclock_chu.c (chu_major): Lose variance.
+ * ntpd/ntp_util.c (hourly_stats): sys_error -> sys_jitter
+ (record_loop_stats): ditto
+ * ntpd/ntp_request.c (peer_info): variance -> jitter
+ * ntpd/ntp_refclock.c (refclock_sample): variance -> jitter
+ (refclock_receive): variance -> jitter
+ * ntpd/ntp_proto.c (process_packet): variance -> jitter
+ (clock_filter): variance -> jitter
+ (clock_select): variance -> jitter
+ (root_distance): variance -> jitter
+ * ntpd/ntp_peer.c (newpeer): variance -> jitter
+ * ntpd/ntp_loopfilter.c: Cleanup pll_nano selection bogon.
+ Centralize the kernel API data.
+ (local_clock): Lose sys_error.
+ (loop_config): Code cleanup.
+ * ntpd/ntp_control.c: Call offset "offset" and not "phase". Lose
+ CS_COMPLIANCE. Deal with variance/jitter rename.
+ * include/ntp_refclock.h: Rename variance to jitter in struct
+ refclockproc.
+ * include/ntp_control.h (CS_COMPLIANCE): Lose it.
+ * include/ntp.h: Rename variance to jitter in struct peer.
+ From: Dave Mills
+
2000-09-01 Harlan Stenn <stenn@whimsy.udel.edu>
* ntpd/refclock_atom.c: Use the new ppsunit. Cleanup and improve
#define BURST_INTERVAL2 1 /* succeeding interburst intervals (log2) */
/*
- * Operations for jitter (variance) calculations (these use doubles).
+ * Operations for jitter calculations (these use doubles).
*
* Note that we carefully separate the jitter component from the
* dispersion component (frequency error plus precision). The frequency
l_fp xmt; /* transmit time stamp */
double offset; /* peer clock offset */
double delay; /* peer roundtrip delay */
- double variance; /* peer variance (jitter) */
+ double jitter; /* peer jitter (squares) */
double disp; /* peer dispersion */
double estbdelay; /* clock offset to broadcast server */
#define CS_STATE 10
#define CS_OFFSET 11
#define CS_DRIFT 12
-#define CS_COMPLIANCE 13
-#define CS_JITTER 14
-#define CS_CLOCK 15
-#define CS_PROCESSOR 16
-#define CS_SYSTEM 17
-#define CS_VERSION 18
-#define CS_STABIL 19
-#define CS_VARLIST 20
+#define CS_JITTER 13
+#define CS_CLOCK 14
+#define CS_PROCESSOR 15
+#define CS_SYSTEM 16
+#define CS_VERSION 17
+#define CS_STABIL 18
+#define CS_VARLIST 19
#ifdef PUBKEY
-#define CS_FLAGS 21
-#define CS_HOST 22
-#define CS_PUBLIC 23
-#define CS_DHPARAMS 24
-#define CS_REVTIME 25
-#define CS_LEAPTAB 26
-#define CS_TAI 27
+#define CS_FLAGS 20
+#define CS_HOST 21
+#define CS_PUBLIC 22
+#define CS_DHPARAMS 23
+#define CS_REVTIME 24
+#define CS_LEAPTAB 25
+#define CS_TAI 26
#define CS_MAXCODE CS_TAI
#else
#define CS_MAXCODE CS_VARLIST
l_fp lastrec; /* local timestamp */
double offset; /* mean offset */
double disp; /* sample dispersion */
- double variance; /* sample variance */
+ double jitter; /* jitter (mean squares) */
double filter[MAXSTAGE]; /* median filter */
/*
{ CS_POLL, RO, "poll" }, /* 8 */
{ CS_PEERID, RO, "peer" }, /* 9 */
{ CS_STATE, RO, "state" }, /* 10 */
- { CS_OFFSET, RO, "phase" }, /* 11 */
+ { CS_OFFSET, RO, "offset" }, /* 11 */
{ CS_DRIFT, RO, "frequency" }, /* 12 */
- { CS_COMPLIANCE, RO, "error" }, /* 13 */
- { CS_JITTER, RO, "jitter" }, /* 14 */
- { CS_CLOCK, RO, "clock" }, /* 15 */
- { CS_PROCESSOR, RO, "processor" }, /* 16 */
- { CS_SYSTEM, RO, "system" }, /* 17 */
- { CS_VERSION, RO, "version" }, /* 18 */
- { CS_STABIL, RO, "stability" }, /* 19 */
- { CS_VARLIST, RO, "sys_var_list" }, /* 20 */
+ { CS_JITTER, RO, "jitter" }, /* 13 */
+ { CS_CLOCK, RO, "clock" }, /* 14 */
+ { CS_PROCESSOR, RO, "processor" }, /* 15 */
+ { CS_SYSTEM, RO, "system" }, /* 16 */
+ { CS_VERSION, RO, "version" }, /* 17 */
+ { CS_STABIL, RO, "stability" }, /* 18 */
+ { CS_VARLIST, RO, "sys_var_list" }, /* 19 */
#ifdef PUBKEY
- { CS_FLAGS, RO, "flags" }, /* 21 */
- { CS_HOST, RO, "hostname" }, /* 22 */
- { CS_PUBLIC, RO, "publickey" }, /* 23 */
- { CS_DHPARAMS, RO, "params" }, /* 24 */
- { CS_REVTIME, RO, "refresh"}, /* 25 */
- { CS_LEAPTAB, RO, "leaptable" }, /* 26 */
- { CS_TAI, RO, "tai"}, /* 27 */
+ { CS_FLAGS, RO, "flags" }, /* 20 */
+ { CS_HOST, RO, "hostname" }, /* 21 */
+ { CS_PUBLIC, RO, "publickey" }, /* 22 */
+ { CS_DHPARAMS, RO, "params" }, /* 23 */
+ { CS_REVTIME, RO, "refresh"}, /* 24 */
+ { CS_LEAPTAB, RO, "leaptable" }, /* 25 */
+ { CS_TAI, RO, "tai"}, /* 26 */
#endif /* PUBKEY */
{ 0, EOV, "" }
};
CS_CLOCK,
CS_STATE,
CS_OFFSET,
- CS_COMPLIANCE,
- CS_JITTER,
CS_DRIFT,
+ CS_JITTER,
CS_STABIL,
#ifdef PUBKEY
CS_FLAGS,
CP_ROOTDISPERSION,
CP_REFID,
CP_REFTIME,
- CP_DELAY,
CP_OFFSET,
- CP_JITTER,
+ CP_DELAY,
CP_DISPERSION,
+ CP_JITTER,
CP_REACH,
CP_VALID,
CP_HMODE,
ctl_putdbl(sys_var[CS_DRIFT].text, drift_comp * 1e6);
break;
- case CS_COMPLIANCE:
- ctl_putdbl(sys_var[CS_COMPLIANCE].text, sys_error *
- 1e3);
- break;
-
case CS_JITTER:
ctl_putdbl(sys_var[CS_JITTER].text, sys_jitter * 1e3);
break;
case CP_JITTER:
ctl_putdbl(peer_var[CP_JITTER].text,
- SQRT(peer->variance) * 1e3);
+ SQRT(peer->jitter) * 1e3);
break;
case CP_DISPERSION:
static void rstclock P((int)); /* state transition function */
#ifdef KERNEL_PLL
-int pll_status; /* status bits for kernel pll */
+struct timex ntv; /* kernel API parameters */
+int pll_status; /* status bits for kernel pll */
+int pll_nano; /* nanosecond kernel switch */
#endif /* KERNEL_PLL */
/*
int allow_set_backward = TRUE; /* step corrections allowed */
int correct_any = FALSE; /* corrections > 1000 s allowed */
-#ifdef STA_NANO
-int pll_nano; /* nanosecond kernel switch */
-#endif /* STA_NANO */
-
/*
* Clock state machine variables
*/
u_long last_time; /* time of last clock update (s) */
double last_offset; /* last clock offset (s) */
double allan_xpt; /* Allan intercept (s) */
-double sys_error; /* system RMS error (s) */
double sys_jitter; /* system RMS jitter (s) */
#if defined(KERNEL_PLL)
double dtemp, etemp; /* double temps */
int retval; /* return value */
-#if defined(KERNEL_PLL)
- struct timex ntv; /* kernel interface structure */
-#endif /* KERNEL_PLL */
-
#ifdef DEBUG
if (debug)
printf(
dtemp = -.5;
else
dtemp = .5;
-#ifdef STA_NANO
- if (pll_nano)
+ if (pll_nano) {
ntv.offset = (int32)(clock_offset *
1e9 + dtemp);
- else
-#endif /* STA_NANO */
+ ntv.constant = sys_poll;
+ } else {
ntv.offset = (int32)(clock_offset *
1e6 + dtemp);
+ ntv.constant = sys_poll - 4;
+ }
if (clock_frequency != 0) {
ntv.modes |= MOD_FREQUENCY;
ntv.freq = (int32)((clock_frequency +
drift_comp) * 65536e6);
}
-#ifdef STA_NANO
- ntv.constant = sys_poll;
-#else
- ntv.constant = sys_poll - 4;
-#endif /* STA_NANO */
- ntv.esterror = (u_int32)(sys_error * 1e6);
+ ntv.esterror = (u_int32)(sys_jitter * 1e6);
ntv.maxerror = (u_int32)((sys_rootdelay / 2 +
sys_rootdispersion) * 1e6);
ntv.status = STA_PLL;
if (ntp_adjtime(&ntv) == TIME_ERROR) {
if (ntv.status != pll_status)
msyslog(LOG_ERR,
- "kernel pll status change %x",
+ "kernel time discipline status change %x",
ntv.status);
}
pll_status = ntv.status;
-#ifdef STA_NANO
- if (pll_nano)
+ if (pll_nano) {
clock_offset = ntv.offset / 1e9;
- else
-#endif /* STA_NANO */
+ sys_poll = ntv.constant;
+ } else {
clock_offset = ntv.offset / 1e6;
-#ifdef STA_NANO
- sys_poll = ntv.constant;
-#else
- sys_poll = ntv.constant + 4;
-#endif /* STA_NANO */
+ sys_poll = ntv.constant + 4;
+ }
clock_frequency = ntv.freq / 65536e6 - drift_comp;
flladj = plladj = 0;
NLOG(NLOG_SYSEVENT)msyslog(LOG_INFO,
"pps sync enabled");
pps_control = current_time;
-#ifdef STA_NANO
if (pll_nano)
sys_jitter = ntv.jitter / 1e9;
else
-#endif /* STA_NANO */
sys_jitter = ntv.jitter / 1e6;
sys_poll = ntv.shift;
}
*/
last_time = current_time;
last_offset = clock_offset;
- dtemp = SQUARE(sys_error);
- sys_error = SQRT(dtemp + (SQUARE(last_offset) - dtemp) /
- CLOCK_AVG);
- dtemp = peer->disp + SQRT(peer->variance + SQUARE(sys_jitter));
+ dtemp = peer->disp + SQRT(peer->jitter + SQUARE(sys_jitter));
if ((peer->flags & FLAG_REFCLOCK) == 0 && dtemp < MINDISPERSE)
dtemp = MINDISPERSE;
sys_rootdispersion = peer->rootdispersion + dtemp;
#ifdef DEBUG
if (debug > 1)
printf(
- "local_clock: err %.6f jit %.6f freq %.3f stab %.3f poll %d cnt %d\n",
- sys_error, sys_jitter, drift_comp * 1e6,
- clock_stability * 1e6, sys_poll, tc_counter);
+ "local_clock: jit %.6f freq %.3f stab %.3f poll %d cnt %d\n",
+ sys_jitter, drift_comp * 1e6, clock_stability * 1e6,
+ sys_poll, tc_counter);
#endif /* DEBUG */
return (retval);
}
double freq
)
{
-#if defined(KERNEL_PLL)
- struct timex ntv;
-#endif /* KERNEL_PLL */
-#ifdef DEBUG
- if (debug)
- printf("loop_config: state %d freq %.3f\n", item, freq *
- 1e6);
-#endif
switch (item) {
-
case LOOP_DRIFTINIT:
- case LOOP_DRIFTCOMP:
- /*
- * The drift file is present and the initial frequency
- * is available, so set the state to S_FSET
- */
- rstclock(S_FSET);
- drift_comp = freq;
- if (drift_comp > NTP_MAXFREQ)
- drift_comp = NTP_MAXFREQ;
- if (drift_comp < -NTP_MAXFREQ)
- drift_comp = -NTP_MAXFREQ;
#ifdef KERNEL_PLL
/*
- * If the phase-lock code is implemented in the kernel,
- * give the time_constant and saved frequency offset to
- * the kernel. If not, no harm is done. Note the initial
- * time constant is zero, but the first clock update
- * will fix that.
+ * Assume the kernel supports the ntp_adjtime() syscall.
+ * If that syscall works, initialize the kernel
+ * variables. Otherwise, continue leaving no harm
+ * behind. While at it, ask to set nanosecond mode. If
+ * the kernel agrees, rejoice; othewise, it does only
+ * microseconds.
*/
- memset((char *)&ntv, 0, sizeof ntv);
pll_control = 1;
-#ifdef MOD_NANO
+ memset((char *)&ntv, 0, sizeof ntv);
+#if NTP_API > 3
ntv.modes = MOD_NANO;
-#endif /* MOD_NANO */
+#endif /* NTP_API */
+
#ifdef SIGSYS
+ /*
+ * Use sigsetjmp() to save state and then call
+ * ntp_adjtime(); if it fails, then siglongjmp() is used
+ * to return control
+ */
newsigsys.sa_handler = pll_trap;
newsigsys.sa_flags = 0;
if (sigaction(SIGSYS, &newsigsys, &sigsys)) {
msyslog(LOG_ERR,
"sigaction() fails to save SIGSYS trap: %m");
pll_control = 0;
- return;
}
-
- /*
- * Use sigsetjmp() to save state and then call
- * ntp_adjtime(); if it fails, then siglongjmp() is used
- * to return control
- */
if (sigsetjmp(env, 1) == 0)
(void)ntp_adjtime(&ntv);
if ((sigaction(SIGSYS, &sigsys,
msyslog(LOG_ERR,
"sigaction() fails to restore SIGSYS trap: %m");
pll_control = 0;
- return;
}
#else /* SIGSYS */
if (ntp_adjtime(&ntv) < 0) {
pll_control = 0;
}
#endif /* SIGSYS */
+#if NTP_API > 3
+ if (pll_control) {
+ if (ntv.status & STA_NANO)
+ pll_nano = 1;
+ if (ntv.status & STA_CLK)
+ ext_enable = 1;
+ }
+#endif /* NTP_API */
+#endif /* KERNEL_PLL */
+ break;
+
+ case LOOP_DRIFTCOMP:
/*
- * If the kernel support is available and enabled,
- * initialize the parameters, but only if the external
- * clock is not present.
+ * Initialize the kernel frequency and clamp to
+ * reasonable value. Also set the initial state to
+ * S_FSET to indicated the frequency has been
+ * initialized from the previously saved drift file.
*/
- if (pll_control && kern_enable) {
- msyslog(LOG_NOTICE,
- "using kernel phase-lock loop %04x",
- ntv.status);
-#ifdef STA_NANO
- if (ntv.status & STA_NANO)
- pll_nano = 1;
-#endif /* STA_NANO */
-#ifdef STA_CLK
+ rstclock(S_FSET);
+ drift_comp = freq;
+ if (drift_comp > NTP_MAXFREQ)
+ drift_comp = NTP_MAXFREQ;
+ if (drift_comp < -NTP_MAXFREQ)
+ drift_comp = -NTP_MAXFREQ;
- if (ntv.status & STA_CLK) {
- ext_enable = 1;
- } else {
- ntv.modes = MOD_BITS | MOD_FREQUENCY;
+#ifdef KERNEL_PLL
+ /*
+ * If the kernel support is available. initialize the
+ * parameters. If an external clock is present, it
+ * should be initialized and the STA_CLK bit set before
+ * NTP is started. If the kernel has been running for
+ * awhile and the offset and frequency previously set,
+ * but the kernel is explicitly disabled, scratch the
+ * previous offset and frequency values, but leave the
+ * time constant alone.
+ */
+ if (pll_control) {
+ memset((char *)&ntv, 0, sizeof ntv);
+ ntv.modes = MOD_BITS | MOD_FREQUENCY;
+ if (kern_enable) {
+ msyslog(LOG_NOTICE,
+ "using kernel time discipline %04x",
+ ntv.status);
ntv.freq = (int32)(drift_comp *
65536e6);
- ntv.maxerror = MAXDISPERSE;
- ntv.esterror = MAXDISPERSE;
- ntv.status = STA_UNSYNC | STA_PLL;
- (void)ntp_adjtime(&ntv);
+ } else {
+ msyslog(LOG_NOTICE,
+ "kernel time discipline disabled %04x",
+ ntv.status);
+ ntv.freq = 0;
}
-#else
- ntv.modes = MOD_BITS | MOD_FREQUENCY;
- ntv.freq = (int32)(drift_comp * 65536e6);
ntv.maxerror = MAXDISPERSE;
ntv.esterror = MAXDISPERSE;
ntv.status = STA_UNSYNC | STA_PLL;
(void)ntp_adjtime(&ntv);
-#endif /* STA_CLK */
+
+ } else {
+ msyslog(LOG_NOTICE,
+ "using NTP daemon time discipline");
}
+ break;
#endif /* KERNEL_PLL */
}
}
peer->ttl = ttl;
peer->leap = LEAP_NOTINSYNC;
peer->precision = sys_precision;
- peer->variance = MAXDISPERSE;
+ peer->jitter = MAXDISPERSE;
peer->epoch = current_time;
peer->stratum = STRATUM_UNSPEC;
peer_clear(peer);
clock_select();
record_peer_stats(&peer->srcadr, ctlpeerstatus(peer),
peer->offset, peer->delay, peer->disp,
- SQRT(peer->variance));
+ SQRT(peer->jitter));
}
peer->estbdelay = sys_bdelay;
peer->hpoll = peer->minpoll;
peer->pollsw = FALSE;
- peer->variance = MAXDISPERSE;
+ peer->jitter = MAXDISPERSE;
peer->epoch = current_time;
for (i = 0; i < NTP_SHIFT; i++) {
peer->filter_order[i] = i;
register int i, j, k, n;
register u_char *ord;
double distance[NTP_SHIFT];
- double off, dly, var, dsp, dtemp, etemp;
+ double off, dly, dsp, jit, dtemp, etemp;
/*
* Update error bounds and calculate distances. The distance for
}
/*
- * Compute the offset, delay, variance (squares) and error
- * bound. The offset, delay and variance are weighted by the
+ * Compute the offset, delay, jitter (squares) and error
+ * bound. The offset, delay and jitter are weighted by the
* reciprocal of distance and normalized. The error bound is
* weighted exponentially. When no acceptable samples remain in
* the shift register, quietly tiptoe home.
*/
- off = dly = var = dsp = dtemp = 0;
+ off = dly = dsp = jit = dtemp = 0;
for (i = NTP_SHIFT - 1; i >= 0; i--) {
dsp = NTP_FWEIGHT * (dsp + peer->filter_disp[ord[i]]);
if (i < n && distance[i] < MAXDISTANCE) {
distance[i];
dly += peer->filter_delay[ord[i]] /
distance[i];
- var += DIFF(peer->filter_offset[ord[i]],
+ jit += DIFF(peer->filter_offset[ord[i]],
peer->filter_offset[ord[0]]) /
SQUARE(distance[i]);
}
if (dtemp == 0)
return;
peer->delay = dly / dtemp;
- peer->variance = min(var / SQUARE(dtemp), MAXDISPERSE);
peer->disp = min(dsp, MAXDISPERSE);
+ peer->jitter = min(jit / SQUARE(dtemp), MAXDISPERSE);
peer->epoch = current_time;
etemp = peer->offset;
peer->offset = off / dtemp;
#ifdef DEBUG
if (debug)
printf(
- "clock_filter: offset %.6f delay %.6f disp %.6f std %.6f, age %lu\n",
+ "clock_filter: offset %.6f delay %.6f disp %.6f jit %.6f, age %lu\n",
peer->offset, peer->delay, peer->disp,
- SQRT(peer->variance), current_time - peer->epoch);
+ SQRT(peer->jitter), current_time - peer->epoch);
#endif
}
*/
for (i = 0; i < nlist; i++) {
peer = peer_list[i];
- error[i] = peer->variance;
+ error[i] = peer->jitter;
if (i < NTP_CANCLOCK)
peer->status = CTL_PST_SEL_SELCAND;
else
sys_peer = typeprefer;
sys_peer->status = CTL_PST_SEL_SYSPEER;
sys_offset = sys_peer->offset;
- sys_epsil = sys_peer->variance;
+ sys_epsil = sys_peer->jitter;
#ifdef DEBUG
if (debug > 2)
printf("select: prefer offset %.6f\n",
sys_peer = typepps;
sys_peer->status = CTL_PST_SEL_PPS;
sys_offset = sys_peer->offset;
- sys_epsil = sys_peer->variance;
+ sys_epsil = sys_peer->jitter;
if (!pps_control)
NLOG(NLOG_SYSEVENT) /* conditional syslog */
msyslog(LOG_INFO, "pps sync enabled");
sys_peer = peer_list[0];
sys_peer->status = CTL_PST_SEL_SYSPEER;
sys_offset = clock_combine(peer_list, nlist);
- sys_epsil = sys_peer->variance + sys_maxd;
+ sys_epsil = sys_peer->jitter + sys_maxd;
#ifdef DEBUG
if (debug > 2)
printf("select: combine offset %.6f\n",
{
return ((fabs(peer->delay) + peer->rootdelay) / 2 +
peer->rootdispersion + peer->disp +
- SQRT(peer->variance) + CLOCK_PHI * (current_time -
+ SQRT(peer->jitter) + CLOCK_PHI * (current_time -
peer->update));
}
*
* This routine implements a recursive median filter to suppress spikes
* in the data, as well as determine a performance statistic. It
- * calculates the mean offset and mean-square variance. A time
- * adjustment fudgetime1 can be added to the final offset to compensate
- * for various systematic errors. The routine returns the number of
- * samples processed, which could be 0.
+ * calculates the mean offset and jitter (squares). A time adjustment
+ * fudgetime1 can be added to the final offset to compensate for various
+ * systematic errors. The routine returns the number of samples
+ * processed, which could be zero.
*/
static int
refclock_sample(
struct refclockproc *pp
)
{
- int i, j, k, n;
- double offset, disp;
+ int i, j, k, m, n;
+ double offset, jitter;
double off[MAXSTAGE];
/*
* approximately 60 percent of the samples remain.
*/
i = 0; j = n;
- k = n - (n * 2) / NSTAGE;
- while ((j - i) > k) {
+ m = n - (n * 2) / NSTAGE;
+ while ((j - i) > m) {
offset = off[(j + i) / 2];
if (off[j - 1] - offset < offset - off[i])
i++; /* reject low end */
}
/*
- * Determine the offset and variance.
+ * Determine the offset and jitter.
*/
- offset = disp = 0;
- for (; i < j; i++) {
- offset += off[i];
- disp += SQUARE(off[i]);
+ offset = jitter = 0;
+ for (k = i; k < j; k++) {
+ offset += off[k];
+ if (k > i)
+ jitter += SQUARE(off[k] - off[k - 1]);
}
- offset /= k;
- pp->offset = offset;
- pp->variance = disp / k - SQUARE(offset);
+ pp->offset = offset / m;
+ pp->jitter = jitter / m;
#ifdef DEBUG
if (debug)
printf(
- "refclock_sample: n %d offset %.6f disp %.6f std %.6f\n",
- n, pp->offset, pp->disp, SQRT(pp->variance));
+ "refclock_sample: n %d offset %.6f disp %.6f jitter %.6f\n",
+ n, pp->offset, pp->disp, SQRT(pp->jitter));
#endif
return (n);
}
report_event(EVNT_REACH, peer);
peer->reach |= 1;
peer->reftime = peer->org = pp->lastrec;
- peer->rootdispersion = pp->disp + SQRT(pp->variance);
+ peer->rootdispersion = pp->disp + SQRT(pp->jitter);
get_systime(&peer->rec);
if (!refclock_sample(pp))
return;
clock_select();
record_peer_stats(&peer->srcadr, ctlpeerstatus(peer),
peer->offset, peer->delay, CLOCK_PHI * (current_time -
- peer->epoch), SQRT(peer->variance));
+ peer->epoch), SQRT(peer->jitter));
if (pps_control && pp->sloppyclockflag & CLK_FLAG1)
pp->fudgetime1 -= pp->offset * FUDGEFAC;
}
HTONL_FP(<mp, &ip->offset);
ip->delay = HTONS_FP(DTOFP(pp->delay));
ip->dispersion = HTONS_FP(DTOUFP(SQRT(pp->disp)));
- ip->selectdisp = HTONS_FP(DTOUFP(SQRT(pp->variance)));
+ ip->selectdisp = HTONS_FP(DTOUFP(SQRT(pp->jitter)));
ip = (struct info_peer *)more_pkt();
}
flush_pkt();
extern double sys_bdelay;
extern l_fp sys_authdelay;
extern double clock_stability;
- extern double sys_error;
+ extern double sys_jitter;
is = (struct info_sys *)prepare_pkt(srcadr, inter, inpkt,
sizeof(struct info_sys));
is->precision = sys_precision;
is->rootdelay = htonl(DTOFP(sys_rootdelay));
is->rootdispersion = htonl(DTOUFP(sys_rootdispersion));
- is->frequency = htonl(DTOFP(sys_error));
+ is->frequency = htonl(DTOFP(sys_jitter));
is->stability = htonl(DTOUFP(clock_stability * 1e6));
is->refid = sys_refid;
HTONL_FP(&sys_reftime, &is->reftime);
NLOG(NLOG_SYSSTATIST)
msyslog(LOG_INFO,
"offset %.6f sec freq %.3f ppm error %.6f poll %d",
- last_offset, drift_comp * 1e6, sys_error, sys_poll);
+ last_offset, drift_comp * 1e6, sys_jitter, sys_poll);
+
if (stats_drift_file != 0) {
if ((fp = fopen(stats_temp_file, "w")) == NULL) {
if (loopstats.fp != NULL) {
fprintf(loopstats.fp, "%lu %lu.%03lu %.9f %.6f %.9f %.6f %d\n",
day, sec, msec, last_offset, drift_comp * 1e6,
- sys_error, clock_stability * 1e6, sys_poll);
+ sys_jitter, clock_stability * 1e6, sys_poll);
fflush(loopstats.fp);
}
}
return (0);
}
pp->lastref = offset;
- pp->variance = 0;
for (i = 0; i < up->ntstamp; i++) {
toffset = offset;
L_SUB(&toffset, &up->tstamp[i]);
refclock_process_offset(pp, pp->lastrec, pp->lastrec, pp->fudgetime1);
pp->leap = LEAP_NOWARNING;
pp->disp = DISPERSION;
- pp->variance = 0;
+ pp->jitter = 0;
#if defined(KERNEL_PLL) && defined(STA_CLK)
/*
pp->leap = LEAP_NOTINSYNC;
}
pp->disp = ntv.maxerror / 1e6;
- pp->variance = SQUARE(ntv.esterror / 1e6);
+ pp->jitter = SQUARE(ntv.esterror / 1e6);
}
} else {
ext_enable = 0;
{ CS_POLL, UI, "poll" }, /* 8 */
{ CS_PEERID, UI, "peer" }, /* 9 */
{ CS_STATE, UI, "state" }, /* 10 */
- { CS_OFFSET, FL, "phase" }, /* 11 */
+ { CS_OFFSET, FL, "offset" }, /* 11 */
{ CS_DRIFT, FS, "frequency" }, /* 12 */
- { CS_COMPLIANCE, FU, "error" }, /* 13 */
- { CS_JITTER, FU, "jitter" }, /* 14 */
- { CS_CLOCK, TS, "clock" }, /* 15 */
- { CS_PROCESSOR, ST, "processor" }, /* 16 */
- { CS_SYSTEM, ST, "system" }, /* 17 */
- { CS_VERSION, ST, "version" }, /* 18 */
- { CS_STABIL, FS, "stability" }, /* 19 */
- { CS_VARLIST, ST, "sys_var_list" }, /* 20 */
+ { CS_JITTER, FU, "jitter" }, /* 13 */
+ { CS_CLOCK, TS, "clock" }, /* 14 */
+ { CS_PROCESSOR, ST, "processor" }, /* 15 */
+ { CS_SYSTEM, ST, "system" }, /* 16 */
+ { CS_VERSION, ST, "version" }, /* 17 */
+ { CS_STABIL, FS, "stability" }, /* 18 */
+ { CS_VARLIST, ST, "sys_var_list" }, /* 19 */
{ 0, EOV, "" }
};