[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Add 'm' debug key to print free-memory info.



# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID e77ea156075cd9c8eeb942efbf5a8cdb1c33eb09
# Parent  034af52f0df7d047d585a24233a1e19e0e2ae204
Add 'm' debug key to print free-memory info.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 034af52f0df7 -r e77ea156075c xen/common/page_alloc.c
--- a/xen/common/page_alloc.c   Tue Feb 28 09:18:34 2006
+++ b/xen/common/page_alloc.c   Tue Feb 28 10:07:18 2006
@@ -32,6 +32,7 @@
 #include <xen/softirq.h>
 #include <xen/shadow.h>
 #include <xen/domain_page.h>
+#include <xen/keyhandler.h>
 #include <asm/page.h>
 
 /*
@@ -662,6 +663,26 @@
 }
 
 
+static void pagealloc_keyhandler(unsigned char key)
+{
+    printk("Physical memory information:\n");
+    printk("    Xen heap: %lukB free\n"
+           "    DMA heap: %lukB free\n"
+           "    Dom heap: %lukB free\n",
+           avail[MEMZONE_XEN]<<(PAGE_SHIFT-10),
+           avail[MEMZONE_DMADOM]<<(PAGE_SHIFT-10),
+           avail[MEMZONE_DOM]<<(PAGE_SHIFT-10));
+}
+
+
+static __init int pagealloc_keyhandler_init(void)
+{
+    register_keyhandler('m', pagealloc_keyhandler, "memory info");
+    return 0;
+}
+__initcall(pagealloc_keyhandler_init);
+
+
 
 /*************************
  * PAGE SCRUBBING

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.