qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: David Hildenbrand <david@redhat.com>,
	Chao Liu <lc00631@tecorigin.com>,
	pbonzini@redhat.com, peterx@redhat.com
Cc: zhangtj@tecorigin.com, zqz00548@tecorigin.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 1/1] system: optimizing info mtree printing for monitors
Date: Thu, 1 May 2025 14:51:22 +0200	[thread overview]
Message-ID: <1d99561f-044a-4242-80ed-819b955d785d@linaro.org> (raw)
In-Reply-To: <f5f540a2-a6d6-47fd-9b7c-8fd4a4927684@redhat.com>

On 30/4/25 23:38, David Hildenbrand wrote:
> On 30.04.25 11:58, Philippe Mathieu-Daudé wrote:
>> Hi Chao,
>>
>> On 30/4/25 11:02, Chao Liu wrote:
>>> Make the hierarchical relationship between nodes clearer by adding 
>>> characters
>>
>> W.r.t. $Subject, it isn't really about "optimization" but making
>> output clearer, as you describe.
>>
>>>
>>> e.g.
>>>
>>> qemu-system-riscv64 -M virt -monitor stdio -display none
>>>
>>> ```
>>> (qemu) info mtree
>>> ...
>>> memory-region: system
>>> │  ├── 0000000000000000-ffffffffffffffff (prio 0, i/o): system
>>> │  │   ├── 0000000003000000-000000000300ffff (prio 0, i/o): 
>>> gpex_ioport_window
>>> │  │   │   └── 0000000003000000-000000000300ffff (prio 0, i/o): 
>>> gpex_ioport
>>> ...
>>> │  │   └── 0000000400000000-00000007ffffffff (prio 0, i/o): alias ...
>>> ```
>>>
>>> Signed-off-by: Chao Liu <lc00631@tecorigin.com>
>>> Reviewed-by: Qingze Zhao <zqz00548@tecorigin.com>
>>> Reviewed-by: Tingjian Zhang <zhangtj@tecorigin.com>
>>> ---
>>>    system/memory.c | 36 ++++++++++++++++++++++++++++++------
>>>    1 file changed, 30 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/system/memory.c b/system/memory.c
>>> index 71434e7ad0..cf91718bcc 100644
>>> --- a/system/memory.c
>>> +++ b/system/memory.c
>>> @@ -3296,6 +3296,21 @@ typedef QTAILQ_HEAD(, MemoryRegionList) 
>>> MemoryRegionListHead;
>>>                               int128_sub((size), int128_one())) : 0)
>>>    #define MTREE_INDENT "  "
>>> +enum mtree_node_type {
>>> +    MTREE_NODE_T_INNER,
>>> +    MTREE_NODE_T_TAIL,
>>> +};
>>> +
>>> +static void mtree_print_node(enum mtree_node_type is_tail)
>>
>> Either rename 'is_tail' as 'node_type', or really use a boolean
>> (maybe '[is_]last_node' is clearer?), since the mtree_node_type enum
>> doesn't bring much (see [*] below).
>>
> 
> Note that I suggested that, because the passing or true/false in the 
> code is horrible for readability.

Oh good point. Sorry I missed previous version reviews.



  reply	other threads:[~2025-05-01 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-30  9:02 [PATCH v3 0/1] Optimizing the print format of the QEMU monitor 'info mtree' Chao Liu
2025-04-30  9:02 ` [PATCH v3 1/1] system: optimizing info mtree printing for monitors Chao Liu
2025-04-30  9:58   ` Philippe Mathieu-Daudé
2025-04-30 21:38     ` David Hildenbrand
2025-05-01 12:51       ` Philippe Mathieu-Daudé [this message]
2025-05-05 17:20   ` Mario Casquero

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=1d99561f-044a-4242-80ed-819b955d785d@linaro.org \
    --to=philmd@linaro.org \
    --cc=david@redhat.com \
    --cc=lc00631@tecorigin.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=zhangtj@tecorigin.com \
    --cc=zqz00548@tecorigin.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).