summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2013-05-21 11:04:00 +0000
committerkib <kib@FreeBSD.org>2013-05-21 11:04:00 +0000
commitf8c66c9055c669f366e04b67bc673f48e8793869 (patch)
tree5a4e3ed15f69ece443bf8966ed961622a3de2a57 /sys/vm
parentdff9cf75d8e75686f34af682ad84c58432093f0d (diff)
downloadFreeBSD-src-f8c66c9055c669f366e04b67bc673f48e8793869.zip
FreeBSD-src-f8c66c9055c669f366e04b67bc673f48e8793869.tar.gz
Add ddb command 'show pginfo' which provides useful information about
a vm page, denoted either by an address of the struct vm_page, or, if the '/p' modifier is specified, by a physical address of the corresponding frame. Reviewed by: jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_page.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index f95013f..637fb0c 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -2884,4 +2884,27 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pageq_info)
*vm_pagequeues[PQ_ACTIVE].pq_cnt,
*vm_pagequeues[PQ_INACTIVE].pq_cnt);
}
+
+DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo)
+{
+ vm_page_t m;
+ boolean_t phys;
+
+ if (!have_addr) {
+ db_printf("show pginfo addr\n");
+ return;
+ }
+
+ phys = strchr(modif, 'p') != NULL;
+ if (phys)
+ m = PHYS_TO_VM_PAGE(addr);
+ else
+ m = (vm_page_t)addr;
+ db_printf(
+ "page %p obj %p pidx 0x%jx phys 0x%jx q %d hold %d wire %d\n"
+ " af 0x%x of 0x%x f 0x%x act %d busy %d valid 0x%x dirty 0x%x\n",
+ m, m->object, (uintmax_t)m->pindex, (uintmax_t)m->phys_addr,
+ m->queue, m->hold_count, m->wire_count, m->aflags, m->oflags,
+ m->flags, m->act_count, m->busy, m->valid, m->dirty);
+}
#endif /* DDB */
OpenPOWER on IntegriCloud