ia64/xen-unstable

changeset 9065:e77ea156075c

Add 'm' debug key to print free-memory info.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Feb 28 11:07:18 2006 +0100 (2006-02-28)
parents 034af52f0df7
children e5aba4f62131
files xen/common/page_alloc.c
line diff
     1.1 --- a/xen/common/page_alloc.c	Tue Feb 28 10:18:34 2006 +0100
     1.2 +++ b/xen/common/page_alloc.c	Tue Feb 28 11:07:18 2006 +0100
     1.3 @@ -32,6 +32,7 @@
     1.4  #include <xen/softirq.h>
     1.5  #include <xen/shadow.h>
     1.6  #include <xen/domain_page.h>
     1.7 +#include <xen/keyhandler.h>
     1.8  #include <asm/page.h>
     1.9  
    1.10  /*
    1.11 @@ -662,6 +663,26 @@ unsigned long avail_domheap_pages(void)
    1.12  }
    1.13  
    1.14  
    1.15 +static void pagealloc_keyhandler(unsigned char key)
    1.16 +{
    1.17 +    printk("Physical memory information:\n");
    1.18 +    printk("    Xen heap: %lukB free\n"
    1.19 +           "    DMA heap: %lukB free\n"
    1.20 +           "    Dom heap: %lukB free\n",
    1.21 +           avail[MEMZONE_XEN]<<(PAGE_SHIFT-10),
    1.22 +           avail[MEMZONE_DMADOM]<<(PAGE_SHIFT-10),
    1.23 +           avail[MEMZONE_DOM]<<(PAGE_SHIFT-10));
    1.24 +}
    1.25 +
    1.26 +
    1.27 +static __init int pagealloc_keyhandler_init(void)
    1.28 +{
    1.29 +    register_keyhandler('m', pagealloc_keyhandler, "memory info");
    1.30 +    return 0;
    1.31 +}
    1.32 +__initcall(pagealloc_keyhandler_init);
    1.33 +
    1.34 +
    1.35  
    1.36  /*************************
    1.37   * PAGE SCRUBBING