Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Dec 2018 15:58:18 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r342630 - head/sys/vm
Message-ID:  <201812301558.wBUFwIHS054441@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Dec 30 15:58:18 2018
New Revision: 342630
URL: https://svnweb.freebsd.org/changeset/base/342630

Log:
  Add 'v' modifier to the ddb 'show pginfo' command to display vm_page
  backing the provided kernel virtual address.
  
  Tested by:	pho
  MFC after:	1 week
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/vm/vm_page.c

Modified: head/sys/vm/vm_page.c
==============================================================================
--- head/sys/vm/vm_page.c	Sun Dec 30 15:55:30 2018	(r342629)
+++ head/sys/vm/vm_page.c	Sun Dec 30 15:58:18 2018	(r342630)
@@ -4493,7 +4493,7 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pageq_info)
 DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo)
 {
 	vm_page_t m;
-	boolean_t phys;
+	boolean_t phys, virt;
 
 	if (!have_addr) {
 		db_printf("show pginfo addr\n");
@@ -4501,7 +4501,10 @@ DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo)
 	}
 
 	phys = strchr(modif, 'p') != NULL;
-	if (phys)
+	virt = strchr(modif, 'v') != NULL;
+	if (virt)
+		m = PHYS_TO_VM_PAGE(pmap_kextract(addr));
+	else if (phys)
 		m = PHYS_TO_VM_PAGE(addr);
 	else
 		m = (vm_page_t)addr;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201812301558.wBUFwIHS054441>