All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Alistair Francis <alistair.francis@xilinx.com>, qemu-devel@nongnu.org
Cc: alistair23@gmail.com, armbru@redhat.com,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>,
	Michael Walle <michael@walle.cc>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Yongbok Kim <yongbok.kim@imgtec.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Guan Xuetao <gxt@mprc.pku.edu.cn>,
	qemu-arm@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v1 8/8] target: Replace fprintf(stderr, "*\n" with error_report()
Date: Tue, 26 Sep 2017 08:21:24 -0700	[thread overview]
Message-ID: <d591fe76-6305-e082-3dc3-b53178c0ee5d@twiddle.net> (raw)
In-Reply-To: <5ad72536402da2879d49b58753cc709a8ff22de9.1506384415.git.alistair.francis@xilinx.com>

On 09/25/2017 05:09 PM, Alistair Francis wrote:
> diff --git a/target/cris/translate.c b/target/cris/translate.c
> index 38a999e6f1..8847005984 100644
> --- a/target/cris/translate.c
> +++ b/target/cris/translate.c
> @@ -138,7 +138,7 @@ typedef struct DisasContext {
>  
>  static void gen_BUG(DisasContext *dc, const char *file, int line)
>  {
> -    fprintf(stderr, "BUG: pc=%x %s %d\n", dc->pc, file, line);
> +    error_report("BUG: pc=%x %s %d", dc->pc, file, line);
>      if (qemu_log_separate()) {
>          qemu_log("BUG: pc=%x %s %d\n", dc->pc, file, line);
>      }

Eh, no, this should simply use qemu_log.

> diff --git a/target/ppc/translate.c b/target/ppc/translate.c
> index 606b605ba0..a3da22580e 100644
> --- a/target/ppc/translate.c
> +++ b/target/ppc/translate.c
> @@ -3943,8 +3943,8 @@ static inline void gen_op_mfspr(DisasContext *ctx)
>               * allowing userland application to read the PVR
>               */
>              if (sprn != SPR_PVR) {
> -                fprintf(stderr, "Trying to read privileged spr %d (0x%03x) at "
> -                        TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);
> +                error_report("Trying to read privileged spr %d (0x%03x) at "
> +                        TARGET_FMT_lx "", sprn, sprn, ctx->nip - 4);
>                  if (qemu_log_separate()) {
>                      qemu_log("Trying to read privileged spr %d (0x%03x) at "
>                               TARGET_FMT_lx "\n", sprn, sprn, ctx->nip - 4);

Likewise.  And all the others.
Perhaps we should kill qemu_log_separate as a bad idea?

> diff --git a/target/sh4/translate.c b/target/sh4/translate.c
> index 10191073b2..9f95410e53 100644
> --- a/target/sh4/translate.c
> +++ b/target/sh4/translate.c
> @@ -438,7 +438,7 @@ static void _decode_opc(DisasContext * ctx)
>  	}
>  
>  #if 0
> -    fprintf(stderr, "Translating opcode 0x%04x\n", ctx->opcode);
> +    error_report("Translating opcode 0x%04x", ctx->opcode);
>  #endif

qemu_log.

>  
>      switch (ctx->opcode) {
> @@ -1799,7 +1799,7 @@ static void _decode_opc(DisasContext * ctx)
>          break;
>      }
>  #if 0
> -    fprintf(stderr, "unknown instruction 0x%04x at pc 0x%08x\n",
> +    error_report("unknown instruction 0x%04x at pc 0x%08x",
>  	    ctx->opcode, ctx->pc);
>      fflush(stderr);
>  #endif

qemu_log_mask(LOG_UNIMP, ...)

> @@ -1940,7 +1940,7 @@ void gen_intermediate_code(CPUState *cs, TranslationBlock *tb)
>          disas_uc32_insn(env, dc);
>  
>          if (num_temps) {
> -            fprintf(stderr, "Internal resource leak before %08x\n", dc->pc);
> +            error_report("Internal resource leak before %08x", dc->pc);
>              num_temps = 0;
>          }
>  
> 

qemu_log.


r~

  parent reply	other threads:[~2017-09-26 15:21 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-26  0:08 [Qemu-devel] [PATCH v1 0/8] Remove some of the fprintf(stderr, "* Alistair Francis
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 1/8] Replace all occurances of __FUNCTION__ with __func__ Alistair Francis
2017-09-26  0:08   ` Alistair Francis
2017-09-26 13:32   ` [Qemu-devel] " Eric Blake
2017-09-26 13:32   ` Eric Blake
2017-09-27 22:59     ` Alistair Francis
2017-09-27 22:59     ` Alistair Francis
2017-09-27 23:47     ` [Qemu-devel] [Qemu-arm] " Peter Maydell
2017-09-28 22:37       ` Alistair Francis
2017-09-28 22:37         ` [Qemu-arm] [Qemu-devel] " Alistair Francis
2017-09-27 23:47     ` Peter Maydell
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 2/8] tests: Replace fprintf(stderr, "*\n" with error_report() Alistair Francis
2017-09-26  0:55   ` Emilio G. Cota
2017-09-26 14:03     ` Eric Blake
2017-09-27 23:08     ` Alistair Francis
2017-09-28 17:53       ` Emilio G. Cota
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 3/8] hw: " Alistair Francis
2017-09-26  0:08   ` Alistair Francis
2017-09-26  3:51   ` [Qemu-devel] " Thomas Huth
2017-09-27 22:41     ` Alistair Francis
2017-09-27 22:41       ` Alistair Francis
2017-09-26  3:51   ` Thomas Huth
2017-09-26  0:08 ` [Qemu-devel] [PATCH v1 4/8] block: " Alistair Francis
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 5/8] util: " Alistair Francis
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 6/8] ui: " Alistair Francis
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 7/8] tcg: " Alistair Francis
2017-09-26 15:05   ` Richard Henderson
2017-09-26  0:09 ` [Qemu-devel] [PATCH v1 8/8] target: " Alistair Francis
2017-09-26  4:08   ` Thomas Huth
2017-09-29 18:12     ` Alistair Francis
2017-09-26 15:21   ` Richard Henderson [this message]
2017-09-26  0:27 ` [Qemu-devel] [PATCH v1 0/8] Remove some of the fprintf(stderr, "* no-reply
2017-09-26  0:42 ` no-reply
2017-09-26  9:05 ` Stefan Hajnoczi
2017-09-26 16:47   ` Alistair Francis

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=d591fe76-6305-e082-3dc3-b53178c0ee5d@twiddle.net \
    --to=rth@twiddle.net \
    --cc=alistair.francis@xilinx.com \
    --cc=alistair23@gmail.com \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=ehabkost@redhat.com \
    --cc=gxt@mprc.pku.edu.cn \
    --cc=michael@walle.cc \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=yongbok.kim@imgtec.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 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.