diff --git a/sys/dev/acpica/acpi_hpet.c b/sys/dev/acpica/acpi_hpet.c index 0da8bae307161..5ab8ffefe43b4 100644 --- a/sys/dev/acpica/acpi_hpet.c +++ b/sys/dev/acpica/acpi_hpet.c @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -190,6 +191,8 @@ hpet_start(struct eventtimer *et, sbintime_t first, sbintime_t period) now = bus_read_4(sc->mem_res, HPET_MAIN_COUNTER); restart: t->next = now + fdiv; + CTR3(KTR_SPARE2, "hpet_start: mode=%d, now=%u next=%u", + t->mode, now, t->next); if (t->mode == 1 && (t->caps & HPET_TCAP_PER_INT)) { t->caps |= HPET_TCNF_TYPE; bus_write_4(sc->mem_res, HPET_TIMER_CAP_CNF(t->num), @@ -220,6 +223,7 @@ hpet_stop(struct eventtimer *et) struct hpet_timer *t; struct hpet_softc *sc = mt->sc; + CTR0(KTR_SPARE2, "hpet_stop"); t = (mt->pcpu_master < 0) ? mt : &sc->t[mt->pcpu_slaves[curcpu]]; t->mode = 0; t->caps &= ~(HPET_TCNF_INT_ENB | HPET_TCNF_TYPE); @@ -235,6 +239,7 @@ hpet_intr_single(void *arg) struct hpet_softc *sc = t->sc; uint32_t now; + CTR1(KTR_SPARE2, "hpet_intr_single: mode=%d", t->mode); if (t->mode == 0) return (FILTER_STRAY); /* Check that per-CPU timer interrupt reached right CPU. */ diff --git a/sys/kern/kern_clock.c b/sys/kern/kern_clock.c index fdf2271bc8737..783f9fa9954b2 100644 --- a/sys/kern/kern_clock.c +++ b/sys/kern/kern_clock.c @@ -503,6 +503,7 @@ hardclock_cnt(int cnt, int usermode) int i; #endif /* SW_WATCHDOG */ + CTR2(KTR_SPARE2, "hardclock_cnt: cnt=%d pcputicks=%d", cnt, *t); /* * Update per-CPU and possibly global ticks values. */ @@ -511,6 +512,8 @@ hardclock_cnt(int cnt, int usermode) global = ticks; newticks = *t - global; if (newticks <= 0) { + CTR1(KTR_SPARE2, "hardclock_cnt: newticks=%d", + newticks); if (newticks < -1) *t = global - 1; newticks = 0; @@ -518,6 +521,9 @@ hardclock_cnt(int cnt, int usermode) } } while (!atomic_cmpset_int(&ticks, global, *t)); + CTR3(KTR_SPARE2, "hardclock_cnt: ticks: %d -> %d, newticks = %d", + 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_et.c b/sys/kern/kern_et.c index 979e0c5cf24aa..4f90dd955dfc6 100644 --- a/sys/kern/kern_et.c +++ b/sys/kern/kern_et.c @@ -29,6 +29,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -187,6 +188,9 @@ et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) ("et_start: period specified for oneshot-only timer")); KASSERT((et->et_flags & ET_FLAGS_ONESHOT) || period != 0, ("et_start: period not specified for periodic-only timer")); + CTR4(KTR_SPARE2, "et_start first %d.%08x period %d.%08x", + (int)(first >> 32), (u_int)(first & 0xffffffff), + (int)(period >> 32), (u_int)(period & 0xffffffff)); if (period != 0) { if (period < et->et_min_period) period = et->et_min_period; @@ -199,6 +203,9 @@ et_start(struct eventtimer *et, sbintime_t first, sbintime_t period) else if (first > et->et_max_period) first = et->et_max_period; } + CTR4(KTR_SPARE2, "et_start first %d.%08x period %d.%08x", + (int)(first >> 32), (u_int)(first & 0xffffffff), + (int)(period >> 32), (u_int)(period & 0xffffffff)); return (et->et_start(et, first, period)); } diff --git a/sys/kern/kern_tc.c b/sys/kern/kern_tc.c index 1ec1735b1ee19..1c631f427212c 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 @@ -187,6 +188,7 @@ tc_delta(struct timehands *th) struct timecounter *tc; tc = th->th_counter; + CTR1(KTR_SPARE2, "tc_delta: offset=%u", th->th_offset_count); return ((tc->tc_get_timecount(tc) - th->th_offset_count) & tc->tc_counter_mask); } @@ -1296,6 +1298,10 @@ tc_windup(void) * Update the offset fields accordingly. */ delta = tc_delta(th); + CTR3(KTR_SPARE2, "tc_windup: sec=%u, frac=%lu, delta=%u", + 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 +1428,8 @@ tc_windup(void) } #endif + CTR2(KTR_SPARE2, "tc_windup done: sec=%u, frac=%lu", + th->th_offset.sec, th->th_offset.frac); timehands = th; timekeep_push_vdso(); }