linux/sound
Takashi Iwai f5914908a5 ALSA: pcm: Replace PCM hwptr tracking with tracepoints
ALSA PCM core has a mechanism tracking the PCM hwptr updates for
analyzing XRUNs.  But its log is limited (up to 10) and its log output
is a kernel message, which is hard to handle.

In this patch, the hwptr logging is moved to the tracing
infrastructure instead of its own.  Not only the hwptr updates but
also XRUN and hwptr errors are recorded on the trace log, so that user
can see such events at the exact timing.

The new "snd_pcm" entry will appear in the tracing events:
  # ls -F /sys/kernel/debug/tracing/events/snd_pcm
  enable  filter  hw_ptr_error/  hwptr/  xrun/

The hwptr is for the regular hwptr update events.  An event trace
looks like:

  aplay-26187 [004] d..3  4012.834761: hwptr: pcmC0D0p/sub0: POS: pos=488, old=0, base=0, period=1024, buf=16384

"POS" shows the hwptr update by the explicit position update call and
"IRQ" means the hwptr update by the interrupt,
i.e. snd_pcm_period_elapsed() call.  The "pos" is the passed
ring-buffer offset by the caller, "old" is the previous hwptr, "base"
is the hwptr base position, "period" and "buf" are period- and
buffer-size of the target PCM substream.
(Note that the hwptr position displayed here isn't the ring-buffer
 offset.  It increments up to the PCM position boundary.)

The XRUN event appears similarly, but without "pos" field.
The hwptr error events appear with the PCM identifier and its reason
string, such as "Lost interrupt?".

The XRUN and hwptr error reports on kernel message are still left, can
be turned on/off via xrun_debug proc like before.  But the bit 3, 4, 5
and 6 bits of xrun_debug proc are dropped by this patch.  Also, along
with the change, the message strings have been reformatted to be a bit
more consistent.

Last but not least, the hwptr reporting is enabled only when
CONFIG_SND_PCM_XRUN_DEBUG is set.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-11-04 14:09:14 +01:00
..
aoa ALSA: aoa: Use snd_ctl_elem_info() 2014-10-21 08:08:36 +02:00
arm ASoC: pxa2xx-ac97: prepare and unprepare the clocks 2014-06-09 21:11:18 +01:00
atmel dmaengine: dw: split dma-dw.h to platform and private parts 2014-10-15 20:31:04 +05:30
core ALSA: pcm: Replace PCM hwptr tracking with tracepoints 2014-11-04 14:09:14 +01:00
drivers ALSA: vx: Use snd_ctl_elem_info() 2014-10-21 08:12:15 +02:00
firewire Merge branch 'for-linus' into for-next 2014-10-27 14:11:07 +01:00
i2c ALSA: ak4xxx-adda: Use snd_ctl_enum_info() 2014-10-21 08:29:54 +02:00
isa ALSA: wss: Use snd_ctl_enum_info() 2014-10-21 08:35:53 +02:00
mips ALSA: mips: Use snd_ctl_enum_info() 2014-10-21 08:36:44 +02:00
oss sound fixes for 3.17-rc1 2014-08-15 18:06:56 -06:00
parisc ALSA: parisc: Use snd_ctl_enum_info() 2014-10-21 08:37:36 +02:00
pci Merge branch 'topic/kerneldoc' into for-next 2014-10-31 09:31:06 +01:00
pcmcia ALSA: pdaudiocf: Use nonatomic PCM ops 2014-09-15 15:52:38 +02:00
ppc ALSA: ppc: Use snd_ctl_enum_info() 2014-10-21 09:13:59 +02:00
sh
soc Merge remote-tracking branches 'asoc/fix/adau1761', 'asoc/fix/fsl', 'asoc/fix/intel', 'asoc/fix/s6000' and 'asoc/fix/sgtl5000' into asoc-linus 2014-10-27 11:17:41 +00:00
sparc ALSA: sparc: Use snd_ctl_enum_info() 2014-10-21 09:14:28 +02:00
spi
synth ALSA: synth: emux: soundfont.c: Cleaning up memory leak 2014-06-01 14:33:09 +02:00
usb sound fixes for 3.18-rc2 2014-10-24 12:35:48 -07:00
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c
sound_firmware.c