Skip to content

Commit

Permalink
ALSA: hda - add hdac stream trace
Browse files Browse the repository at this point in the history
Add the trace of snd_hdac_stream_start and snd_hdac_stream_stop.

Signed-off-by: Libin Yang <libin.yang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Libin Yang authored and Takashi Iwai committed May 18, 2015
1 parent 5c03be0 commit 598dfb5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sound/hda/hdac_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sound/pcm.h>
#include <sound/hdaudio.h>
#include <sound/hda_register.h>
#include "trace.h"

/**
* snd_hdac_stream_init - initialize each stream (aka device)
Expand Down Expand Up @@ -48,6 +49,8 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start)
{
struct hdac_bus *bus = azx_dev->bus;

trace_snd_hdac_stream_start(bus, azx_dev);

azx_dev->start_wallclk = snd_hdac_chip_readl(bus, WALLCLK);
if (!fresh_start)
azx_dev->start_wallclk -= azx_dev->period_wallclk;
Expand Down Expand Up @@ -82,6 +85,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_stream_clear);
*/
void snd_hdac_stream_stop(struct hdac_stream *azx_dev)
{
trace_snd_hdac_stream_stop(azx_dev->bus, azx_dev);

snd_hdac_stream_clear(azx_dev);
/* disable SIE */
snd_hdac_chip_updatel(azx_dev->bus, INTCTL, 1 << azx_dev->index, 0);
Expand Down
27 changes: 27 additions & 0 deletions sound/hda/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,33 @@ TRACE_EVENT(hda_unsol_event,
),
TP_printk("%s", __get_str(msg))
);

DECLARE_EVENT_CLASS(hdac_stream,
TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),

TP_ARGS(bus, azx_dev),

TP_STRUCT__entry(
__field(unsigned char, stream_tag)
),

TP_fast_assign(
__entry->stream_tag = (azx_dev)->stream_tag;
),

TP_printk("stream_tag: %d", __entry->stream_tag)
);

DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
TP_ARGS(bus, azx_dev)
);

DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
TP_ARGS(bus, azx_dev)
);

#endif /* __HDAC_TRACE_H */

/* This part must be outside protection */
Expand Down

0 comments on commit 598dfb5

Please sign in to comment.