Lines Matching +full:reset +full:- +full:time +full:- +full:sec

1 /*-
2 * SPDX-License-Identifier: Beerware
4 * ----------------------------------------------------------------------------
5 * "THE BEER-WARE LICENSE" (Revision 42):
8 * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
9 * ----------------------------------------------------------------------------
46 * forever when the time step is large.
53 * time services.
65 dummy_get_timecount, 0, ~0u, 1000000, "dummy", -1000000
88 .th_scale = (uint64_t)-1 / 1000000,
90 .th_offset = { .sec = 1 },
108 * The system time is always computed by summing the estimated boot time and the
109 * system uptime. The timehands track boot time, but it changes when the system
110 * time is set by the user, stepped by ntpd or adjusted when resuming. It
111 * is set to new_time - uptime.
127 &timestepwarnings, 0, "Log time steps");
146 "Allowed time interval deviation in percents");
150 static int tc_chosen; /* Non-zero if a specific tc was chosen via sysctl. */
171 if (req->flags & SCTL_MASK32) {
187 ncount = tc->tc_get_timecount(tc);
197 freq = tc->tc_frequency;
210 tc = th->th_counter;
211 return ((tc->tc_get_timecount(tc) - th->th_offset_count) &
212 tc->tc_counter_mask);
224 bt->sec += x >> 32;
233 * Functions for reading the time. We have to loop until we are sure that
235 * the comment in <sys/time.h> for a description of these 12 functions.
248 gen = atomic_load_acq_int(&th->th_generation);
251 scale = th->th_scale;
253 large_delta = th->th_large_delta;
255 } while (gen == 0 || gen != th->th_generation);
261 _Static_assert(_Generic(((struct timehands *)NULL)->member, \
275 gen = atomic_load_acq_int(&th->th_generation);
278 } while (gen == 0 || gen != th->th_generation);
283 __typeof(((struct timehands *)NULL)->member): 1, \
503 * Support for feed-forward synchronization algorithms. This is heavily inspired
509 /* Feed-forward clock estimates kept updated by the synchronization daemon. */
511 struct bintime ffclock_boottime; /* Feed-forward boot time estimate. */
512 uint32_t ffclock_status; /* Feed-forward clock status. */
539 last = ffth + NUM_ELEMENTS(ffth) - 1;
541 cur->next = cur + 1;
542 last->next = ffth;
550 * Reset the feed-forward clock estimates. Called from inittodr() to get things
552 * estimate. Note: this function may be called several time just after boot.
553 * Note: this is the only function that sets the value of boot time for the
554 * monotonic (i.e. uptime) version of the feed-forward clock.
562 tc = timehands->th_counter;
569 cest.period = ((1ULL << 63) / tc->tc_frequency) << 1;
581 printf("ffclock reset: %s (%llu Hz), time = %ld.%09lu\n", tc->tc_name,
582 (unsigned long long)tc->tc_frequency, (long)ts->tv_sec,
583 (unsigned long)ts->tv_nsec);
587 * Sub-routine to convert a time interval measured in RAW counter units to time
599 delta_max = (1ULL << (8 * sizeof(unsigned int))) - 1;
606 bt2.sec = 0;
610 ffdelta -= delta;
616 * Push the tick ffcount and time(s) forward based on current clock estimate.
618 * principle, whose accuracy relies on computing small time intervals. If a new
620 * current, and compute the linear interpolation for monotonic time if needed.
638 ffth = fftimehands->next;
639 ogen = ffth->gen;
640 ffth->gen = 0;
641 cest = &ffth->cest;
642 bcopy(&fftimehands->cest, cest, sizeof(struct ffclock_estimate));
644 ffth->period_lerp = fftimehands->period_lerp;
646 ffth->tick_time = fftimehands->tick_time;
647 ffclock_convert_delta(ffdelta, cest->period, &bt);
648 bintime_add(&ffth->tick_time, &bt);
650 ffth->tick_time_lerp = fftimehands->tick_time_lerp;
651 ffclock_convert_delta(ffdelta, ffth->period_lerp, &bt);
652 bintime_add(&ffth->tick_time_lerp, &bt);
654 ffth->tick_ffcount = fftimehands->tick_ffcount + ffdelta;
662 ffdelta = ffth->tick_ffcount - cest->update_ffcount;
663 ffclock_convert_delta(ffdelta, cest->period, &bt);
664 if (bt.sec > 2 * FFCLOCK_SKM_SCALE)
670 * Recompute time at this tick using the updated estimates. The clock
671 * estimates passed the feed-forward synchronisation daemon may result
672 * in time conversion that is not monotonically increasing (just after
679 ffdelta = ffth->tick_ffcount - cest->update_ffcount;
680 ffth->tick_time = cest->update_time;
681 ffclock_convert_delta(ffdelta, cest->period, &bt);
682 bintime_add(&ffth->tick_time, &bt);
686 ffth->tick_time_lerp = ffth->tick_time;
688 if (bintime_cmp(&ffth->tick_time, &ffth->tick_time_lerp, >))
695 gap_lerp = ffth->tick_time;
696 bintime_sub(&gap_lerp, &ffth->tick_time_lerp);
698 gap_lerp = ffth->tick_time_lerp;
699 bintime_sub(&gap_lerp, &ffth->tick_time);
703 * The reset from the RTC clock may be far from accurate, and
704 * reducing the gap between real time and interpolated time
705 * could take a very long time if the interpolated clock insists
706 * on strict monotonicity. The clock is reset under very strict
707 * conditions (kernel time is known to be wrong and
709 * ffclock_boottime absorbs the jump to ensure boot time is
713 ((cest->status & FFCLOCK_STA_UNSYNC) == 0) &&
714 ((cest->status & FFCLOCK_STA_WARMUP) == FFCLOCK_STA_WARMUP)) {
719 ffth->tick_time_lerp = ffth->tick_time;
723 ffclock_status = cest->status;
724 ffth->period_lerp = cest->period;
728 * time. The rate of linear interpolation is capped to 5000PPM
732 ffdelta = cest->update_ffcount;
733 ffdelta -= fftimehands->cest.update_ffcount;
734 ffclock_convert_delta(ffdelta, cest->period, &bt);
735 polling = bt.sec;
736 bt.sec = 0;
742 /* Approximate 1 sec by 1-(1/2^64) to ease arithmetic */
744 if (gap_lerp.sec > 0) {
745 frac -= 1;
746 frac /= ffdelta / gap_lerp.sec;
751 ffth->period_lerp += frac;
753 ffth->period_lerp -= frac;
760 ffth->gen = ogen;
769 * operation for a feed-forward synchronization daemon, and it is its job to not
782 tc = th->th_counter;
783 ffth = fftimehands->next;
784 ogen = ffth->gen;
785 ffth->gen = 0;
787 cest = &ffth->cest;
788 bcopy(&(fftimehands->cest), cest, sizeof(struct ffclock_estimate));
789 cest->period = ((1ULL << 63) / tc->tc_frequency ) << 1;
790 cest->errb_abs = 0;
791 cest->errb_rate = 0;
792 cest->status |= FFCLOCK_STA_UNSYNC;
794 ffth->tick_ffcount = fftimehands->tick_ffcount;
795 ffth->tick_time_lerp = fftimehands->tick_time_lerp;
796 ffth->tick_time = fftimehands->tick_time;
797 ffth->period_lerp = cest->period;
800 ffclock_updated--;
804 ffth->gen = ogen;
809 * Retrieve feed-forward counter and time of last kernel tick.
823 gen = ffth->gen;
825 *bt = ffth->tick_time_lerp;
827 *bt = ffth->tick_time;
828 *ffcount = ffth->tick_ffcount;
829 } while (gen == 0 || gen != ffth->gen);
853 gen = ffth->gen;
854 if (ffcount > ffth->tick_ffcount)
855 ffdelta = ffcount - ffth->tick_ffcount;
857 ffdelta = ffth->tick_ffcount - ffcount;
860 *bt = ffth->tick_time_lerp;
861 ffclock_convert_delta(ffdelta, ffth->period_lerp, &bt2);
863 *bt = ffth->tick_time;
864 ffclock_convert_delta(ffdelta, ffth->cest.period, &bt2);
867 if (ffcount > ffth->tick_ffcount)
871 } while (gen == 0 || gen != ffth->gen);
876 * Low level function to Convert a time interval measured in RAW counter units
889 gen = ffth->gen;
890 ffclock_convert_delta(ffdelta, ffth->cest.period, bt);
891 } while (gen == 0 || gen != ffth->gen);
906 * th->th_generation only, for correct delta and ffcounter.
910 gen = atomic_load_acq_int(&th->th_generation);
913 *ffcount = ffth->tick_ffcount;
915 } while (gen == 0 || gen != th->th_generation);
1019 * This is a clone of getnanouptime used for time since boot.
1033 * System clock currently providing time to the system. Modifiable via sysctl
1059 ffi = &clock_snap->ff_info;
1062 fbi = &clock_snap->fb_info;
1067 gen = atomic_load_acq_int(&th->th_generation);
1068 fbi->th_scale = th->th_scale;
1069 fbi->tick_time = th->th_offset;
1072 ffi->tick_time = ffth->tick_time_lerp;
1073 ffi->tick_time_lerp = ffth->tick_time_lerp;
1074 ffi->period = ffth->cest.period;
1075 ffi->period_lerp = ffth->period_lerp;
1076 clock_snap->ffcount = ffth->tick_ffcount;
1077 cest = ffth->cest;
1082 } while (gen == 0 || gen != th->th_generation);
1084 clock_snap->delta = delta;
1085 clock_snap->sysclock_active = sysclock_active;
1088 clock_snap->fb_info.status = time_status;
1090 bt.sec = time_esterror / 1000000;
1091 bt.frac = ((time_esterror - bt.sec) * 1000000) *
1093 clock_snap->fb_info.error = bt;
1097 clock_snap->ffcount += delta;
1099 /* Record feed-forward clock leap second adjustment. */
1100 ffi->leapsec_adjustment = cest.leapsec_total;
1101 if (clock_snap->ffcount > cest.leapsec_next)
1102 ffi->leapsec_adjustment -= cest.leapsec;
1104 /* Record feed-forward clock status and error. */
1105 clock_snap->ff_info.status = cest.status;
1106 ffcount = clock_snap->ffcount - cest.update_ffcount;
1112 clock_snap->ff_info.error = bt;
1132 *bt = cs->fb_info.tick_time;
1135 if (cs->delta > 0)
1136 bintime_addx(bt, cs->fb_info.th_scale * cs->delta);
1146 *bt = cs->ff_info.tick_time_lerp;
1147 period = cs->ff_info.period_lerp;
1149 *bt = cs->ff_info.tick_time;
1150 period = cs->ff_info.period;
1154 if (cs->delta > 0) {
1155 ffclock_convert_delta(cs->delta, period, &bt2);
1161 bt->sec -= cs->ff_info.leapsec_adjustment;
1163 /* Boot time adjustment, for uptime/monotonic clocks. */
1185 u = tc->tc_frequency / tc->tc_counter_mask;
1189 if (u > hz && tc->tc_quality >= 0) {
1190 tc->tc_quality = -2000;
1193 tc->tc_name, (uintmax_t)tc->tc_frequency);
1194 printf(" -- Insufficient hz, needs at least %u\n", u);
1196 } else if (tc->tc_quality >= 0 || bootverbose) {
1198 tc->tc_name, (uintmax_t)tc->tc_frequency,
1199 tc->tc_quality);
1206 SYSCTL_STATIC_CHILDREN(_kern_timecounter_tc), OID_AUTO, tc->tc_name,
1210 "mask", CTLFLAG_RD, &(tc->tc_counter_mask), 0,
1221 "quality", CTLFLAG_RD, &(tc->tc_quality), 0,
1222 "goodness of time counter");
1225 tc->tc_next = timecounters;
1236 if (tc->tc_quality < 0)
1239 strcmp(tc->tc_name, tc_from_tunable) == 0) {
1243 if (tc->tc_quality < timecounter->tc_quality)
1245 if (tc->tc_quality == timecounter->tc_quality &&
1246 tc->tc_frequency < timecounter->tc_frequency)
1249 (void)tc->tc_get_timecount(tc);
1260 return (timehands->th_counter->tc_frequency);
1273 * the thread that it was woken due to a real-time clock adjustment.
1276 if (td->td_rtcgen != 0 && td->td_rtcgen != rtc_generation) {
1277 td->td_rtcgen = 0;
1314 "Time stepped from %jd.%09ld to %jd.%09ld (%jd.%09ld)\n",
1317 (intmax_t)ts->tv_sec, ts->tv_nsec);
1332 * The range of th_adjustment is +/- 5000PPM so inside a 64bit int
1349 scale += (th->th_adjustment / 1024) * 2199;
1350 scale /= th->th_counter->tc_frequency;
1351 th->th_scale = scale * 2;
1352 th->th_large_delta = MIN(((uint64_t)1 << 63) / scale, UINT_MAX);
1376 * For similar reasons, re-reading of the generation after the
1380 th = tho->th_next;
1381 ogen = th->th_generation;
1382 th->th_generation = 0;
1386 th->th_boottime = *new_boottimebin;
1395 if (th->th_counter != tc)
1396 ncount = tc->tc_get_timecount(tc);
1402 th->th_offset_count += delta;
1403 th->th_offset_count &= th->th_counter->tc_counter_mask;
1404 bintime_add_tc_delta(&th->th_offset, th->th_scale,
1405 th->th_large_delta, delta);
1415 if (tho->th_counter->tc_poll_pps)
1416 tho->th_counter->tc_poll_pps(tho->th_counter);
1422 * At boot, the time step can be large when the TOD hardware
1427 bt = th->th_offset;
1428 bintime_add(&bt, &th->th_boottime);
1429 i = bt.sec - tho->th_microtime.tv_sec;
1435 t = bt.sec;
1436 ntp_update_second(&th->th_adjustment, &bt.sec);
1437 if (bt.sec != t)
1438 th->th_boottime.sec += bt.sec - t;
1439 --i;
1446 th->th_bintime = bt;
1447 bintime2timeval(&bt, &th->th_microtime);
1448 bintime2timespec(&bt, &th->th_nanotime);
1450 /* Now is a good time to change timecounters. */
1451 if (th->th_counter != tc) {
1453 if ((tc->tc_flags & TC_FLAGS_C2STOP) != 0)
1455 if ((th->th_counter->tc_flags & TC_FLAGS_C2STOP) != 0)
1456 cpu_disable_c2_sleep--;
1458 th->th_counter = tc;
1459 th->th_offset_count = ncount;
1460 tc_min_ticktock_freq = max(1, tc->tc_frequency /
1461 (((uint64_t)tc->tc_counter_mask + 1) / 3));
1474 atomic_store_rel_int(&th->th_generation, ogen);
1481 time_second = th->th_microtime.tv_sec;
1482 time_uptime = th->th_offset.sec;
1486 time_second = fftimehands->tick_time_lerp.sec;
1487 time_uptime = fftimehands->tick_time_lerp.sec - ffclock_boottime.sec;
1506 strlcpy(newname, tc->tc_name, sizeof(newname));
1510 if (error != 0 || req->newptr == NULL)
1516 if (strcmp(newname, tc->tc_name) == 0) {
1520 for (newtc = timecounters; newtc != NULL; newtc = newtc->tc_next) {
1521 if (strcmp(newname, newtc->tc_name) != 0)
1525 (void)newtc->tc_get_timecount(newtc);
1560 for (tc = timecounters; tc != NULL; tc = tc->tc_next) {
1563 sbuf_printf(&sb, "%s(%d)", tc->tc_name, tc->tc_quality);
1577 * RFC 2783 PPS-API implementation.
1588 return ((pps->kcmode & KCMODE_ABIFLAG) && pps->driver_abi >= vers);
1598 if (fapi->tsformat && fapi->tsformat != PPS_TSFMT_TSPEC)
1603 * most recently captured. If timeout seconds is -1, that's a request
1606 * sleep a long time.
1608 if (fapi->timeout.tv_sec || fapi->timeout.tv_nsec) {
1609 if (fapi->timeout.tv_sec == -1)
1612 tv.tv_sec = fapi->timeout.tv_sec;
1613 tv.tv_usec = fapi->timeout.tv_nsec / 1000;
1616 aseq = atomic_load_int(&pps->ppsinfo.assert_sequence);
1617 cseq = atomic_load_int(&pps->ppsinfo.clear_sequence);
1618 while (aseq == atomic_load_int(&pps->ppsinfo.assert_sequence) &&
1619 cseq == atomic_load_int(&pps->ppsinfo.clear_sequence)) {
1620 if (abi_aware(pps, 1) && pps->driver_mtx != NULL) {
1621 if (pps->flags & PPSFLAG_MTX_SPIN) {
1622 err = msleep_spin(pps, pps->driver_mtx,
1625 err = msleep(pps, pps->driver_mtx, PCATCH,
1632 if (fapi->timeout.tv_sec == -1) {
1643 pps->ppsinfo.current_mode = pps->ppsparam.mode;
1644 fapi->pps_info_buf = pps->ppsinfo;
1669 if (app->mode & ~pps->ppscap)
1673 if ((app->mode & PPS_TSCLK_MASK) == PPS_TSCLK_MASK)
1676 pps->ppsparam = *app;
1680 *app = pps->ppsparam;
1681 app->api_version = PPS_API_VERS_1;
1684 *(int*)data = pps->ppscap;
1692 if (fapi_ffc->tsformat && fapi_ffc->tsformat !=
1695 if (fapi_ffc->timeout.tv_sec || fapi_ffc->timeout.tv_nsec)
1697 pps->ppsinfo_ffc.current_mode = pps->ppsparam.mode;
1698 fapi_ffc->pps_info_buf_ffc = pps->ppsinfo_ffc;
1700 switch (pps->ppsparam.mode & PPS_TSCLK_MASK) {
1702 fapi_ffc->pps_info_buf_ffc.assert_timestamp =
1703 pps->ppsinfo.assert_timestamp;
1704 fapi_ffc->pps_info_buf_ffc.clear_timestamp =
1705 pps->ppsinfo.clear_timestamp;
1718 if (kapi->tsformat && kapi->tsformat != PPS_TSFMT_TSPEC)
1720 if (kapi->kernel_consumer != PPS_KC_HARDPPS)
1722 if (kapi->edge & ~pps->ppscap)
1724 pps->kcmode = (kapi->edge & KCMODE_EDGEMASK) |
1725 (pps->kcmode & KCMODE_ABIFLAG);
1738 pps->ppscap |= PPS_TSFMT_TSPEC | PPS_CANWAIT;
1739 if (pps->ppscap & PPS_CAPTUREASSERT)
1740 pps->ppscap |= PPS_OFFSETASSERT;
1741 if (pps->ppscap & PPS_CAPTURECLEAR)
1742 pps->ppscap |= PPS_OFFSETCLEAR;
1744 pps->ppscap |= PPS_TSCLK_MASK;
1746 pps->kcmode &= ~KCMODE_ABIFLAG;
1754 if (pps->driver_abi > 0) {
1755 pps->kcmode |= KCMODE_ABIFLAG;
1756 pps->kernel_abi = PPS_ABI_VERSION;
1768 pps->capgen = atomic_load_acq_int(&th->th_generation);
1769 pps->capth = th;
1771 pps->capffth = fftimehands;
1773 tc = th->th_counter;
1774 pps->capcount = tc->tc_get_timecount(tc);
1799 if ((event & pps->ppsparam.mode) == 0)
1803 capth = pps->capth;
1804 captc = capth->th_counter;
1805 capth_scale = capth->th_scale;
1806 tcount = capth->th_offset_count;
1807 bt = capth->th_bintime;
1811 if (pps->capgen == 0 || pps->capgen != capth->th_generation)
1816 tsp = &pps->ppsinfo.assert_timestamp;
1817 osp = &pps->ppsparam.assert_offset;
1818 foff = pps->ppsparam.mode & PPS_OFFSETASSERT;
1820 fhard = pps->kcmode & PPS_CAPTUREASSERT;
1822 pcount = &pps->ppscount[0];
1823 pseq = &pps->ppsinfo.assert_sequence;
1825 ffcount = &pps->ppsinfo_ffc.assert_ffcount;
1826 tsp_ffc = &pps->ppsinfo_ffc.assert_timestamp;
1827 pseq_ffc = &pps->ppsinfo_ffc.assert_sequence;
1830 tsp = &pps->ppsinfo.clear_timestamp;
1831 osp = &pps->ppsparam.clear_offset;
1832 foff = pps->ppsparam.mode & PPS_OFFSETCLEAR;
1834 fhard = pps->kcmode & PPS_CAPTURECLEAR;
1836 pcount = &pps->ppscount[1];
1837 pseq = &pps->ppsinfo.clear_sequence;
1839 ffcount = &pps->ppsinfo_ffc.clear_ffcount;
1840 tsp_ffc = &pps->ppsinfo_ffc.clear_timestamp;
1841 pseq_ffc = &pps->ppsinfo_ffc.clear_sequence;
1845 *pcount = pps->capcount;
1849 * we have to drop the rest of the PPS-stuff until the next event.
1851 if (__predict_false(pps->ppstc != captc)) {
1852 pps->ppstc = captc;
1853 pps->ppscount[2] = pps->capcount;
1860 tcount = pps->capcount - tcount;
1861 tcount &= captc->tc_counter_mask;
1867 if (tsp->tv_nsec < 0) {
1868 tsp->tv_nsec += 1000000000;
1869 tsp->tv_sec -= 1;
1874 *ffcount = pps->capffth->tick_ffcount + tcount;
1875 bt = pps->capffth->tick_time;
1876 ffclock_convert_delta(tcount, pps->capffth->cest.period, &bt);
1877 bintime_add(&bt, &pps->capffth->tick_time);
1892 tcount = pps->capcount - pps->ppscount[2];
1893 pps->ppscount[2] = pps->capcount;
1894 tcount &= captc->tc_counter_mask;
1897 freq = captc->tc_frequency;
1940 tc_precexp = fls(t + (t >> 1)) - 1;
1947 bt_timethreshold.sec = INT_MAX;
1962 if (error != 0 || req->newptr == NULL)
1986 thp->th_next = &ths[i];
1987 thp->th_next = &ths[0];
2008 * should use the non-"get"* functions.
2028 (void)timecounter->tc_get_timecount(timecounter);
2036 /* Cpu tick handling -------------------------------------------------*/
2054 tc = timehands->th_counter;
2055 u = tc->tc_get_timecount(tc) & tc->tc_counter_mask;
2057 *base += (uint64_t)tc->tc_counter_mask + 1;
2079 * Whenever the real time clock is stepped we get called with reset=1
2084 cpu_tick_calibrate(int reset)
2092 if (reset) {
2093 /* The clock was stepped, abort & reset */
2094 t_last.sec = 0;
2104 if (t_last.sec != 0) {
2105 c_delta = c_this - c_last;
2110 * 2^(64-20) / 16[s] =
2115 divi = t_delta.sec << 20;
2116 divi |= t_delta.frac >> (64 - 20);
2185 NULL, 0, sysctl_fast_gettime, "I", "Enable fast time of day");
2194 vdso_th->th_scale = th->th_scale;
2195 vdso_th->th_offset_count = th->th_offset_count;
2196 vdso_th->th_counter_mask = th->th_counter->tc_counter_mask;
2197 vdso_th->th_offset = th->th_offset;
2198 vdso_th->th_boottime = th->th_boottime;
2199 if (th->th_counter->tc_fill_vdso_timehands != NULL) {
2200 enabled = th->th_counter->tc_fill_vdso_timehands(vdso_th,
2201 th->th_counter);
2217 *(uint64_t *)&vdso_th32->th_scale[0] = th->th_scale;
2218 vdso_th32->th_offset_count = th->th_offset_count;
2219 vdso_th32->th_counter_mask = th->th_counter->tc_counter_mask;
2220 vdso_th32->th_offset.sec = th->th_offset.sec;
2221 *(uint64_t *)&vdso_th32->th_offset.frac[0] = th->th_offset.frac;
2222 vdso_th32->th_boottime.sec = th->th_boottime.sec;
2223 *(uint64_t *)&vdso_th32->th_boottime.frac[0] = th->th_boottime.frac;
2224 if (th->th_counter->tc_fill_vdso_timehands32 != NULL) {
2225 enabled = th->th_counter->tc_fill_vdso_timehands32(vdso_th32,
2226 th->th_counter);
2246 tc = th->th_counter;
2247 val1 = tc->tc_get_timecount(tc);
2249 val2 = tc->tc_get_timecount(tc);
2251 db_printf("timecounter %p %s\n", tc, tc->tc_name);
2253 tc->tc_counter_mask, (uintmax_t)tc->tc_frequency, tc->tc_quality,
2254 tc->tc_flags, tc->tc_priv);
2257 (uintmax_t)th->th_adjustment, (uintmax_t)th->th_scale,
2258 th->th_large_delta, th->th_offset_count, th->th_generation);
2260 (intmax_t)th->th_offset.sec, (uintmax_t)th->th_offset.frac,
2261 (intmax_t)th->th_boottime.sec, (uintmax_t)th->th_boottime.frac);