All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Only print unknown command message in debug mode
@ 2018-01-30  3:58 John Arbuckle
  2018-01-30  4:17 ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 3+ messages in thread
From: John Arbuckle @ 2018-01-30  3:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: John Arbuckle

After using QEMU with the sb16 sound card I would see all these messages about some numbered command not being understood. It became annoying after a while to always see this message, so this patch changes things so that the message is only printed when DEBUG is defined. 

Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
---
 hw/audio/sb16.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
index 6ab2f6f89a..45b679c4df 100644
--- a/hw/audio/sb16.c
+++ b/hw/audio/sb16.c
@@ -632,7 +632,7 @@ static void command (SB16State *s, uint8_t cmd)
     return;
 
  warn:
-    dolog ("warning: command %#x,%d is not truly understood yet\n",
+    ldebug("warning: command %#x,%d is not truly understood yet\n",
            cmd, s->needed_bytes);
     goto exit;
 
-- 
2.14.3 (Apple Git-98)

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

* Re: [Qemu-devel] [PATCH] Only print unknown command message in debug mode
  2018-01-30  3:58 [Qemu-devel] [PATCH] Only print unknown command message in debug mode John Arbuckle
@ 2018-01-30  4:17 ` Philippe Mathieu-Daudé
  2018-01-30  4:19   ` Programmingkid
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-01-30  4:17 UTC (permalink / raw)
  To: John Arbuckle, Gerd Hoffmann; +Cc: qemu-devel

Hi John,

On 01/30/2018 12:58 AM, John Arbuckle wrote:
> After using QEMU with the sb16 sound card I would see all these messages about some numbered command not being understood. It became annoying after a while to always see this message, so this patch changes things so that the message is only printed when DEBUG is defined. 
> 
> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
> ---
>  hw/audio/sb16.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
> index 6ab2f6f89a..45b679c4df 100644
> --- a/hw/audio/sb16.c
> +++ b/hw/audio/sb16.c
> @@ -632,7 +632,7 @@ static void command (SB16State *s, uint8_t cmd)
>      return;
>  
>   warn:
> -    dolog ("warning: command %#x,%d is not truly understood yet\n",
> +    ldebug("warning: command %#x,%d is not truly understood yet\n",
>             cmd, s->needed_bytes);

While changing this file can you use the latest logging API? such:

     qemu_log_mask(LOG_UNIMP, "unimplemented command 0x%02x (size:%d)",
                   cmd, s->needed_bytes);

So one can enable this log level at runtime (with "-d unimp"), the
#define DEBUG is compile time (require a rebuild).

>      goto exit;
>  
> 

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

* Re: [Qemu-devel] [PATCH] Only print unknown command message in debug mode
  2018-01-30  4:17 ` Philippe Mathieu-Daudé
@ 2018-01-30  4:19   ` Programmingkid
  0 siblings, 0 replies; 3+ messages in thread
From: Programmingkid @ 2018-01-30  4:19 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé; +Cc: Gerd Hoffmann, qemu-devel


> On Jan 29, 2018, at 11:17 PM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> 
> Hi John,
> 
> On 01/30/2018 12:58 AM, John Arbuckle wrote:
>> After using QEMU with the sb16 sound card I would see all these messages about some numbered command not being understood. It became annoying after a while to always see this message, so this patch changes things so that the message is only printed when DEBUG is defined. 
>> 
>> Signed-off-by: John Arbuckle <programmingkidx@gmail.com>
>> ---
>> hw/audio/sb16.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/hw/audio/sb16.c b/hw/audio/sb16.c
>> index 6ab2f6f89a..45b679c4df 100644
>> --- a/hw/audio/sb16.c
>> +++ b/hw/audio/sb16.c
>> @@ -632,7 +632,7 @@ static void command (SB16State *s, uint8_t cmd)
>>     return;
>> 
>>  warn:
>> -    dolog ("warning: command %#x,%d is not truly understood yet\n",
>> +    ldebug("warning: command %#x,%d is not truly understood yet\n",
>>            cmd, s->needed_bytes);
> 
> While changing this file can you use the latest logging API? such:
> 
>     qemu_log_mask(LOG_UNIMP, "unimplemented command 0x%02x (size:%d)",
>                   cmd, s->needed_bytes);
> 
> So one can enable this log level at runtime (with "-d unimp"), the
> #define DEBUG is compile time (require a rebuild).
> 
>>     goto exit;

Absolutely. This is a good idea.

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

end of thread, other threads:[~2018-01-30  4:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-30  3:58 [Qemu-devel] [PATCH] Only print unknown command message in debug mode John Arbuckle
2018-01-30  4:17 ` Philippe Mathieu-Daudé
2018-01-30  4:19   ` Programmingkid

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.