audio: replace ldebug with trace events
Replace the ldebug macro calls with proper trace events: - audio_get_avail: traces available samples in capture stream - audio_open_out/audio_open_in: traces stream open parameters This provides structured tracing that can be enabled at runtime without requiring debug builds. 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>
Marc-André Lureau committed
Jan 20, 2026 at 23:50 UTC
c661a2c4482ec73ada826cdb14345e9379a02821
3 files changed
+13
-7
audio/audio-mixeng-be.c
+1
-5
@@ -881,11 +881,7 @@ static size_t audio_get_avail(SWVoiceIn *sw)
881
return 0;
882
}
883
884
- ldebug (
885
- "%s: get_avail live %zu frontend frames %u\n",
886
- SW_NAME (sw),
887
- live, st_rate_frames_out(sw->rate, live)
888
- );
884
+ trace_audio_get_avail(SW_NAME(sw), live, st_rate_frames_out(sw->rate, live));
885
886
return live;
887
}
audio/audio_template.h
+5
-2
@@ -507,8 +507,11 @@ static SW *glue(audio_mixeng_backend_open_, TYPE) (
507
k = AUDIO_MIXENG_BACKEND_GET_CLASS(s);
508
pdo = glue(audio_get_pdo_, TYPE)(s->dev);
509
510
- ldebug ("open %s, freq %d, nchannels %d, fmt %d\n",
511
- name, as->freq, as->nchannels, as->fmt);
510
+#ifdef DAC
511
+ trace_audio_open_out(name, as->freq, as->nchannels, as->fmt);
512
+#else
513
+ trace_audio_open_in(name, as->freq, as->nchannels, as->fmt);
514
+#endif
515
516
if (audio_bug(__func__, audio_validate_settings(as))) {
517
audio_print_settings (as);
audio/trace-events
+7
@@ -58,3 +58,10 @@ audio_be_set_active_out(void *sw, bool on) "sw=%p, on=%d"
58
audio_timer_start(int interval) "interval %d ms"
59
audio_timer_stop(void) ""
60
audio_timer_delayed(int interval) "interval %d ms"
61
+
62
+# audio-mixeng-be.c
63
+audio_get_avail(const char *name, size_t live, uint32_t frontend_frames) "%s: get_avail live %zu frontend frames %u"
64
+
65
+# audio_template.h
66
+audio_open_out(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d"
67
+audio_open_in(const char *name, int freq, int nchannels, int fmt) "open %s, freq %d, nchannels %d, fmt %d"