diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index fdf2271bc8737..11afe0f5c9b8e 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -503,6 +503,8 @@ hardclock_cnt(int cnt, int usermode) int i; #endif /* SW_WATCHDOG */ + CTR3(KTR_SPARE2, "hardclock_cnt at %d: cnt=%d pcputicks=%d", + curcpu, cnt, *t); /* * Update per-CPU and possibly global ticks values. */ @@ -511,6 +513,8 @@ hardclock_cnt(int cnt, int usermode) global = ticks; newticks = *t - global; if (newticks <= 0) { + CTR1(KTR_SPARE2, "hardclock_cnt at %d: newticks=%d", + newticks); if (newticks < -1) *t = global - 1; newticks = 0; @@ -518,6 +522,9 @@ hardclock_cnt(int cnt, int usermode) } } while (!atomic_cmpset_int(&ticks, global, *t)); + CTR4(KTR_SPARE2, "hardclock_cnt at %d: ticks: %d -> %d, newticks = %d", + curcpu, global, *t, newticks); + /* * Run current process's virtual and profile time, as needed. */ diff --git a/sys/kern/kern_clocksource.c b/sys/kern/kern_clocksource.c index cc7847c2b5de1..6b499bf9c9582 100644 --- a/sys/kern/kern_clocksource.c +++ b/sys/kern/kern_clocksource.c @@ -354,6 +354,8 @@ timercb(struct eventtimer *et, void *arg) if (state->ipi) { state->ipi = 0; ipi_cpu(cpu, IPI_HARDCLOCK); + CTR2(KTR_SPARE2, "sending ipi at %d to %d", + curcpu, cpu); } } } diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 1ec1735b1ee19..50eb4ce682392 100644 --- a/sys/kern/kern_tc.c +++ b/sys/kern/kern_tc.c @@ -22,6 +22,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1296,6 +1297,10 @@ tc_windup(void) * Update the offset fields accordingly. */ delta = tc_delta(th); + CTR4(KTR_SPARE2, "tc_windup at %d: sec=%u, frac=%lu, delta=%u", + curcpu, th->th_offset.sec, th->th_offset.frac, delta); + if (delta > th->th_counter->tc_counter_mask / 2) + CTR1(KTR_SPARE2, "abnormal delta 0x%x", delta); if (th->th_counter != timecounter) ncount = timecounter->tc_get_timecount(timecounter); else @@ -1422,6 +1427,8 @@ tc_windup(void) } #endif + CTR3(KTR_SPARE2, "tc_windup done at %d: sec=%u, frac=%lu", + curcpu, th->th_offset.sec, th->th_offset.frac); timehands = th; timekeep_push_vdso(); }