mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 16:35:06 -05:00
cmdmon: add smoothtime command
This adds a command to reset or activate the time smoothing process.
This commit is contained in:
20
smooth.c
20
smooth.c
@@ -199,12 +199,8 @@ update_smoothing(struct timeval *now, double offset, double freq)
|
||||
{
|
||||
/* Don't accept offset/frequency until the clock has stabilized */
|
||||
if (locked) {
|
||||
if (REF_GetSkew() / max_wander < UNLOCK_SKEW_WANDER_RATIO || leap_only_mode) {
|
||||
LOG(LOGS_INFO, LOGF_Smooth, "Time smoothing activated%s", leap_only_mode ?
|
||||
" (leap seconds only)" : "");
|
||||
locked = 0;
|
||||
last_update = *now;
|
||||
}
|
||||
if (REF_GetSkew() / max_wander < UNLOCK_SKEW_WANDER_RATIO || leap_only_mode)
|
||||
SMT_Activate(now);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -274,6 +270,18 @@ SMT_GetOffset(struct timeval *now)
|
||||
return offset;
|
||||
}
|
||||
|
||||
void
|
||||
SMT_Activate(struct timeval *now)
|
||||
{
|
||||
if (!enabled || !locked)
|
||||
return;
|
||||
|
||||
LOG(LOGS_INFO, LOGF_Smooth, "Time smoothing activated%s", leap_only_mode ?
|
||||
" (leap seconds only)" : "");
|
||||
locked = 0;
|
||||
last_update = *now;
|
||||
}
|
||||
|
||||
void
|
||||
SMT_Reset(struct timeval *now)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user