summaryrefslogtreecommitdiffstats
path: root/sys/kern/subr_rman.c
diff options
context:
space:
mode:
authorgavin <gavin@FreeBSD.org>2011-04-13 19:10:56 +0000
committergavin <gavin@FreeBSD.org>2011-04-13 19:10:56 +0000
commit0b7551a5c94afc2f16e0c6e06bcfe84f5ff45867 (patch)
tree358d747e7561e5b2c75dd1b3a9fc5472c6675abf /sys/kern/subr_rman.c
parent0c2fd51a92bfe962d5df6d21eca7773345140856 (diff)
downloadFreeBSD-src-0b7551a5c94afc2f16e0c6e06bcfe84f5ff45867.zip
FreeBSD-src-0b7551a5c94afc2f16e0c6e06bcfe84f5ff45867.tar.gz
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
Diffstat (limited to 'sys/kern/subr_rman.c')
-rw-r--r--sys/kern/subr_rman.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/sys/kern/subr_rman.c b/sys/kern/subr_rman.c
index 0e53499..cfa4983 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
OpenPOWER on IntegriCloud