Add a new DDB command, "show rmans", which will show the address and brief

details of each rman header, but not the contents of all rman structures
in the system.  This is especially useful on platforms where some rmans
have many thousands of entries in rmans, making scrolling through the
output of "show all rman" impractical.  Individual rmans can then be viewed
including their contents with "show rman 0xaddr" as usual.

Reviewed by:	jhb
This commit is contained in:
Gavin Atkinson 2011-04-13 19:10:56 +00:00
parent 246419ba87
commit 0f4d3c921d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=220606

View File

@ -926,6 +926,16 @@ SYSCTL_NODE(_hw_bus, OID_AUTO, rman, CTLFLAG_RD, sysctl_rman,
"kernel resource manager");
#ifdef DDB
static void
dump_rman_header(struct rman *rm)
{
if (db_pager_quit)
return;
db_printf("rman %p: %s (0x%lx-0x%lx full range)\n",
rm, rm->rm_descr, rm->rm_start, rm->rm_end);
}
static void
dump_rman(struct rman *rm)
{
@ -934,8 +944,6 @@ dump_rman(struct rman *rm)
if (db_pager_quit)
return;
db_printf("rman: %s\n", rm->rm_descr);
db_printf(" 0x%lx-0x%lx (full range)\n", rm->rm_start, rm->rm_end);
TAILQ_FOREACH(r, &rm->rm_list, r_link) {
if (r->r_dev != NULL) {
devname = device_get_nameunit(r->r_dev);
@ -956,16 +964,29 @@ dump_rman(struct rman *rm)
DB_SHOW_COMMAND(rman, db_show_rman)
{
if (have_addr)
if (have_addr) {
dump_rman_header((struct rman *)addr);
dump_rman((struct rman *)addr);
}
}
DB_SHOW_COMMAND(rmans, db_show_rmans)
{
struct rman *rm;
TAILQ_FOREACH(rm, &rman_head, rm_link) {
dump_rman_header(rm);
}
}
DB_SHOW_ALL_COMMAND(rman, db_show_all_rman)
{
struct rman *rm;
TAILQ_FOREACH(rm, &rman_head, rm_link)
TAILQ_FOREACH(rm, &rman_head, rm_link) {
dump_rman_header(rm);
dump_rman(rm);
}
}
DB_SHOW_ALIAS(allrman, db_show_all_rman);
#endif