From f8c66c9055c669f366e04b67bc673f48e8793869 Mon Sep 17 00:00:00 2001 From: kib Date: Tue, 21 May 2013 11:04:00 +0000 Subject: 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 --- sys/vm/vm_page.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'sys/vm/vm_page.c') 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 */ -- cgit v1.1