Index: linux-2.6.7/include/linux/timex.h =================================================================== --- linux-2.6.7.orig/include/linux/timex.h +++ linux-2.6.7/include/linux/timex.h @@ -394,6 +394,8 @@ GET_TI_NSECS(time_interpolator_get_counter(),time_interpolator); } +extern int ti_debug; + static inline void time_interpolator_update(long delta_nsec) { unsigned long counter=time_interpolator_get_counter(); @@ -406,10 +408,19 @@ * interpolator clock is running slightly slower than the regular clock. */ - if (delta_nsec < 0 || (unsigned long) delta_nsec < offset) + if (delta_nsec < 0 || (unsigned long) delta_nsec < offset) { + if (ti_debug) + printk(KERN_INFO "continue O=%lu delta=%ld offset=%lu ti_offset=%lu set to %ld nanoseconds.\n", + GET_TI_NSECS(counter,time_interpolator),delta_nsec,offset, + time_interpolator_offset,offset - delta_nsec); time_interpolator_offset = offset - delta_nsec; - else + } else { + if (ti_debug) + printk(KERN_INFO "reset O=%lu delta=%ld offset=%lu ti_offset=%lu skipping %ld nanoseconds.\n", + GET_TI_NSECS(counter,time_interpolator),delta_nsec,offset, + time_interpolator_offset,delta_nsec-offset); time_interpolator_offset = 0; /* Early tick. Resync */ + } time_interpolator_last_counter = counter; } Index: linux-2.6.7/kernel/timer.c =================================================================== --- linux-2.6.7.orig/kernel/timer.c +++ linux-2.6.7/kernel/timer.c @@ -1431,6 +1431,7 @@ static spinlock_t time_interpolator_lock = SPIN_LOCK_UNLOCKED; unsigned long time_interpolator_offset; unsigned long time_interpolator_last_counter; +unsigned long ti_debug; static inline int is_better_time_interpolator(struct time_interpolator *new) @@ -1445,6 +1446,7 @@ register_time_interpolator(struct time_interpolator *ti) { ti->nsec_per_cyc = (NSEC_PER_SEC << ti->shift) / ti->frequency; + printk(KERN_INFO "new time_interpolator: freq=%ld cyc=%d ns short by=%d ns.\n",ti->frequency,ti->nsec_per_cyc, (NSEC_PER_SEC << ti->shift) % ti->frequency); spin_lock(&time_interpolator_lock); write_seqlock_irq(&xtime_lock); if (is_better_time_interpolator(ti))