On Fri, Apr 28, 2017 at 06:21:30PM +0800, Peter Xu wrote:
> On Thu, Apr 27, 2017 at 12:23:14PM +0100, Dr. David Alan Gilbert wrote:
[...]
> > > +void ram_block_dump(Monitor *mon)
> > > +{
> > > + RAMBlock *block;
> > > +
> > > + rcu_read_lock();
> > > + monitor_printf(mon, "%24s %8s %18s %18s %18s\n",
> > > + "Block Name", "PSize", "Offset", "Used", "Total");
> > > + RAMBLOCK_FOREACH(block) {
> > > + monitor_printf(mon, "%24s %8s 0x%016" PRIx64 " 0x%016" PRIx64
> > > + " 0x%016" PRIx64 "\n", block->idstr,
> > > + page_size_to_str(block->page_size),
> > > + (uint64_t)block->offset,
> > > + (uint64_t)block->used_length,
> > > + (uint64_t)block->max_length);
> > > + }
> >
> > Yes that should work, I remember there's a RAM_ADDR_FMT macro that's
> > supposed to be usable for ram_addr_t, but that's fine.
>
> That looks better. Will switch to that. Thanks!
Oh, I found that RAM_ADDR_FMT didn't allow me to do the formatting
with width ("%016..."). So maybe I'll still use current way for now.
--
Peter Xu