[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!
- Re: [Qemu-devel] [PATCH 07/17] block/qapi: Clean up how we print to monitor or stdout, (continued)
- [Qemu-devel] [PATCH 17/17] include: Move fprintf_function to disas/, Markus Armbruster, 2019/04/11
- [Qemu-devel] [PATCH 08/17] memory: Clean up how mtree_info() prints, Markus Armbruster, 2019/04/11
- [Qemu-devel] [PATCH 16/17] disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h, Markus Armbruster, 2019/04/11
- [Qemu-devel] [PATCH 10/17] target: Clean up how the dump_mmu() print, Markus Armbruster, 2019/04/11
- [Qemu-devel] [PATCH 09/17] target: Simplify how the TARGET_cpu_list() print, Markus Armbruster, 2019/04/11
- [Qemu-devel] [PATCH 14/17] qom/cpu: Simplify how CPUClass:cpu_dump_state() prints, Markus Armbruster, 2019/04/11
- Re: [Qemu-devel] [PATCH 00/17] Clean up and simplify around fprintf_function, no-reply, 2019/04/11