qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Philipp Hahn <hahn@univention.de>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] hw/dma: Print error message only once
Date: Tue, 09 Sep 2014 09:51:05 +0200	[thread overview]
Message-ID: <540EB169.2000707@redhat.com> (raw)
In-Reply-To: <99e4360794b046985ff18c584ee6c11858457392.1410246092.git.hahn@univention.de>

Il 09/09/2014 09:01, Philipp Hahn ha scritto:
> otherwise the message
> 	dma: unregistered DMA channel used nchan=0 dma_pos=0 dma_len=1
> gets printed every time and fills up the log-file with 50 MiB / minute.
> 
> Signed-off-by: Philipp Hahn <hahn@univention.de>
> ---
>  hw/dma/i8257.c | 10 ++++++++--
>  1 file changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/dma/i8257.c b/hw/dma/i8257.c
> index dd370ed..9673ab6 100644
> --- a/hw/dma/i8257.c
> +++ b/hw/dma/i8257.c
> @@ -473,8 +473,14 @@ static void dma_reset(void *opaque)
>  
>  static int dma_phony_handler (void *opaque, int nchan, int dma_pos, int dma_len)
>  {
> -    dolog ("unregistered DMA channel used nchan=%d dma_pos=%d dma_len=%d\n",
> -           nchan, dma_pos, dma_len);
> +    static int once;
> +    int mask = 1 << nchan;
> +
> +    if (0 == (once & mask)) {
> +        once |= mask;
> +        dolog("unregistered DMA channel used nchan=%d dma_pos=%d dma_len=%d\n",
> +              nchan, dma_pos, dma_len);
> +    }
>      return dma_pos;
>  }
>  
> 

Can you just convert it to a tracepoint and remove the message?

Thanks,

Paolo

  reply	other threads:[~2014-09-09  7:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09  7:01 [Qemu-devel] [PATCH] hw/dma: Print error message only once Philipp Hahn
2014-09-09  7:51 ` Paolo Bonzini [this message]
2014-09-10 11:47   ` [Qemu-devel] [PATCH v2] hw/dma/i8257: Silence phony error message Philipp Hahn

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=540EB169.2000707@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=hahn@univention.de \
    --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 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).