Commit 5eafa1e1ba for qemu.org

commit 5eafa1e1ba6b4a1cbd86f8455eb2b8c3d83baf04
Author: Marc-André Lureau <marcandre.lureau@redhat.com>
Date:   Wed Jan 21 15:59:58 2026 +0400

    audio: replace DEBUG_AUDIO with trace

    Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
    Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
    Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>

diff --git a/audio/audio-mixeng-be.c b/audio/audio-mixeng-be.c
index 3dd9d17dd2..7eabb1c250 100644
--- a/audio/audio-mixeng-be.c
+++ b/audio/audio-mixeng-be.c
@@ -620,15 +620,6 @@ static size_t audio_pcm_sw_write(SWVoiceOut *sw, void *buf, size_t buf_len)
     return total_in * sw->info.bytes_per_frame;
 }

-#ifdef DEBUG_AUDIO
-static void audio_pcm_print_info (const char *cap, struct audio_pcm_info *info)
-{
-    dolog("%s: %s, freq %d, nchan %d\n",
-          cap, AudioFormat_str(info->af), info->freq,
-          info->nchannels);
-}
-#endif
-
 #define DAC
 #include "audio_template.h"
 #undef DAC
diff --git a/audio/audio_template.h b/audio/audio_template.h
index c47a2f202f..e884c8e9b1 100644
--- a/audio/audio_template.h
+++ b/audio/audio_template.h
@@ -556,11 +556,11 @@ static SW *glue(audio_mixeng_backend_open_, TYPE) (
     sw->callback.fn = callback_fn;
     sw->callback.opaque = callback_opaque;

-#ifdef DEBUG_AUDIO
-    dolog ("%s\n", name);
-    audio_pcm_print_info ("hw", &sw->hw->info);
-    audio_pcm_print_info ("sw", &sw->info);
-#endif
+    trace_audio_voice_pair(G_STRINGIFY(TYPE), name,
+                           AudioFormat_str(sw->hw->info.af),
+                           sw->hw->info.freq, sw->hw->info.nchannels,
+                           AudioFormat_str(sw->info.af),
+                           sw->info.freq, sw->info.nchannels);

     return sw;

diff --git a/audio/trace-events b/audio/trace-events
index 7a73d6eb84..ed04792d50 100644
--- a/audio/trace-events
+++ b/audio/trace-events
@@ -74,3 +74,4 @@ audio_out_played(size_t played) "played=%zu"
 # audio_template.h
 audio_open_out(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d"
 audio_open_in(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d"
+audio_voice_pair(const char *type, const char *name, const char *hw_fmt, int hw_freq, int hw_nchannels, const char *sw_fmt, int sw_freq, int sw_nchannels) "%s: name=%s hw=%s/%d/%d sw=%s/%d/%d"