All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH-for-5.2] memory: Display bigger regions first in 'info mtree' output
@ 2020-07-27 17:45 Philippe Mathieu-Daudé
  2020-07-27 18:09 ` Peter Xu
  2020-07-27 18:36 ` Peter Maydell
  0 siblings, 2 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-07-27 17:45 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alexey Kardashevskiy, Paolo Bonzini, Philippe Mathieu-Daudé,
	Peter Xu, Igor Mammedov

When different regions have the same address, we currently
sort them by the priority. Also sort them by the region
size.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 softmmu/memory.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/softmmu/memory.c b/softmmu/memory.c
index af25987518..c28dcaf4d6 100644
--- a/softmmu/memory.c
+++ b/softmmu/memory.c
@@ -2960,7 +2960,8 @@ static void mtree_print_mr(const MemoryRegion *mr, unsigned int level,
         QTAILQ_FOREACH(ml, &submr_print_queue, mrqueue) {
             if (new_ml->mr->addr < ml->mr->addr ||
                 (new_ml->mr->addr == ml->mr->addr &&
-                 new_ml->mr->priority > ml->mr->priority)) {
+                 (MR_SIZE(new_ml->mr->size) > MR_SIZE(ml->mr->size) ||
+                  new_ml->mr->priority > ml->mr->priority))) {
                 QTAILQ_INSERT_BEFORE(ml, new_ml, mrqueue);
                 new_ml = NULL;
                 break;
-- 
2.21.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-08-05 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-27 17:45 [PATCH-for-5.2] memory: Display bigger regions first in 'info mtree' output Philippe Mathieu-Daudé
2020-07-27 18:09 ` Peter Xu
2020-08-05 14:21   ` Philippe Mathieu-Daudé
2020-08-05 14:45     ` Philippe Mathieu-Daudé
2020-07-27 18:36 ` Peter Maydell

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.