From 314e298735903035ba2b7b0f3cf39981f4171546 Mon Sep 17 00:00:00 2001 From: Blue Swirl Date: Sun, 11 Sep 2011 20:22:05 +0000 Subject: memory: simple memory tree printer Add a monitor command 'info mtree' to show the memory hierarchy much like /proc/iomem in Linux. Signed-off-by: Blue Swirl Signed-off-by: Avi Kivity --- monitor.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'monitor.c') diff --git a/monitor.c b/monitor.c index 8ec2c5efea..d323ea5851 100644 --- a/monitor.c +++ b/monitor.c @@ -63,6 +63,7 @@ #endif #include "trace/control.h" #include "ui/qemu-spice.h" +#include "memory.h" //#define DEBUG //#define DEBUG_COMPLETION @@ -2470,6 +2471,11 @@ static void tlb_info(Monitor *mon) } #endif +static void do_info_mtree(Monitor *mon) +{ + mtree_info((fprintf_function)monitor_printf, mon); +} + static void do_info_kvm_print(Monitor *mon, const QObject *data) { QDict *qdict; @@ -2977,6 +2983,13 @@ static const mon_cmd_t info_cmds[] = { .mhandler.info = mem_info, }, #endif + { + .name = "mtree", + .args_type = "", + .params = "", + .help = "show memory tree", + .mhandler.info = do_info_mtree, + }, { .name = "jit", .args_type = "", -- cgit v1.2.1