From: Harlan Stenn Date: Fri, 11 May 2001 05:31:03 +0000 (-0000) Subject: ChangeLog, ntpd.h, ntp_loopfilter.c, ntp_util.c: X-Git-Tag: NTP_4_0_99_M~21 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=035d25052effcd62f5bd71c303651d14bd2a3678;p=thirdparty%2Fntp.git ChangeLog, ntpd.h, ntp_loopfilter.c, ntp_util.c: * ntpd/ntp_util.c (record_loop_stats): values are now passed in. * ntpd/ntp_loopfilter.c (local_clock): pass the values to record_loop_stats(). * include/ntpd.h: Pass the parameters in to record_loop_stats(). With the discipline loop opened (disable ntp) the local clock updates were not being sent to loopstats. That now is. From: Dave Mills. bk: 3afb79171xQZrjYWQ7nhu62nkEO64g --- diff --git a/ChangeLog b/ChangeLog index 4c678afcb1..7721a9f70b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2001-05-11 Harlan Stenn + + * ntpd/ntp_util.c (record_loop_stats): values are now passed in. + * ntpd/ntp_loopfilter.c (local_clock): pass the values to + record_loop_stats(). + * include/ntpd.h: Pass the parameters in to record_loop_stats(). + With the discipline loop opened (disable ntp) the local clock + updates were not being sent to loopstats. That now is. + From: Dave Mills. + 2001-05-10 Harlan Stenn * configure.in: 4.0.99k33 diff --git a/include/ntpd.h b/include/ntpd.h index 60f877b72a..067947b7d4 100644 --- a/include/ntpd.h +++ b/include/ntpd.h @@ -191,7 +191,7 @@ extern void init_util P((void)); extern void hourly_stats P((void)); extern void stats_config P((int, char *)); extern void record_peer_stats P((struct sockaddr_in *, int, double, double, double, double)); -extern void record_loop_stats P((void)); +extern void record_loop_stats P((double, double, double, double, int)); extern void record_clock_stats P((struct sockaddr_in *, const char *)); extern void record_raw_stats P((struct sockaddr_in *, struct sockaddr_in *, l_fp *, l_fp *, l_fp *, l_fp *)); diff --git a/ntpd/ntp_loopfilter.c b/ntpd/ntp_loopfilter.c index 882ebf80da..1dabdad72e 100644 --- a/ntpd/ntp_loopfilter.c +++ b/ntpd/ntp_loopfilter.c @@ -211,7 +211,8 @@ local_clock( peer->associd, fp_offset, SQRT(epsil), state); #endif if (!ntp_enable) { - record_loop_stats(); + record_loop_stats(fp_offset, drift_comp, SQRT(epsil), + clock_stability, sys_poll); return (0); } @@ -254,7 +255,8 @@ local_clock( fp_offset); printf("ntpd: time slew %.6fs\n", fp_offset); } - record_loop_stats(); + record_loop_stats(fp_offset, drift_comp, SQRT(epsil), + clock_stability, sys_poll); exit (0); } @@ -636,7 +638,8 @@ local_clock( if ((peer->flags & FLAG_REFCLOCK) == 0 && dtemp < MINDISPERSE) dtemp = MINDISPERSE; sys_rootdispersion = peer->rootdispersion + dtemp; - record_loop_stats(); + record_loop_stats(last_offset, drift_comp, sys_jitter, + clock_stability, sys_poll); #ifdef DEBUG if (debug > 1) printf( diff --git a/ntpd/ntp_util.c b/ntpd/ntp_util.c index 34d38a7cd3..f86e930376 100644 --- a/ntpd/ntp_util.c +++ b/ntpd/ntp_util.c @@ -489,7 +489,13 @@ record_peer_stats( * time constant (log base 2) */ void -record_loop_stats(void) +record_loop_stats( + double offset, + double freq, + double jitter, + double stability, + int poll + ) { struct timeval tv; #ifdef HAVE_GETCLOCK @@ -513,8 +519,8 @@ record_loop_stats(void) filegen_setup(&loopstats, (u_long)(tv.tv_sec + JAN_1970)); 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_jitter, clock_stability * 1e6, sys_poll); + day, sec, msec, offset, freq * 1e6, jitter, + stability * 1e6, poll); fflush(loopstats.fp); } }