diff options
-rw-r--r-- | include/trace/events/asoc.h | 64 | ||||
-rw-r--r-- | sound/soc/soc-core.c | 5 |
2 files changed, 69 insertions, 0 deletions
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h new file mode 100644 index 000000000000..93c3371daaca --- /dev/null +++ b/include/trace/events/asoc.h | |||
@@ -0,0 +1,64 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM asoc | ||
3 | |||
4 | #if !defined(_TRACE_ASOC_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_ASOC_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | |||
10 | struct snd_soc_codec; | ||
11 | |||
12 | /* | ||
13 | * Log register events | ||
14 | */ | ||
15 | DECLARE_EVENT_CLASS(snd_soc_reg, | ||
16 | |||
17 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
18 | unsigned int val), | ||
19 | |||
20 | TP_ARGS(codec, reg, val), | ||
21 | |||
22 | TP_STRUCT__entry( | ||
23 | __string( name, codec->name ) | ||
24 | __field( int, id ) | ||
25 | __field( unsigned int, reg ) | ||
26 | __field( unsigned int, val ) | ||
27 | ), | ||
28 | |||
29 | TP_fast_assign( | ||
30 | __assign_str(name, codec->name); | ||
31 | __entry->id = codec->id; | ||
32 | __entry->reg = reg; | ||
33 | __entry->val = val; | ||
34 | ), | ||
35 | |||
36 | TP_printk("codec=%s.%d reg=%x val=%x", __get_str(name), | ||
37 | (int)__entry->id, (unsigned int)__entry->reg, | ||
38 | (unsigned int)__entry->val) | ||
39 | ); | ||
40 | |||
41 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_write, | ||
42 | |||
43 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
44 | unsigned int val), | ||
45 | |||
46 | TP_ARGS(codec, reg, val) | ||
47 | |||
48 | ); | ||
49 | |||
50 | DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read, | ||
51 | |||
52 | TP_PROTO(struct snd_soc_codec *codec, unsigned int reg, | ||
53 | unsigned int val), | ||
54 | |||
55 | TP_ARGS(codec, reg, val) | ||
56 | |||
57 | ); | ||
58 | |||
59 | |||
60 | |||
61 | #endif /* _TRACE_ASOC_H */ | ||
62 | |||
63 | /* This part must be outside protection */ | ||
64 | #include <trace/define_trace.h> | ||
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index c18ce1dc51b8..700a6d5b9721 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -39,6 +39,9 @@ | |||
39 | #include <sound/soc-dapm.h> | 39 | #include <sound/soc-dapm.h> |
40 | #include <sound/initval.h> | 40 | #include <sound/initval.h> |
41 | 41 | ||
42 | #define CREATE_TRACE_POINTS | ||
43 | #include <trace/events/asoc.h> | ||
44 | |||
42 | #define NAME_SIZE 32 | 45 | #define NAME_SIZE 32 |
43 | 46 | ||
44 | static DEFINE_MUTEX(pcm_mutex); | 47 | static DEFINE_MUTEX(pcm_mutex); |
@@ -1914,6 +1917,7 @@ unsigned int snd_soc_read(struct snd_soc_codec *codec, unsigned int reg) | |||
1914 | 1917 | ||
1915 | ret = codec->driver->read(codec, reg); | 1918 | ret = codec->driver->read(codec, reg); |
1916 | dev_dbg(codec->dev, "read %x => %x\n", reg, ret); | 1919 | dev_dbg(codec->dev, "read %x => %x\n", reg, ret); |
1920 | trace_snd_soc_reg_read(codec, reg, ret); | ||
1917 | 1921 | ||
1918 | return ret; | 1922 | return ret; |
1919 | } | 1923 | } |
@@ -1923,6 +1927,7 @@ unsigned int snd_soc_write(struct snd_soc_codec *codec, | |||
1923 | unsigned int reg, unsigned int val) | 1927 | unsigned int reg, unsigned int val) |
1924 | { | 1928 | { |
1925 | dev_dbg(codec->dev, "write %x = %x\n", reg, val); | 1929 | dev_dbg(codec->dev, "write %x = %x\n", reg, val); |
1930 | trace_snd_soc_reg_write(codec, reg, val); | ||
1926 | return codec->driver->write(codec, reg, val); | 1931 | return codec->driver->write(codec, reg, val); |
1927 | } | 1932 | } |
1928 | EXPORT_SYMBOL_GPL(snd_soc_write); | 1933 | EXPORT_SYMBOL_GPL(snd_soc_write); |