1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-30 08:19:09 +00:00

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
This commit is contained in:
Robert Watson 2008-07-19 12:12:54 +00:00
parent 9fc51b0bf4
commit 51c0f94ed7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180610

View File

@ -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 */