diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c index 289f52af15b9..062eacd65668 100644 --- a/sound/core/pcm_lib.c +++ b/sound/core/pcm_lib.c @@ -28,6 +28,7 @@ #define trace_xrun(substream) #define trace_hw_ptr_error(substream, reason) #define trace_applptr(substream, prev, curr) +#define trace_applptr_start(substream, frame) #endif static int fill_silence_frames(struct snd_pcm_substream *substream, @@ -2131,6 +2132,8 @@ snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream, if (err < 0) return err; + trace_applptr_start(substream, size); + is_playback = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; if (interleaved) { if (runtime->access != SNDRV_PCM_ACCESS_RW_INTERLEAVED && diff --git a/sound/core/pcm_trace.h b/sound/core/pcm_trace.h index f18da2050772..535fbaa60c71 100644 --- a/sound/core/pcm_trace.h +++ b/sound/core/pcm_trace.h @@ -141,6 +141,32 @@ TRACE_EVENT(applptr, ) ); +TRACE_EVENT(applptr_start, + TP_PROTO(struct snd_pcm_substream *substream, snd_pcm_uframes_t size), + TP_ARGS(substream, size), + TP_STRUCT__entry( + __field( unsigned int, card ) + __field( unsigned int, device ) + __field( unsigned int, number ) + __field( unsigned int, stream ) + __field( snd_pcm_uframes_t, size ) + ), + TP_fast_assign( + __entry->card = (substream)->pcm->card->number; + __entry->device = (substream)->pcm->device; + __entry->number = (substream)->number; + __entry->stream = (substream)->stream; + __entry->size = (size); + ), + TP_printk("pcmC%dD%d%s/sub%d: size=%lu", + __entry->card, + __entry->device, + __entry->stream ? "c" : "p", + __entry->number, + __entry->size + ) +); + #endif /* _PCM_TRACE_H */ /* This part must be outside protection */