From 8fd5cf995c60144fc477529409ef77e98a0fd4bd Mon Sep 17 00:00:00 2001 From: rwatson Date: Sat, 19 Jul 2008 12:12:54 +0000 Subject: Add DDB "show conifhk" command, which lists hooks currently waiting for completion in run_interrupt_driven_config_hooks(). This is helpful when trying to figure out which device drivers have gone into la-la land during boot-time autoconfiguration. MFC after: 3 days --- sys/kern/subr_autoconf.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'sys/kern/subr_autoconf.c') diff --git a/sys/kern/subr_autoconf.c b/sys/kern/subr_autoconf.c index ef70f04..9bb1619 100644 --- a/sys/kern/subr_autoconf.c +++ b/sys/kern/subr_autoconf.c @@ -37,6 +37,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_ddb.h" + #include #include #include @@ -130,3 +132,28 @@ config_intrhook_disestablish(hook) wakeup(&intr_config_hook_list); mtx_unlock(&intr_config_hook_lock); } + +#ifdef DDB +#include +#include + +DB_SHOW_COMMAND(conifhk, db_show_conifhk) +{ + struct intr_config_hook *hook_entry; + char namebuf[64]; + long offset; + + TAILQ_FOREACH(hook_entry, &intr_config_hook_list, ich_links) { + if (linker_ddb_search_symbol_name( + (caddr_t)hook_entry->ich_func, namebuf, sizeof(namebuf), + &offset) == 0) { + db_printf("hook: %p at %s+%#lx arg: %p\n", + hook_entry->ich_func, namebuf, offset, + hook_entry->ich_arg); + } else { + db_printf("hook: %p at ??+?? arg %p\n", + hook_entry->ich_func, hook_entry->ich_arg); + } + } +} +#endif /* DDB */ -- cgit v1.1