From: Peter Xu <peterx@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH 2/2] memory: hmp: dump flat view for 'info mtree'
Date: Wed, 21 Dec 2016 15:56:11 +0800 [thread overview]
Message-ID: <20161221075611.GF22006@pxdev.xzpeter.org> (raw)
In-Reply-To: <1482156623-9111-3-git-send-email-peterx@redhat.com>
On Mon, Dec 19, 2016 at 10:10:23PM +0800, Peter Xu wrote:
> Dumping flat view will be useful to debug the memory rendering logic,
> also it'll be much easier with it to know what memory region is handling
> what address range.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> memory.c | 31 +++++++++++++++++++++++++++++++
> 1 file changed, 31 insertions(+)
>
> diff --git a/memory.c b/memory.c
> index 5dcc2e1..a9154aa 100644
> --- a/memory.c
> +++ b/memory.c
> @@ -2545,6 +2545,36 @@ static void mtree_print_mr(fprintf_function mon_printf, void *f,
> }
> }
>
> +static void mtree_print_flatview(fprintf_function p, void *f,
> + AddressSpace *as)
> +{
> + FlatView *view = address_space_get_flatview(as);
> + FlatRange *range = &view->ranges[0];
> + MemoryRegion *mr;
> + int n = view->nr;
> +
> + if (n <= 0) {
> + p(f, MTREE_INDENT "No rendered FlatView for "
> + "address space '%s'\n", as->name);
> + return;
> + }
> +
> + p(f, MTREE_INDENT "FlatView (address space '%s'):\n", as->name);
> +
> + while (n--) {
> + mr = range->mr;
> + p(f, MTREE_INDENT MTREE_INDENT TARGET_FMT_plx "-"
> + TARGET_FMT_plx " (prio %d, %c%c): %s\n",
> + int128_get64(range->addr.start),
> + int128_get64(range->addr.start) + MR_SIZE(mr->size),
^^^^^^^^
here it should be range->addr.size
Will repost. Thanks,
-- peterx
prev parent reply other threads:[~2016-12-21 7:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-19 14:10 [Qemu-devel] [PATCH 0/2] memory: extend "info mtree" with flat view dump Peter Xu
2016-12-19 14:10 ` [Qemu-devel] [PATCH 1/2] memory: provide common macros for mtree_print_mr() Peter Xu
2016-12-20 10:50 ` Marc-André Lureau
2016-12-20 10:54 ` Marc-André Lureau
2016-12-19 14:10 ` [Qemu-devel] [PATCH 2/2] memory: hmp: dump flat view for 'info mtree' Peter Xu
2016-12-21 7:56 ` Peter Xu [this message]
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=20161221075611.GF22006@pxdev.xzpeter.org \
--to=peterx@redhat.com \
--cc=pbonzini@redhat.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.