diff options
| author | Norman Bintang <normanbt@chromium.org> | 2024-08-09 22:06:45 +0800 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2024-08-10 10:40:58 +0200 |
| commit | 72c0f57dbe8bf625108dc67e34f3472f28501776 (patch) | |
| tree | 020977d7bb88c4e3d5f2976a016546593405bd97 /include | |
| parent | e9606148a6712f7a73dc81d69e19325b61bd4d09 (diff) | |
| download | linux-72c0f57dbe8bf625108dc67e34f3472f28501776.tar.gz linux-72c0f57dbe8bf625108dc67e34f3472f28501776.tar.bz2 linux-72c0f57dbe8bf625108dc67e34f3472f28501776.zip | |
ALSA: pcm: Add xrun counter for snd_pcm_substream
This patch adds an xrun counter to snd_pcm_substream as an alternative
to using logs from XRUN_DEBUG_BASIC. The counter provides a way to track
the number of xrun occurences, accessible through the /proc interface.
The counter is enabled when CONFIG_SND_PCM_XRUN_DEBUG is set.
Example output:
$ cat /proc/asound/card0/pcm9p/sub0/status
owner_pid : 1425
trigger_time: 235.248957291
tstamp : 0.000000000
delay : 1912
avail : 480
avail_max : 1920
-----
hw_ptr : 672000
appl_ptr : 673440
xrun_counter: 3 # (new row)
Signed-off-by: Norman Bintang <normanbt@chromium.org>
Reviewed-by: Chih-Yang Hsia <paulhsia@chromium.org>
Tested-by: Chih-Yang Hsia <paulhsia@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
Link: https://patch.msgid.link/20240809140648.3414349-1-normanbt@chromium.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'include')
| -rw-r--r-- | include/sound/pcm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index ac8f3aef9205..384032b6c59c 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -498,6 +498,9 @@ struct snd_pcm_substream { /* misc flags */ unsigned int hw_opened: 1; unsigned int managed_buffer_alloc:1; +#ifdef CONFIG_SND_PCM_XRUN_DEBUG + unsigned int xrun_counter; /* number of times xrun happens */ +#endif /* CONFIG_SND_PCM_XRUN_DEBUG */ }; #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0) |
