Skip to contentSkip to conversation

Only print unknown command message in debug mode

PATCH In review John Arbuckle 2 participants 3 messages Jan 30, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Only print unknown command message in debug mode

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.

---
 hw/audio/sb16.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/audio/sb16.c +1 -1
index 6ab2f6f89a..45b679c4df 100644
@@ -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;
 
Signature · 1 line
2.14.3 (Apple Git-98)
#1 lore raw

Hi John,

Quoted 12 lines · 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.

---
 hw/audio/sb16.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
hw/audio/sb16.c +0 -0
index 6ab2f6f89a..45b679c4df 100644

hw/audio/sb16.c static void command (SB16State *s, uint8_t cmd) · line 636

Quoted 6 lines
hw/audio/sb16.c +1 -1
@@ -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).

Quoted 3 lines
hw/audio/sb16.c +0 -0
     goto exit;
 
#2 lore raw
Quoted 27 lines · Philippe Mathieu-Daudé

Hi John,

Quoted 12 lines · 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.

---
hw/audio/sb16.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
hw/audio/sb16.c +0 -0
index 6ab2f6f89a..45b679c4df 100644

hw/audio/sb16.c static void command (SB16State *s, uint8_t cmd) · line 636

Quoted 6 lines
hw/audio/sb16.c +1 -1
@@ -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:

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

Quoted 1 line
hw/audio/sb16.c +0 -0
    goto exit;

Absolutely. This is a good idea.