summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2008-07-19 12:12:54 +0000
committerrwatson <rwatson@FreeBSD.org>2008-07-19 12:12:54 +0000
commit8fd5cf995c60144fc477529409ef77e98a0fd4bd (patch)
tree72d5f916fafe6212bd0bcd815219914c3b234dea
parent7ff6e9903f13d9d6684f9c61e286c4c653181385 (diff)
downloadFreeBSD-src-8fd5cf995c60144fc477529409ef77e98a0fd4bd.zip
FreeBSD-src-8fd5cf995c60144fc477529409ef77e98a0fd4bd.tar.gz
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
-rw-r--r--sys/kern/subr_autoconf.c27
1 files changed, 27 insertions, 0 deletions
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 <sys/cdefs.h>
__FBSDID("$FreeBSD$");
+#include "opt_ddb.h"
+
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/lock.h>
@@ -130,3 +132,28 @@ config_intrhook_disestablish(hook)
wakeup(&intr_config_hook_list);
mtx_unlock(&intr_config_hook_lock);
}
+
+#ifdef DDB
+#include <ddb/ddb.h>
+#include <sys/linker.h>
+
+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 */
OpenPOWER on IntegriCloud