From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:54893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5GwR-0002NU-6W for qemu-devel@nongnu.org; Sun, 18 Sep 2011 08:57:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R5GwP-0000PI-TY for qemu-devel@nongnu.org; Sun, 18 Sep 2011 08:57:51 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:45063) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R5GwP-0000P2-F8 for qemu-devel@nongnu.org; Sun, 18 Sep 2011 08:57:49 -0400 Message-ID: <4E75EAB5.2010807@web.de> Date: Sun, 18 Sep 2011 14:57:25 +0200 From: Jan Kiszka MIME-Version: 1.0 References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig29B9098780C3127810F9698C" Sender: jan.kiszka@web.de Subject: Re: [Qemu-devel] [PATCH v2] memory: simple memory tree printer List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: qemu-devel This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig29B9098780C3127810F9698C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Signed-off-by: Blue Swirl > --- > v1->v2: use /proc/iomem format. > --- > memory.c | 27 +++++++++++++++++++++++++++ > memory.h | 2 ++ > monitor.c | 7 +++++++ > 3 files changed, 36 insertions(+), 0 deletions(-) >=20 > 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 > +#include "monitor.h" >=20 > unsigned memory_region_transaction_depth =3D 0; >=20 > @@ -1253,3 +1254,29 @@ void set_system_io_map(MemoryRegion *mr) > address_space_io.root =3D mr; > memory_region_update_topology(); > } > + > +static void mtree_print_mr(Monitor *mon, MemoryRegion *mr, unsigned in= t level) > +{ > + MemoryRegion *submr; > + unsigned int i; > + > + for (i =3D 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 --------------enig29B9098780C3127810F9698C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk516sAACgkQitSsb3rl5xTQXwCdEOMjDBR0VxMj2945ZmA4M788 VTYAoK/AUTFucM34kP7p/ifNUOWrP/t1 =QVQt -----END PGP SIGNATURE----- --------------enig29B9098780C3127810F9698C--