[PATCH 35/37] audio-be: add some state trace for debugging

marcandre.lureau@redhat.com posted 37 patches 2 weeks, 3 days ago
Maintainers: Gerd Hoffmann <kraxel@redhat.com>, Christian Schoenebeck <qemu_oss@crudebyte.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>, Thomas Huth <huth@tuxfamily.org>, Alexandre Ratchov <alex@caoua.org>, Laurent Vivier <laurent@vivier.eu>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Alex Bennée" <alex.bennee@linaro.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, John Snow <jsnow@redhat.com>, Cleber Rosa <crosa@redhat.com>
[PATCH 35/37] audio-be: add some state trace for debugging
Posted by marcandre.lureau@redhat.com 2 weeks, 3 days ago
From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 audio/audio-be.c   | 5 +++++
 audio/trace-events | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/audio/audio-be.c b/audio/audio-be.c
index b3fa8d9c549..23083a75c3a 100644
--- a/audio/audio-be.c
+++ b/audio/audio-be.c
@@ -4,6 +4,7 @@
 #include "qemu/audio.h"
 #include "qemu/audio-capture.h"
 #include "qapi/error.h"
+#include "trace-audio.h"
 
 bool audio_be_check(AudioBackend **be, Error **errp)
 {
@@ -134,6 +135,8 @@ void audio_be_set_active_out(AudioBackend *be, SWVoiceOut *sw, bool on)
 {
     AudioBackendClass *klass = AUDIO_BACKEND_GET_CLASS(be);
 
+    trace_audio_be_set_active_out(sw, on);
+
     if (!sw) {
         return;
     }
@@ -145,6 +148,8 @@ void audio_be_set_active_in(AudioBackend *be, SWVoiceIn *sw, bool on)
 {
     AudioBackendClass *klass = AUDIO_BACKEND_GET_CLASS(be);
 
+    trace_audio_be_set_active_in(sw, on);
+
     if (!sw) {
         return;
     }
diff --git a/audio/trace-events b/audio/trace-events
index 7e3f1593c81..f7f639d9605 100644
--- a/audio/trace-events
+++ b/audio/trace-events
@@ -26,6 +26,10 @@ pw_vol(const char *ret) "set volume: %s"
 pw_period(uint64_t quantum, uint32_t rate) "period =%" PRIu64 "/%u"
 pw_audio_init(void) "Initialize PipeWire context"
 
+# audio-be.c
+audio_be_set_active_in(void *sw, bool on) "sw=%p, on=%d"
+audio_be_set_active_out(void *sw, bool on) "sw=%p, on=%d"
+
 # audio.c
 audio_timer_start(int interval) "interval %d ms"
 audio_timer_stop(void) ""
-- 
2.52.0


Re: [PATCH 35/37] audio-be: add some state trace for debugging
Posted by Mark Cave-Ayland 5 days, 14 hours ago
On 23/01/2026 07:49, marcandre.lureau@redhat.com wrote:

> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>   audio/audio-be.c   | 5 +++++
>   audio/trace-events | 4 ++++
>   2 files changed, 9 insertions(+)
> 
> diff --git a/audio/audio-be.c b/audio/audio-be.c
> index b3fa8d9c549..23083a75c3a 100644
> --- a/audio/audio-be.c
> +++ b/audio/audio-be.c
> @@ -4,6 +4,7 @@
>   #include "qemu/audio.h"
>   #include "qemu/audio-capture.h"
>   #include "qapi/error.h"
> +#include "trace-audio.h"

Are we supposed to be including trace-audio.h directly as opposed to 
just trace.h?

>   
>   bool audio_be_check(AudioBackend **be, Error **errp)
>   {
> @@ -134,6 +135,8 @@ void audio_be_set_active_out(AudioBackend *be, SWVoiceOut *sw, bool on)
>   {
>       AudioBackendClass *klass = AUDIO_BACKEND_GET_CLASS(be);
>   
> +    trace_audio_be_set_active_out(sw, on);
> +
>       if (!sw) {
>           return;
>       }
> @@ -145,6 +148,8 @@ void audio_be_set_active_in(AudioBackend *be, SWVoiceIn *sw, bool on)
>   {
>       AudioBackendClass *klass = AUDIO_BACKEND_GET_CLASS(be);
>   
> +    trace_audio_be_set_active_in(sw, on);
> +
>       if (!sw) {
>           return;
>       }
> diff --git a/audio/trace-events b/audio/trace-events
> index 7e3f1593c81..f7f639d9605 100644
> --- a/audio/trace-events
> +++ b/audio/trace-events
> @@ -26,6 +26,10 @@ pw_vol(const char *ret) "set volume: %s"
>   pw_period(uint64_t quantum, uint32_t rate) "period =%" PRIu64 "/%u"
>   pw_audio_init(void) "Initialize PipeWire context"
>   
> +# audio-be.c
> +audio_be_set_active_in(void *sw, bool on) "sw=%p, on=%d"
> +audio_be_set_active_out(void *sw, bool on) "sw=%p, on=%d"
> +
>   # audio.c
>   audio_timer_start(int interval) "interval %d ms"
>   audio_timer_stop(void) ""

Otherwise:

Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>


ATB,

Mark.


Re: [PATCH 35/37] audio-be: add some state trace for debugging
Posted by Marc-André Lureau 5 days, 11 hours ago
Hi

On Wed, Feb 4, 2026 at 3:50 PM Mark Cave-Ayland
<mark.caveayland@nutanix.com> wrote:
>
> On 23/01/2026 07:49, marcandre.lureau@redhat.com wrote:
>
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> > ---
> >   audio/audio-be.c   | 5 +++++
> >   audio/trace-events | 4 ++++
> >   2 files changed, 9 insertions(+)
> >
> > diff --git a/audio/audio-be.c b/audio/audio-be.c
> > index b3fa8d9c549..23083a75c3a 100644
> > --- a/audio/audio-be.c
> > +++ b/audio/audio-be.c
> > @@ -4,6 +4,7 @@
> >   #include "qemu/audio.h"
> >   #include "qemu/audio-capture.h"
> >   #include "qapi/error.h"
> > +#include "trace-audio.h"
>
> Are we supposed to be including trace-audio.h directly as opposed to
> just trace.h?
>

That's a good question. There is also sometimes the "trace/.."
prefix.. I'll leave it as it is for now

> >
> >   bool audio_be_check(AudioBackend **be, Error **errp)
> >   {
> > @@ -134,6 +135,8 @@ void audio_be_set_active_out(AudioBackend *be, SWVoiceOut *sw, bool on)
> >   {
> >       AudioBackendClass *klass = AUDIO_BACKEND_GET_CLASS(be);
> >
> > +    trace_audio_be_set_active_out(sw, on);
> > +
> >       if (!sw) {
> >           return;
> >       }
> > @@ -145,6 +148,8 @@ void audio_be_set_active_in(AudioBackend *be, SWVoiceIn *sw, bool on)
> >   {
> >       AudioBackendClass *klass = AUDIO_BACKEND_GET_CLASS(be);
> >
> > +    trace_audio_be_set_active_in(sw, on);
> > +
> >       if (!sw) {
> >           return;
> >       }
> > diff --git a/audio/trace-events b/audio/trace-events
> > index 7e3f1593c81..f7f639d9605 100644
> > --- a/audio/trace-events
> > +++ b/audio/trace-events
> > @@ -26,6 +26,10 @@ pw_vol(const char *ret) "set volume: %s"
> >   pw_period(uint64_t quantum, uint32_t rate) "period =%" PRIu64 "/%u"
> >   pw_audio_init(void) "Initialize PipeWire context"
> >
> > +# audio-be.c
> > +audio_be_set_active_in(void *sw, bool on) "sw=%p, on=%d"
> > +audio_be_set_active_out(void *sw, bool on) "sw=%p, on=%d"
> > +
> >   # audio.c
> >   audio_timer_start(int interval) "interval %d ms"
> >   audio_timer_stop(void) ""
>
> Otherwise:
>
> Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
>
>
> ATB,
>
> Mark.
>