STRUCT NTP_DATA(9)
π struct ntp_data(9) π
okay so bestie, welcome to the Kernel API Manual β this one's literally the struct ntp_data page and it's holding all the NTP state, like the whole personality of your kernel's clock sync in one struct. π°οΈβ¨
β¨ NAME β¨
struct ntp_data β the structure holding all NTP related state π«Ά
π¦ SYNOPSIS π¦
struct ntp_data {
unsigned long tick_usec;
u64 tick_length;
int time_state;
int time_status;
s64 time_offset;
s64 skew_delta;
long time_constant;
long time_maxerror;
long time_esterror;
s64 time_freq;
time64_t time_reftime;
long time_adjust;
s64 time_adjust_frac;
s64 ntp_tick_adj;
s64 cs_tick_adj;
time64_t ntp_next_leap_sec;
#ifdef CONFIG_NTP_PPS;
int pps_valid;
long pps_tf[3];
long pps_jitter;
struct timespec64 pps_fbase;
int pps_shift;
int pps_intcnt;
s64 pps_freq;
long pps_stabil;
long pps_calcnt;
long pps_jitcnt;
long pps_stbcnt;
long pps_errcnt;
#endif;
};
ngl that #ifdef CONFIG_NTP_PPS; block is giving "only some of us are invited to the PPS party" energy π
β everything from pps_valid down to pps_errcnt only shows up when that config's on.
π Members π
time to meet the cast, iykyk π
tick_usecβ theUSER_HZperiod, in microseconds β±οΈtick_lengthβ tick length in ns, lowkey<< NTP_SCALE_SHIFT-edtime_stateβ the state of the clock synchronization, like its current mood πtime_statusβ clock status bitstime_offsetβ time adjustment, in nanosecondsskew_deltaβ per-tick phase slew rate for the coming second, measured intime_offsetunits (so: shifted-ns / HZ). Set bysecond_overflow. πtime_constantβ the PLL time constanttime_maxerrorβ maximum error in microseconds, holding the NTP sync distance (that's NTP dispersion + delay / 2) πtime_esterrorβ estimated error in microseconds, holding the NTP dispersiontime_freqβ frequency offset scaled nsecs/secstime_reftimeβ time at the last adjustment, in secondstime_adjustβ the adjustment valuetime_adjust_fracβ the sub-microsecond remainder oftime_adjustbeing delivered, in ns<< NTP_SCALE_SHIFT(and no, it is not divided by HZ π«Ά)ntp_tick_adjβ constant boot-param configurable NTP tick adjustment (upscaled)cs_tick_adjβ a fixed per-second adjustment compensating for the difference between the nominal NTP interval and the real time taken by the clocksource's integercycle_interval(upscaled). Set by the timekeeping core viantp_clear. βntp_next_leap_secβ second value of the next pending leapsecond, orTIME64_MAXif there's no leap πΈpps_validβ PPS signal watchdog counter πpps_tfβ PPS phase median filterpps_jitterβ PPS current jitter, in nanosecondspps_fbaseβ PPS beginning of the last freq intervalpps_shiftβ PPS current interval duration in seconds (it's a shift value, bestie)pps_intcntβ PPS interval counterpps_freqβ PPS frequency offset, in scaled ns/spps_stabilβ PPS current stability, in scaled ns/spps_calcntβ PPS monitor: calibration intervals πpps_jitcntβ PPS monitor: jitter limit exceededpps_stbcntβ PPS monitor: stability limit exceededpps_errcntβ PPS monitor: calibration errors
π Description π
Protected by the timekeeping locks. π that's it, that's the whole vibe β but fr fr do not go poking at this without holding them.
π SEE ALSO π
Kernel file ./kernel/time/ntp.c, plus pps_clear(9), ntp_clear(9), ntp_get_next_leap(9), ntp_synced(9) β go read those, they ate π
π₯
and that's the page bestie!! π from ./kernel/time, dated October 2026 β the struct ntp_data(9) era, periodt. β¨π¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms