From 4394f4767dbc3cf49b4dababb4bfafbbd588edf4 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Sat, 25 Jan 2003 07:51:09 +0000 Subject: Add sysctl kern.timecounter.nsetclock which indicates the number of potential discontinuities in our UTC timescale. Applications can monitor this variable if they want to be informed about steps in the timescale. Slews (ntp and adjtime(2)) and frequency adjustments (ntp) will not increment this counter, only operations which set the clock. No attempt is made to classify size or direction of the step. --- sys/kern/kern_tc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sys/kern') diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index bb20a9ee3f5a..93b50a028298 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -96,6 +96,7 @@ TC_STATS(nbinuptime); TC_STATS(nnanouptime); TC_STATS(nmicrouptime); TC_STATS(nbintime); TC_STATS(nnanotime); TC_STATS(nmicrotime); TC_STATS(ngetbinuptime); TC_STATS(ngetnanouptime); TC_STATS(ngetmicrouptime); TC_STATS(ngetbintime); TC_STATS(ngetnanotime); TC_STATS(ngetmicrotime); +TC_STATS(nsetclock); #undef TC_STATS @@ -314,6 +315,7 @@ tc_setclock(struct timespec *ts) { struct timespec ts2; + nsetclock++; nanouptime(&ts2); boottime.tv_sec = ts->tv_sec - ts2.tv_sec; /* XXX boottime should probably be a timespec. */ -- cgit v1.2.3