All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: qemu-devel@nongnu.org,
	Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 10/17] target: Clean up how the dump_mmu() print
Date: Tue, 16 Apr 2019 08:23:30 +0200	[thread overview]
Message-ID: <87tvey79jx.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20190415155306.GN2852@work-vm> (David Alan Gilbert's message of "Mon, 15 Apr 2019 16:53:07 +0100")

"Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:

> * Markus Armbruster (armbru@redhat.com) 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 <armbru@redhat.com>
>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Thanks!

WARNING: multiple messages have this Message-ID (diff)
From: Markus Armbruster <armbru@redhat.com>
To: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>,
	qemu-devel@nongnu.org, Artyom Tarasenko <atar4qemu@gmail.com>
Subject: Re: [Qemu-devel] [PATCH 10/17] target: Clean up how the dump_mmu() print
Date: Tue, 16 Apr 2019 08:23:30 +0200	[thread overview]
Message-ID: <87tvey79jx.fsf@dusky.pond.sub.org> (raw)
Message-ID: <20190416062330.OphqMK6BSJXeVTXM9Lwpo7TSXDH9shLuXueLMWWBEoQ@z> (raw)
In-Reply-To: <20190415155306.GN2852@work-vm> (David Alan Gilbert's message of "Mon, 15 Apr 2019 16:53:07 +0100")

"Dr. David Alan Gilbert" <dgilbert@redhat.com> writes:

> * Markus Armbruster (armbru@redhat.com) 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 <armbru@redhat.com>
>
> Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

Thanks!


  reply	other threads:[~2019-04-16  6:23 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 15:25 [Qemu-devel] [PATCH 00/17] Clean up and simplify around fprintf_function Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 01/17] include: Include fprintf-fn.h only where needed Markus Armbruster
2019-04-12 16:53   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 02/17] trace: Simplify how st_print_trace_file_status() prints Markus Armbruster
2019-04-12 16:55   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 03/17] tcg: Simplify how dump_opcount_info() prints Markus Armbruster
2019-04-12 16:58   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 04/17] tcg: Simplify how dump_exec_info() prints Markus Armbruster
2019-04-12 17:09   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 05/17] tcg: Simplify how dump_drift_info() prints Markus Armbruster
2019-04-12 17:18   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 06/17] qsp: Simplify how qsp_report() prints Markus Armbruster
2019-04-12 17:25   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 07/17] block/qapi: Clean up how we print to monitor or stdout Markus Armbruster
2019-04-12 17:59   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 08/17] memory: Clean up how mtree_info() prints Markus Armbruster
2019-04-12 17:44   ` Dr. David Alan Gilbert
2019-04-12 18:25     ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 09/17] target: Simplify how the TARGET_cpu_list() print Markus Armbruster
2019-04-15 15:43   ` Dr. David Alan Gilbert
2019-04-16  6:14     ` Markus Armbruster
2019-04-16  8:20       ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 10/17] target: Clean up how the dump_mmu() print Markus Armbruster
2019-04-15 15:53   ` Dr. David Alan Gilbert
2019-04-16  6:23     ` Markus Armbruster [this message]
2019-04-16  6:23       ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 11/17] target/i386: Simplify how x86_cpu_dump_local_apic_state() prints Markus Armbruster
2019-04-12 17:49   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 12/17] qom/cpu: Simplify how CPUClass::dump_statistics() prints Markus Armbruster
2019-04-12 17:50   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 13/17] qemu-print: New qemu_fprintf(), qemu_vfprintf() Markus Armbruster
2019-04-12 17:53   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 14/17] qom/cpu: Simplify how CPUClass:cpu_dump_state() prints Markus Armbruster
2019-04-15 16:47   ` Dr. David Alan Gilbert
2019-04-16  6:32     ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 15/17] monitor: Clean up how monitor_disas() funnels output to monitor Markus Armbruster
2019-04-12 18:01   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 16/17] disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h Markus Armbruster
2019-04-11 15:25   ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 17/17] include: Move fprintf_function to disas/ Markus Armbruster
2019-04-12 18:39   ` Dr. David Alan Gilbert
2019-04-13  4:59     ` Markus Armbruster
2019-04-11 15:49 ` [Qemu-devel] [PATCH 00/17] Clean up and simplify around fprintf_function no-reply

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=87tvey79jx.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=atar4qemu@gmail.com \
    --cc=dgilbert@redhat.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=qemu-devel@nongnu.org \
    /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 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.