diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-03 18:05:58 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-11-11 09:54:26 -0500 |
commit | a8b1d34f3ee1bc139ac5fbe3f84f6d16c90136bb (patch) | |
tree | d4efe677408e0ad8c1f32641650446205581513a /include/trace | |
parent | 68f89ad8c233a88b10404c5fd8a1109d12999962 (diff) |
ASoC: Add trace events for ASoC register read/write
The trace subsystem provides a convenient way of instrumenting the kernel
which can be left on all the time with extremely low impact on the system
unlike prints to the kernel log which can be very spammy. Begin adding
support for instrumenting ASoC via this interface by adding trace for the
register access primitives.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/asoc.h | 64 |
1 files changed, 64 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> | ||