From 681ed2d6f912049eef82cc49f6132888600f501a Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 15 Jun 2018 11:27:23 -0700 Subject: [PATCH] TIMER: Minimize noise in idle debug output for short idle delays --- sim_timer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sim_timer.c b/sim_timer.c index 437f5606..27007b68 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -1478,6 +1478,7 @@ t_bool sim_idle (uint32 tmr, int sin_cyc) { uint32 w_ms, w_idle, act_ms; int32 act_cyc; +static t_bool in_nowait = FALSE; if (rtc_clock_catchup_pending[tmr]) { /* Catchup clock tick pending? */ sim_debug (DBG_CAL, &sim_timer_dev, "sim_idle(tmr=%d, sin_cyc=%d) - accelerating pending catch-up tick before idling %s\n", tmr, sin_cyc, sim_uname (sim_clock_unit[tmr])); @@ -1546,9 +1547,12 @@ else w_idle = (w_ms * 1000) / sim_idle_rate_ms; /* 1000 * intervals to wait */ if (w_idle < 500) { /* shorter than 1/2 the interval? */ sim_interval -= sin_cyc; - sim_debug (DBG_IDL, &sim_timer_dev, "no wait\n"); + if (!in_nowait) + sim_debug (DBG_IDL, &sim_timer_dev, "no wait, too short: %d usecs\n", w_idle); + in_nowait = TRUE; return FALSE; } +in_nowait = FALSE; if (sim_clock_queue == QUEUE_LIST_END) sim_debug (DBG_IDL, &sim_timer_dev, "sleeping for %d ms - pending event in %d instructions\n", w_ms, sim_interval); else