From 9bdfc59d8cb95bc50f8e5c71e9979aa464da63c5 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sat, 8 Jul 2023 12:19:36 +0000 Subject: [PATCH] autoconf(9): Print `waiting for devices' normally once a minute. --- sys/kern/subr_autoconf.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index e1d463029110..dc218b42e6d9 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -2699,15 +2699,26 @@ config_finalize(void) mutex_enter(&config_misc_lock); while (!TAILQ_EMPTY(&config_pending)) { device_t dev; + unsigned t0 = getticks(); int error; error = cv_timedwait(&config_misc_cv, &config_misc_lock, mstohz(1000)); if (error == EWOULDBLOCK) { - aprint_debug("waiting for devices:"); + void (*pr)(const char *, ...) __printflike(1,2); + unsigned t1 = getticks(); + + if (t1 - t0 >= 60*hz) { + pr = aprint_normal; + t0 = t1; + } else { + pr = aprint_debug; + } + + (*pr)("waiting for devices:"); TAILQ_FOREACH(dev, &config_pending, dv_pending_list) - aprint_debug(" %s", device_xname(dev)); - aprint_debug("\n"); + (*pr)(" %s", device_xname(dev)); + (*pr)("\n"); } } mutex_exit(&config_misc_lock);