All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@web.de>
To: Blue Swirl <blauwirbel@gmail.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] memory: simple memory tree printer
Date: Sun, 18 Sep 2011 14:57:25 +0200	[thread overview]
Message-ID: <4E75EAB5.2010807@web.de> (raw)
In-Reply-To: <CAAu8pHtzoajmvbQ9+Cx-_GVt5wwL34N+eTNj2V6oN+d3kQk1ow@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1363 bytes --]

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 <blauwirbel@gmail.com>
> ---
> 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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

  reply	other threads:[~2011-09-18 12:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-17 19:27 [Qemu-devel] [PATCH v2] memory: simple memory tree printer Blue Swirl
2011-09-18 12:57 ` Jan Kiszka [this message]
2011-09-18 13:53 ` Avi Kivity
2011-09-18 14:07   ` Blue Swirl
2011-09-18 14:26     ` Avi Kivity
  -- strict thread matches above, loose matches on Subject: below --
2011-09-25 20:19 Blue Swirl
2011-09-26  8:07 ` Wayne Xia
2011-09-26  9:45 ` Avi Kivity
2011-09-26 17:13   ` Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E75EAB5.2010807@web.de \
    --to=jan.kiszka@web.de \
    --cc=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.