Skip to content

RFC ALSA: virtio: trace control message lifecycles

Joonho Lee linux-sound lkml virtualization 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest1 patch 0 repliesNew
  2. v1 RFC1 patch 0 repliesSuperseded

Changes in v2 from the cover letter

- Group internal helper event arguments in struct virtsnd_ctl_event.
- Use designated initializers and named validity flags instead of positional booleans. Keep TRACE_EVENT and its record format unchanged.

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/1ALSA: virtio: trace control message lifecyclessound/virtio/Makefile sound/virtio/virtio_ctl_msg.c sound/virtio/virtio_ctl_msg_trace.h+286 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/1] ALSA: virtio: trace control message lifecycles

Hi,

This adds a control-message lifecycle trace event to virtio-snd. A per-send ID connects enqueue, response, cancellation and sender wait outcomes, including a response arriving after a timeout.

Changes in v2:
- Group internal helper event arguments in struct virtsnd_ctl_event.
- Use designated initializers and named validity flags instead of positional booleans. Keep TRACE_EVENT and its record format unchanged.

The event definition, error handling and request lifetime are unchanged from v1. The patch applies directly to the base below and has no dependency on the experimental VZ capture changes.

Validation of v2:
- ARM64 W=1 builds, including KASAN/lockdep, BPF events and tracing-disabled configurations, passed without warnings or errors.
- Eight QEMU boots passed malformed-response, enqueue failure, asynchronous completion, interrupted wait, timeout and reset/recovery checks. Trace-on fixture runs recorded 280 events each without loss or KASAN/lockdep reports.
- A non-debug QEMU/HVF comparison completed 90,000 lifecycle cycles and three 10-second synthetic captures at 4,096 frames. All functional checks passed; captures each read 480,000 frames with no XRUNs or read errors.

On GCC 14.2.0 ARM64, the event arguments are scalarized. The control object text shrinks by 56 bytes and the send stack frame drops from 192 to 176 bytes. With event tracing compiled out, the old and new object text is identical. The existing 24-byte per-request metadata cost remains unchanged.

Host-load stability checks failed during the timing comparison, so those measurements do not establish an isolated runtime overhead percentage. These regressions use synthetic QEMU devices; native VZ steady-capture performance and physical microphone acceptance remain unverified.

The malformed-length fixture writes a full response and changes only the reported used length. The sender retains its existing behavior; this patch records diagnostic fields without changing protocol validation.

Previous version:
https://lore.kernel.org/linux-sound/[email protected]/T/

Thanks,
Joonho

Joonho Lee (1):
ALSA: virtio: trace control message lifecycles

 sound/virtio/Makefile               |   2 +
 sound/virtio/virtio_ctl_msg.c       | 178 +++++++++++++++++++++++++++++++++++-
 sound/virtio/virtio_ctl_msg_trace.h | 107 ++++++++++++++++++++++
 3 files changed, 286 insertions(+), 1 deletion(-)

base-commit: 2f2f7eeef8b0a1a9b9ca998231419873ccae8d4e