[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2] memory: simple memory tree printer
From: |
Jan Kiszka |
Subject: |
Re: [Qemu-devel] [PATCH v2] memory: simple memory tree printer |
Date: |
Sun, 18 Sep 2011 14:57:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.8.1.12) Gecko/20080226 SUSE/2.0.0.12-1.1 Thunderbird/2.0.0.12 Mnenhy/0.7.5.666 |
On 2011-09-17 21:27, Blue Swirl wrote:
> Add a monitor command 'info mtree' to show the memory hierarchy
> much like /proc/iomem in Linux.
>
> Signed-off-by: Blue Swirl <address@hidden>
> ---
> v1->v2: use /proc/iomem format.
> ---
> memory.c | 27 +++++++++++++++++++++++++++
> memory.h | 2 ++
> monitor.c | 7 +++++++
> 3 files changed, 36 insertions(+), 0 deletions(-)
>
> diff --git a/memory.c b/memory.c
> index 101b67c..275f5cf 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -17,6 +17,7 @@
> #include "bitops.h"
> #include "kvm.h"
> #include <assert.h>
> +#include "monitor.h"
>
> unsigned memory_region_transaction_depth = 0;
>
> @@ -1253,3 +1254,29 @@ void set_system_io_map(MemoryRegion *mr)
> address_space_io.root = mr;
> memory_region_update_topology();
> }
> +
> +static void mtree_print_mr(Monitor *mon, MemoryRegion *mr, unsigned int
> level)
> +{
> + MemoryRegion *submr;
> + unsigned int i;
> +
> + for (i = 0; i < level; i++) {
> + monitor_printf(mon, " ");
> + }
> + monitor_printf(mon, TARGET_FMT_plx "-" TARGET_FMT_plx " : %s\n",
> + mr->addr, mr->addr + (target_phys_addr_t)mr->size - 1,
> + mr->name);
I would prefer absolute addresses here. And the priority field needs to
be dumped as well.
Jan
signature.asc
Description: OpenPGP digital signature