linux/sound/core
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
..
oss ALSA: oss: Use standard printk helpers 2014-02-14 08:14:17 +01:00
seq Subject: ALSA: seq: Remove autoload locks in driver registration 2014-10-18 20:25:19 +02:00
compress_offload.c ALSA: compress: fix an integer overflow check 2014-07-16 15:27:03 +02:00
control_compat.c ALSA: control: Use standard printk helpers 2014-02-14 08:14:14 +01:00
control.c ALSA: control: Add missing kerneldoc comments to exported functions 2014-10-30 13:44:34 +01:00
ctljack.c ALSA: hda - Add missing inclusion of linux/export.h 2011-11-16 14:28:33 +01:00
device.c ALSA: Clean up snd_device_*() codes 2014-02-25 12:12:52 +01:00
hrtimer.c ALSA: timer: Use standard printk helpers 2014-02-14 08:14:17 +01:00
hwdep_compat.c
hwdep.c ALSA: Move EXPORT_SYMBOL() in appropriate places 2014-02-27 16:00:51 +01:00
info_oss.c ALSA: remove the main version information 2012-09-04 11:38:32 +02:00
info.c ALSA: core: fix buffer overflow in snd_info_get_line() 2014-08-22 07:21:05 +02:00
init.c ALSA: doc: More kerneldoc comments on core components 2014-10-30 15:42:32 +01:00
isadma.c ALSA: core: Use standard printk helpers 2014-02-14 08:14:15 +01:00
jack.c ALSA: jack: Unregister input device at disconnection 2013-11-14 17:22:45 +01:00
Kconfig ALSA: core: allow SND_DMAENGINE_PCM use from modules 2013-08-15 18:28:42 +01:00
Makefile ALSA: pcm: Replace PCM hwptr tracking with tracepoints 2014-11-04 14:09:14 +01:00
memalloc.c ALSA: core: Use standard printk helpers 2014-02-14 08:14:15 +01:00
memory.c ALSA: add/change some comments describing function return values 2013-03-12 08:32:53 +01:00
misc.c ALSA: Allow pass NULL dev for snd_pci_quirk_lookup() 2014-10-08 12:08:38 +02:00
pcm_compat.c ALSA: pcm: Add tstamp_type and proto to sw_params compat layer 2014-07-21 09:08:18 +02:00
pcm_dmaengine.c ALSA: pcm_dmaengine: Correct support for 24bits physical sample widths 2014-07-04 18:55:25 +01:00
pcm_lib.c ALSA: pcm: Replace PCM hwptr tracking with tracepoints 2014-11-04 14:09:14 +01:00
pcm_memory.c ALSA: PCM: Warn when buffer preallocation fails 2014-01-11 11:04:23 +01:00
pcm_misc.c Merge branch 'for-linus' into for-next 2014-09-11 13:43:49 +02:00
pcm_native.c ALSA: pcm: Refactoring snd_pcm_action() 2014-10-31 15:27:02 +01:00
pcm_timer.c ALSA: pcm: Use standard printk helpers 2014-02-14 08:14:15 +01:00
pcm_trace.h ALSA: pcm: Replace PCM hwptr tracking with tracepoints 2014-11-04 14:09:14 +01:00
pcm.c ALSA: pcm: More kerneldoc updates 2014-10-30 15:42:27 +01:00
rawmidi_compat.c
rawmidi.c ALSA: Move EXPORT_SYMBOL() in appropriate places 2014-02-27 16:00:51 +01:00
rtctimer.c ALSA: timer: Use standard printk helpers 2014-02-14 08:14:17 +01:00
sgbuf.c ALSA: Make snd_sgbuf_get_{ptr|addr}() available for non-SG cases 2012-09-23 11:24:42 +02:00
sound_oss.c ALSA: Use standard device refcount for card accounting 2014-02-14 08:14:13 +01:00
sound.c ALSA: doc: More kerneldoc comments on core components 2014-10-30 15:42:32 +01:00
timer_compat.c
timer.c ALSA: core: Use ktime_get_ts() 2014-06-12 12:58:16 +02:00
vmaster.c ALSA: core: Use standard printk helpers 2014-02-14 08:14:15 +01:00