diff options
author | Gavin Atkinson <gavin@FreeBSD.org> | 2011-04-13 19:10:56 +0000 |
---|---|---|
committer | Gavin Atkinson <gavin@FreeBSD.org> | 2011-04-13 19:10:56 +0000 |
commit | 0f4d3c921d770fac8b24aeff19fe7df1aea2e314 (patch) | |
tree | 358d747e7561e5b2c75dd1b3a9fc5472c6675abf /sys/kern | |
parent | 246419ba872041000910f12dfd3bab0f389f5267 (diff) | |
download | src-0f4d3c921d770fac8b24aeff19fe7df1aea2e314.tar.gz src-0f4d3c921d770fac8b24aeff19fe7df1aea2e314.zip |
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
Notes
Notes:
svn path=/head/; revision=220606
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/subr_rman.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c index 0e53499e0de2..cfa4983004a0 100644 --- a/sys/kern/subr_rman.c +++ b/sys/kern/subr_rman.c @@ -927,6 +927,16 @@ SYSCTL_NODE(_hw_bus, OID_AUTO, rman, CTLFLAG_RD, sysctl_rman, #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) { struct resource_i *r; @@ -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 |