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 <blauwirbel@gmail.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
Blue Swirl 2011-09-11 20:22:05 +00:00 committed by Avi Kivity
parent 3917149d96
commit 314e298735
3 changed files with 106 additions and 0 deletions

View file

@ -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 = "",