svn commit: r250849 - head/sys/vm

Konstantin Belousov kib at FreeBSD.org
Tue May 21 11:04:01 UTC 2013


Author: kib
Date: Tue May 21 11:04:00 2013
New Revision: 250849
URL: http://svnweb.freebsd.org/changeset/base/250849

Log:
  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

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Tue May 21 06:13:38 2013	(r250848)
+++ head/sys/vm/vm_page.c	Tue May 21 11:04:00 2013	(r250849)
@@ -2884,4 +2884,27 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pag
 		*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 */


More information about the svn-src-head mailing list