diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-08-02 13:43:15 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-08-02 13:43:15 +0100 |
commit | 2d986e611fada54d00d3759dad5725d337493719 (patch) | |
tree | ca5b9afcd291893d40b713acdbada93432eca186 /xen/common/page_alloc.c | |
parent | 91baae515e845630309aa8d72bf1cf4a2eaa120c (diff) | |
download | xen-2d986e611fada54d00d3759dad5725d337493719.tar.gz xen-2d986e611fada54d00d3759dad5725d337493719.tar.bz2 xen-2d986e611fada54d00d3759dad5725d337493719.zip |
Add a single trigger for all diagnostic keyhandlers
Add a new keyhandler that triggers all the side-effect-free
keyhandlers. This lets automated tests (and users) log the full set
of keyhandlers without having to be aware of which ones might reboot
the host.
Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Diffstat (limited to 'xen/common/page_alloc.c')
-rw-r--r-- | xen/common/page_alloc.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index e5d3e3b44e..f175ff9f7c 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -1192,7 +1192,7 @@ unsigned long avail_domheap_pages(void) -1); } -static void pagealloc_keyhandler(unsigned char key) +static void pagealloc_info(unsigned char key) { unsigned int zone = MEMZONE_XEN; unsigned long n, total = 0; @@ -1219,10 +1219,15 @@ static void pagealloc_keyhandler(unsigned char key) printk(" Dom heap: %lukB free\n", total << (PAGE_SHIFT-10)); } +static struct keyhandler pagealloc_info_keyhandler = { + .diagnostic = 1, + .u.fn = pagealloc_info, + .desc = "memory info" +}; static __init int pagealloc_keyhandler_init(void) { - register_keyhandler('m', pagealloc_keyhandler, "memory info"); + register_keyhandler('m', &pagealloc_info_keyhandler); return 0; } __initcall(pagealloc_keyhandler_init); @@ -1261,9 +1266,15 @@ static void dump_heap(unsigned char key) } } +static struct keyhandler dump_heap_keyhandler = { + .diagnostic = 1, + .u.fn = dump_heap, + .desc = "dump heap info" +}; + static __init int register_heap_trigger(void) { - register_keyhandler('H', dump_heap, "dump heap info"); + register_keyhandler('H', &dump_heap_keyhandler); return 0; } __initcall(register_heap_trigger); |