@@ -545,9 +545,13 @@ EXPORT_SYMBOL_GPL(pvclock_gtod_unregister_notifier);
static inline void tk_update_leap_state(struct timekeeper *tk)
{
tk->next_leap_ktime = ntp_get_next_leap();
- if (tk->next_leap_ktime.tv64 != KTIME_MAX)
+ if (tk->next_leap_ktime.tv64 != KTIME_MAX) {
/* Convert to monotonic time */
+ trace_printk("Setting leap %lld (from %lld - %lld)\n",
+ ktime_sub(tk->next_leap_ktime, tk->offs_real).tv64,
+ tk->next_leap_ktime.tv64, tk->offs_real.tv64);
tk->next_leap_ktime = ktime_sub(tk->next_leap_ktime, tk->offs_real);
+ }
}
/*
@@ -1978,8 +1982,10 @@ ktime_t ktime_get_update_offsets_now(unsigned int *cwsseq, ktime_t *offs_real,
}
/* Handle leapsecond insertion adjustments */
- if (unlikely(base.tv64 >= tk->next_leap_ktime.tv64))
+ if (unlikely(base.tv64 >= tk->next_leap_ktime.tv64)) {
+ trace_printk("Inserting leap %lld >= %lld\n", base.tv64, tk->next_leap_ktime.tv64);
*offs_real = ktime_sub(tk->offs_real, ktime_set(1, 0));
+ }
} while (read_seqcount_retry(&tk_core.seq, seq));