summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibin Yang <libin.yang@intel.com>2015-05-11 21:43:20 -0400
committerTakashi Iwai <tiwai@suse.de>2015-05-18 04:06:20 -0400
commit598dfb56b016615f5f49848b58a1ce151acd3bd3 (patch)
tree4c272033e253aa5c71a5732e74e82d248828dccf
parent5c03be00cd9eb164be7c7e3bd9065c7ac2df4a29 (diff)
ALSA: hda - add hdac stream trace
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>
-rw-r--r--sound/hda/hdac_stream.c5
-rw-r--r--sound/hda/trace.h27
2 files changed, 32 insertions, 0 deletions
diff --git a/sound/hda/hdac_stream.c b/sound/hda/hdac_stream.c
index 1ba0462ef7ca..52a894fe478f 100644
--- a/sound/hda/hdac_stream.c
+++ b/sound/hda/hdac_stream.c
@@ -10,6 +10,7 @@
10#include <sound/pcm.h> 10#include <sound/pcm.h>
11#include <sound/hdaudio.h> 11#include <sound/hdaudio.h>
12#include <sound/hda_register.h> 12#include <sound/hda_register.h>
13#include "trace.h"
13 14
14/** 15/**
15 * snd_hdac_stream_init - initialize each stream (aka device) 16 * snd_hdac_stream_init - initialize each stream (aka device)
@@ -48,6 +49,8 @@ void snd_hdac_stream_start(struct hdac_stream *azx_dev, bool fresh_start)
48{ 49{
49 struct hdac_bus *bus = azx_dev->bus; 50 struct hdac_bus *bus = azx_dev->bus;
50 51
52 trace_snd_hdac_stream_start(bus, azx_dev);
53
51 azx_dev->start_wallclk = snd_hdac_chip_readl(bus, WALLCLK); 54 azx_dev->start_wallclk = snd_hdac_chip_readl(bus, WALLCLK);
52 if (!fresh_start) 55 if (!fresh_start)
53 azx_dev->start_wallclk -= azx_dev->period_wallclk; 56 azx_dev->start_wallclk -= azx_dev->period_wallclk;
@@ -82,6 +85,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_stream_clear);
82 */ 85 */
83void snd_hdac_stream_stop(struct hdac_stream *azx_dev) 86void snd_hdac_stream_stop(struct hdac_stream *azx_dev)
84{ 87{
88 trace_snd_hdac_stream_stop(azx_dev->bus, azx_dev);
89
85 snd_hdac_stream_clear(azx_dev); 90 snd_hdac_stream_clear(azx_dev);
86 /* disable SIE */ 91 /* disable SIE */
87 snd_hdac_chip_updatel(azx_dev->bus, INTCTL, 1 << azx_dev->index, 0); 92 snd_hdac_chip_updatel(azx_dev->bus, INTCTL, 1 << azx_dev->index, 0);
diff --git a/sound/hda/trace.h b/sound/hda/trace.h
index 33a7eb5573d4..e27e2c0b7b17 100644
--- a/sound/hda/trace.h
+++ b/sound/hda/trace.h
@@ -50,6 +50,33 @@ TRACE_EVENT(hda_unsol_event,
50 ), 50 ),
51 TP_printk("%s", __get_str(msg)) 51 TP_printk("%s", __get_str(msg))
52); 52);
53
54DECLARE_EVENT_CLASS(hdac_stream,
55 TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
56
57 TP_ARGS(bus, azx_dev),
58
59 TP_STRUCT__entry(
60 __field(unsigned char, stream_tag)
61 ),
62
63 TP_fast_assign(
64 __entry->stream_tag = (azx_dev)->stream_tag;
65 ),
66
67 TP_printk("stream_tag: %d", __entry->stream_tag)
68);
69
70DEFINE_EVENT(hdac_stream, snd_hdac_stream_start,
71 TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
72 TP_ARGS(bus, azx_dev)
73);
74
75DEFINE_EVENT(hdac_stream, snd_hdac_stream_stop,
76 TP_PROTO(struct hdac_bus *bus, struct hdac_stream *azx_dev),
77 TP_ARGS(bus, azx_dev)
78);
79
53#endif /* __HDAC_TRACE_H */ 80#endif /* __HDAC_TRACE_H */
54 81
55/* This part must be outside protection */ 82/* This part must be outside protection */