mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 23:55:07 -05:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2dcc16169b | ||
|
|
a8efd8c398 | ||
|
|
bb40f4aff4 | ||
|
|
66c7ac4d24 |
1
NEWS
1
NEWS
@@ -6,6 +6,7 @@ New in version 1.25
|
|||||||
* Improve polling interval adjustment
|
* Improve polling interval adjustment
|
||||||
* Improve stability with temporary asymmetric delays
|
* Improve stability with temporary asymmetric delays
|
||||||
* Improve source selection
|
* Improve source selection
|
||||||
|
* Improve initial synchronisation
|
||||||
* Add delayed server name resolving
|
* Add delayed server name resolving
|
||||||
* Add temperature compensation
|
* Add temperature compensation
|
||||||
* Add nanosecond slewing to Linux driver
|
* Add nanosecond slewing to Linux driver
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.TH CHRONYC 1 "December 04, 2009" chrony "User's Manual"
|
.TH CHRONYC 1 "May 02, 2011" chrony "User's Manual"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
chronyc \- command-line interface for chronyd
|
chronyc \- command-line interface for chronyd
|
||||||
|
|
||||||
@@ -48,7 +48,7 @@ interactively.
|
|||||||
|
|
||||||
|
|
||||||
.SH VERSION
|
.SH VERSION
|
||||||
1.24
|
1.25
|
||||||
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
To report bugs, please visit \fIhttp://chrony.tuxfamily.org\fR
|
To report bugs, please visit \fIhttp://chrony.tuxfamily.org\fR
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.TH CHRONYD 8 "December 04, 2009" chrony "System Administration"
|
.TH CHRONYD 8 "May 02, 2011" chrony "System Administration"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
chronyd \- chrony background daemon
|
chronyd \- chrony background daemon
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@ Resolve hostnames only to IPv6 addresses.
|
|||||||
\fI/etc/chrony.conf\fR
|
\fI/etc/chrony.conf\fR
|
||||||
|
|
||||||
.SH VERSION
|
.SH VERSION
|
||||||
Version 1.24
|
Version 1.25
|
||||||
|
|
||||||
.SH BUGS
|
.SH BUGS
|
||||||
To report bugs, please visit \fIhttp://chrony.tuxfamily.org/\fR
|
To report bugs, please visit \fIhttp://chrony.tuxfamily.org/\fR
|
||||||
|
|||||||
12
regress.c
12
regress.c
@@ -232,7 +232,6 @@ RGR_FindBestRegression
|
|||||||
double *b0, /* estimated y axis intercept */
|
double *b0, /* estimated y axis intercept */
|
||||||
double *b1, /* estimated slope */
|
double *b1, /* estimated slope */
|
||||||
double *s2, /* estimated variance of data points */
|
double *s2, /* estimated variance of data points */
|
||||||
double *us2, /* estimated unweighted variance of data points */
|
|
||||||
|
|
||||||
double *sb0, /* estimated standard deviation of
|
double *sb0, /* estimated standard deviation of
|
||||||
intercept */
|
intercept */
|
||||||
@@ -251,7 +250,7 @@ RGR_FindBestRegression
|
|||||||
{
|
{
|
||||||
double P, Q, U, V, W; /* total */
|
double P, Q, U, V, W; /* total */
|
||||||
double resid[MAX_POINTS * REGRESS_RUNS_RATIO];
|
double resid[MAX_POINTS * REGRESS_RUNS_RATIO];
|
||||||
double ss, uss;
|
double ss;
|
||||||
double a, b, u, ui, aa;
|
double a, b, u, ui, aa;
|
||||||
|
|
||||||
int start, resid_start, nruns, npoints;
|
int start, resid_start, nruns, npoints;
|
||||||
@@ -315,20 +314,17 @@ RGR_FindBestRegression
|
|||||||
*b1 = b;
|
*b1 = b;
|
||||||
*b0 = a;
|
*b0 = a;
|
||||||
|
|
||||||
ss = uss = 0.0;
|
ss = 0.0;
|
||||||
for (i=start; i<n; i++) {
|
for (i=start; i<n; i++) {
|
||||||
ss += resid[i - resid_start]*resid[i - resid_start] / w[i];
|
ss += resid[i - resid_start]*resid[i - resid_start] / w[i];
|
||||||
uss += resid[i - resid_start]*resid[i - resid_start];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
npoints = n - start;
|
npoints = n - start;
|
||||||
ss /= npoints - 2;
|
ss /= (double)(npoints - 2);
|
||||||
uss /= npoints - 2;
|
|
||||||
*sb1 = sqrt(ss / V);
|
*sb1 = sqrt(ss / V);
|
||||||
aa = u * (*sb1);
|
aa = u * (*sb1);
|
||||||
*sb0 = sqrt((ss / W) + (aa * aa));
|
*sb0 = sqrt((ss / W) + (aa * aa));
|
||||||
*s2 = ss * npoints / W;
|
*s2 = ss * (double) npoints / W;
|
||||||
*us2 = uss;
|
|
||||||
|
|
||||||
*new_start = start;
|
*new_start = start;
|
||||||
*dof = npoints - 2;
|
*dof = npoints - 2;
|
||||||
|
|||||||
@@ -86,7 +86,6 @@ RGR_FindBestRegression
|
|||||||
double *b0, /* estimated y axis intercept */
|
double *b0, /* estimated y axis intercept */
|
||||||
double *b1, /* estimated slope */
|
double *b1, /* estimated slope */
|
||||||
double *s2, /* estimated variance of data points */
|
double *s2, /* estimated variance of data points */
|
||||||
double *us2, /* estimated unweighted variance of data points */
|
|
||||||
|
|
||||||
double *sb0, /* estimated standard deviation of
|
double *sb0, /* estimated standard deviation of
|
||||||
intercept */
|
intercept */
|
||||||
|
|||||||
@@ -105,9 +105,6 @@ struct SST_Stats_Record {
|
|||||||
/* This is the estimated residual variance of the data points */
|
/* This is the estimated residual variance of the data points */
|
||||||
double variance;
|
double variance;
|
||||||
|
|
||||||
/* This is the estimated unweighted variance of the data points */
|
|
||||||
double uvariance;
|
|
||||||
|
|
||||||
/* This array contains the sample epochs, in terms of the local
|
/* This array contains the sample epochs, in terms of the local
|
||||||
clock. */
|
clock. */
|
||||||
struct timeval sample_times[MAX_SAMPLES * REGRESS_RUNS_RATIO];
|
struct timeval sample_times[MAX_SAMPLES * REGRESS_RUNS_RATIO];
|
||||||
@@ -193,7 +190,7 @@ SST_CreateInstance(unsigned long refid, IPAddr *addr)
|
|||||||
inst->estimated_offset_sd = 86400.0; /* Assume it's at least within a day! */
|
inst->estimated_offset_sd = 86400.0; /* Assume it's at least within a day! */
|
||||||
inst->offset_time.tv_sec = 0;
|
inst->offset_time.tv_sec = 0;
|
||||||
inst->offset_time.tv_usec = 0;
|
inst->offset_time.tv_usec = 0;
|
||||||
inst->variance = inst->uvariance = 16.0;
|
inst->variance = 16.0;
|
||||||
inst->nruns = 0;
|
inst->nruns = 0;
|
||||||
return inst;
|
return inst;
|
||||||
}
|
}
|
||||||
@@ -367,7 +364,7 @@ find_min_delay_sample(SST_Stats inst)
|
|||||||
time. E.g. a value of 4 means that we think the standard deviation
|
time. E.g. a value of 4 means that we think the standard deviation
|
||||||
is four times the fluctuation of the peer distance */
|
is four times the fluctuation of the peer distance */
|
||||||
|
|
||||||
#define SD_TO_DIST_RATIO 1.4
|
#define SD_TO_DIST_RATIO 1.0
|
||||||
|
|
||||||
/* ================================================== */
|
/* ================================================== */
|
||||||
/* This function runs the linear regression operation on the data. It
|
/* This function runs the linear regression operation on the data. It
|
||||||
@@ -385,9 +382,9 @@ SST_DoNewRegression(SST_Stats inst)
|
|||||||
|
|
||||||
int degrees_of_freedom;
|
int degrees_of_freedom;
|
||||||
int best_start, times_back_start;
|
int best_start, times_back_start;
|
||||||
double est_intercept, est_slope, est_var, est_uvar, est_intercept_sd, est_slope_sd;
|
double est_intercept, est_slope, est_var, est_intercept_sd, est_slope_sd;
|
||||||
int i, j, nruns;
|
int i, j, nruns;
|
||||||
double min_distance;
|
double min_distance, mean_distance;
|
||||||
double sd_weight, sd;
|
double sd_weight, sd;
|
||||||
double old_skew, old_freq, stress;
|
double old_skew, old_freq, stress;
|
||||||
|
|
||||||
@@ -398,17 +395,19 @@ SST_DoNewRegression(SST_Stats inst)
|
|||||||
offsets[i + inst->runs_samples] = inst->offsets[get_runsbuf_index(inst, i)];
|
offsets[i + inst->runs_samples] = inst->offsets[get_runsbuf_index(inst, i)];
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, min_distance = DBL_MAX; i < inst->n_samples; i++) {
|
for (i = 0, mean_distance = 0.0, min_distance = DBL_MAX; i < inst->n_samples; i++) {
|
||||||
j = get_buf_index(inst, i);
|
j = get_buf_index(inst, i);
|
||||||
peer_distances[i] = 0.5 * inst->peer_delays[j] + inst->peer_dispersions[j];
|
peer_distances[i] = 0.5 * inst->peer_delays[j] + inst->peer_dispersions[j];
|
||||||
|
mean_distance += peer_distances[i];
|
||||||
if (peer_distances[i] < min_distance) {
|
if (peer_distances[i] < min_distance) {
|
||||||
min_distance = peer_distances[i];
|
min_distance = peer_distances[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
mean_distance /= inst->n_samples;
|
||||||
|
|
||||||
/* And now, work out the weight vector */
|
/* And now, work out the weight vector */
|
||||||
|
|
||||||
sd = sqrt(inst->uvariance);
|
sd = mean_distance - min_distance;
|
||||||
if (sd > min_distance || sd <= 0.0)
|
if (sd > min_distance || sd <= 0.0)
|
||||||
sd = min_distance;
|
sd = min_distance;
|
||||||
|
|
||||||
@@ -421,7 +420,7 @@ SST_DoNewRegression(SST_Stats inst)
|
|||||||
inst->regression_ok = RGR_FindBestRegression(times_back + inst->runs_samples,
|
inst->regression_ok = RGR_FindBestRegression(times_back + inst->runs_samples,
|
||||||
offsets + inst->runs_samples, weights,
|
offsets + inst->runs_samples, weights,
|
||||||
inst->n_samples, inst->runs_samples,
|
inst->n_samples, inst->runs_samples,
|
||||||
&est_intercept, &est_slope, &est_var, &est_uvar,
|
&est_intercept, &est_slope, &est_var,
|
||||||
&est_intercept_sd, &est_slope_sd,
|
&est_intercept_sd, &est_slope_sd,
|
||||||
&best_start, &nruns, °rees_of_freedom);
|
&best_start, &nruns, °rees_of_freedom);
|
||||||
|
|
||||||
@@ -436,7 +435,6 @@ SST_DoNewRegression(SST_Stats inst)
|
|||||||
inst->offset_time = inst->sample_times[inst->last_sample];
|
inst->offset_time = inst->sample_times[inst->last_sample];
|
||||||
inst->estimated_offset_sd = est_intercept_sd;
|
inst->estimated_offset_sd = est_intercept_sd;
|
||||||
inst->variance = est_var;
|
inst->variance = est_var;
|
||||||
inst->uvariance = est_uvar;
|
|
||||||
inst->nruns = nruns;
|
inst->nruns = nruns;
|
||||||
|
|
||||||
stress = fabs(old_freq - inst->estimated_frequency) / old_skew;
|
stress = fabs(old_freq - inst->estimated_frequency) / old_skew;
|
||||||
|
|||||||
Reference in New Issue
Block a user