qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Rate limit vnc_write_pixels_generic
@ 2012-05-07 13:58 Philipp Hahn
  2012-05-07 14:19 ` Anthony Liguori
  0 siblings, 1 reply; 3+ messages in thread
From: Philipp Hahn @ 2012-05-07 13:58 UTC (permalink / raw)
  To: qemu-devel, Anthony Liguori

Only print the error message once per change and also include the actual
unsupported color depth in bytes per pixel in the error message.

Signed-off-by: Philipp Hahn <hahn@univention.de>
---
 ui/vnc.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/ui/vnc.c b/ui/vnc.c
index deb9ecd..9dcff9b 100644
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -641,6 +641,7 @@ static void vnc_write_pixels_generic(VncState *vs, struct PixelFormat *pf,
                                      void *pixels1, int size)
 {
     uint8_t buf[4];
+    static uint8_t last_error_bpp = 4; /* any of the supported formats */
 
     if (pf->bytes_per_pixel == 4) {
         uint32_t *pixels = pixels1;
@@ -667,7 +668,12 @@ static void vnc_write_pixels_generic(VncState *vs, struct PixelFormat *pf,
             vnc_write(vs, buf, vs->clientds.pf.bytes_per_pixel);
         }
     } else {
-        fprintf(stderr, "vnc_write_pixels_generic: VncState color depth not supported\n");
+        if (last_error_bpp != pf->bytes_per_pixel) {
+            last_error_bpp = pf->bytes_per_pixel;
+            fprintf(stderr,
+                    "vnc_write_pixels_generic: VncState color depth %d not supported\n",
+                    pf->bytes_per_pixel);
+        }
     }
 }
 
-- 
1.7.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Rate limit vnc_write_pixels_generic
  2012-05-07 13:58 [Qemu-devel] [PATCH] Rate limit vnc_write_pixels_generic Philipp Hahn
@ 2012-05-07 14:19 ` Anthony Liguori
  2012-05-07 15:04   ` Philipp Hahn
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2012-05-07 14:19 UTC (permalink / raw)
  To: Philipp Hahn; +Cc: qemu-devel

On 05/07/2012 08:58 AM, Philipp Hahn wrote:
> Only print the error message once per change and also include the actual
> unsupported color depth in bytes per pixel in the error message.
>
> Signed-off-by: Philipp Hahn<hahn@univention.de>

Under what conditions are you seeing this happen?

Regards,

Anthony Liguori

> ---
>   ui/vnc.c |    8 +++++++-
>   1 files changed, 7 insertions(+), 1 deletions(-)
>
> diff --git a/ui/vnc.c b/ui/vnc.c
> index deb9ecd..9dcff9b 100644
> --- a/ui/vnc.c
> +++ b/ui/vnc.c
> @@ -641,6 +641,7 @@ static void vnc_write_pixels_generic(VncState *vs, struct PixelFormat *pf,
>                                        void *pixels1, int size)
>   {
>       uint8_t buf[4];
> +    static uint8_t last_error_bpp = 4; /* any of the supported formats */
>
>       if (pf->bytes_per_pixel == 4) {
>           uint32_t *pixels = pixels1;
> @@ -667,7 +668,12 @@ static void vnc_write_pixels_generic(VncState *vs, struct PixelFormat *pf,
>               vnc_write(vs, buf, vs->clientds.pf.bytes_per_pixel);
>           }
>       } else {
> -        fprintf(stderr, "vnc_write_pixels_generic: VncState color depth not supported\n");
> +        if (last_error_bpp != pf->bytes_per_pixel) {
> +            last_error_bpp = pf->bytes_per_pixel;
> +            fprintf(stderr,
> +                    "vnc_write_pixels_generic: VncState color depth %d not supported\n",
> +                    pf->bytes_per_pixel);
> +        }
>       }
>   }
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Rate limit vnc_write_pixels_generic
  2012-05-07 14:19 ` Anthony Liguori
@ 2012-05-07 15:04   ` Philipp Hahn
  0 siblings, 0 replies; 3+ messages in thread
From: Philipp Hahn @ 2012-05-07 15:04 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1314 bytes --]

Hello Anthony,

Am Montag 07 Mai 2012 16:19:57 schrieb Anthony Liguori:
> On 05/07/2012 08:58 AM, Philipp Hahn wrote:
> > Only print the error message once per change and also include the actual
> > unsupported color depth in bytes per pixel in the error message.
> >
> > Signed-off-by: Philipp Hahn<hahn@univention.de>
>
> Under what conditions are you seeing this happen?

Actually the kvm-version I'm seeing this on is a custom build from one of our 
partners with a custom RDP/RemoteFX extension they're working on. That 
versions currently spams my console with the message:

2012-05-07 14:16:21.363: starting up
vnc_write_pixels_generic: VncState color depth not supported
... 767 lines removed ...
2012-05-07 14:16:42.998: shutting down

That's 36 messages per second. So I looked up the source code and found that 
line, where I don't even see which bpp fails. At least that info I would find 
very helpful, the rate limiting was just a bonus.

Sincerely
Philipp
-- 
Philipp Hahn           Open Source Software Engineer      hahn@univention.de
Univention GmbH        be open.                       fon: +49 421 22 232- 0
Mary-Somerville-Str.1  D-28359 Bremen                 fax: +49 421 22 232-99
                                                   http://www.univention.de/

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-07 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07 13:58 [Qemu-devel] [PATCH] Rate limit vnc_write_pixels_generic Philipp Hahn
2012-05-07 14:19 ` Anthony Liguori
2012-05-07 15:04   ` Philipp Hahn

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).