diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-07-24 16:30:55 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-08-08 02:56:16 -0400 |
commit | fb2736bbaee0e704a4f33912cf532597b2dc5b33 (patch) | |
tree | 409629ad28230acd153d4b07c3e39d7afb324175 /include/trace | |
parent | 555fedacc366c4aaf48270da2504dfa97c41a130 (diff) |
regmap: Add basic tracepoints
Trace single register reads and writes, plus start/stop tracepoints for
the actual I/O to see where we're spending time. This makes it easy to
have always on logging without overwhelming the logs and also lets us take
advantage of all the context and time information that the trace subsystem
collects for us.
We don't currently trace register values for bulk operations as this would
add complexity and overhead parsing the cooked data that's being worked
with.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/regmap.h | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h new file mode 100644 index 000000000000..1c76f40dee44 --- /dev/null +++ b/include/trace/events/regmap.h | |||
@@ -0,0 +1,112 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM regmap | ||
3 | |||
4 | #if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_REGMAP_H | ||
6 | |||
7 | #include <linux/device.h> | ||
8 | #include <linux/ktime.h> | ||
9 | #include <linux/tracepoint.h> | ||
10 | |||
11 | struct regmap; | ||
12 | |||
13 | /* | ||
14 | * Log register events | ||
15 | */ | ||
16 | DECLARE_EVENT_CLASS(regmap_reg, | ||
17 | |||
18 | TP_PROTO(struct device *dev, unsigned int reg, | ||
19 | unsigned int val), | ||
20 | |||
21 | TP_ARGS(dev, reg, val), | ||
22 | |||
23 | TP_STRUCT__entry( | ||
24 | __string( name, dev_name(dev) ) | ||
25 | __field( unsigned int, reg ) | ||
26 | __field( unsigned int, val ) | ||
27 | ), | ||
28 | |||
29 | TP_fast_assign( | ||
30 | __assign_str(name, dev_name(dev)); | ||
31 | __entry->reg = reg; | ||
32 | __entry->val = val; | ||
33 | ), | ||
34 | |||
35 | TP_printk("%s reg=%x val=%x", __get_str(name), | ||
36 | (unsigned int)__entry->reg, | ||
37 | (unsigned int)__entry->val) | ||
38 | ); | ||
39 | |||
40 | DEFINE_EVENT(regmap_reg, regmap_reg_write, | ||
41 | |||
42 | TP_PROTO(struct device *dev, unsigned int reg, | ||
43 | unsigned int val), | ||
44 | |||
45 | TP_ARGS(dev, reg, val) | ||
46 | |||
47 | ); | ||
48 | |||
49 | DEFINE_EVENT(regmap_reg, regmap_reg_read, | ||
50 | |||
51 | TP_PROTO(struct device *dev, unsigned int reg, | ||
52 | unsigned int val), | ||
53 | |||
54 | TP_ARGS(dev, reg, val) | ||
55 | |||
56 | ); | ||
57 | |||
58 | DECLARE_EVENT_CLASS(regmap_block, | ||
59 | |||
60 | TP_PROTO(struct device *dev, unsigned int reg, size_t count), | ||
61 | |||
62 | TP_ARGS(dev, reg, count), | ||
63 | |||
64 | TP_STRUCT__entry( | ||
65 | __string( name, dev_name(dev) ) | ||
66 | __field( unsigned int, reg ) | ||
67 | __field( size_t, count ) | ||
68 | ), | ||
69 | |||
70 | TP_fast_assign( | ||
71 | __assign_str(name, dev_name(dev)); | ||
72 | __entry->reg = reg; | ||
73 | __entry->count = count; | ||
74 | ), | ||
75 | |||
76 | TP_printk("%s reg=%x count=%d", __get_str(name), | ||
77 | (unsigned int)__entry->reg, | ||
78 | (size_t)__entry->count) | ||
79 | ); | ||
80 | |||
81 | DEFINE_EVENT(regmap_block, regmap_hw_read_start, | ||
82 | |||
83 | TP_PROTO(struct device *dev, unsigned int reg, size_t count), | ||
84 | |||
85 | TP_ARGS(dev, reg, count) | ||
86 | ); | ||
87 | |||
88 | DEFINE_EVENT(regmap_block, regmap_hw_read_done, | ||
89 | |||
90 | TP_PROTO(struct device *dev, unsigned int reg, size_t count), | ||
91 | |||
92 | TP_ARGS(dev, reg, count) | ||
93 | ); | ||
94 | |||
95 | DEFINE_EVENT(regmap_block, regmap_hw_write_start, | ||
96 | |||
97 | TP_PROTO(struct device *dev, unsigned int reg, size_t count), | ||
98 | |||
99 | TP_ARGS(dev, reg, count) | ||
100 | ); | ||
101 | |||
102 | DEFINE_EVENT(regmap_block, regmap_hw_write_done, | ||
103 | |||
104 | TP_PROTO(struct device *dev, unsigned int reg, size_t count), | ||
105 | |||
106 | TP_ARGS(dev, reg, count) | ||
107 | ); | ||
108 | |||
109 | #endif /* _TRACE_REGMAP_H */ | ||
110 | |||
111 | /* This part must be outside protection */ | ||
112 | #include <trace/define_trace.h> | ||