qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 10/17] target: Clean up how the dump_mmu() print


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH 10/17] target: Clean up how the dump_mmu() print
Date: Tue, 16 Apr 2019 08:23:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

"Dr. David Alan Gilbert" <address@hidden> writes:

> * Markus Armbruster (address@hidden) wrote:
>> The various dump_mmu() take an fprintf()-like callback and a FILE * to
>> pass to it, and so do their helper functions.  Passing around callback
>> and argument is rather tiresome.
>> 
>> Most dump_mmu() are called only by the target's hmp_info_tlb().  These
>> all pass monitor_printf() cast to fprintf_function and the current
>> monitor cast to FILE *.
>> 
>> SPARC's dump_mmu() gets also called from target/sparc/ldst_helper.c a
>> few times #ifdef DEBUG_MMU.  These calls pass fprintf() and stdout.
>
> You might want to fixup the DPRINTF_MMU in ldst_helper.c to also
> use qemu_printf.

Hmm.  Makes DPRINTF_MMU() consistent with how dump_mmu() prints, but
inconsistent with how the other DPRINTF_*() print.  Dunno...

All that debug code should really be tracepoints of course.

I'll leave DPRINTF_MMU() alone unless a maintainer (cc'ed) wants me to
update it.

>> The type-punning is technically undefined behaviour, but works in
>> practice.  Clean up: drop the callback, and call qemu_printf()
>> instead.
>> 
>> Signed-off-by: Markus Armbruster <address@hidden>
>
> Reviewed-by: Dr. David Alan Gilbert <address@hidden>

Thanks!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]