blob: cd9c6dbddffd9ad17f88380276766a9767545f51 [file] [log] [blame]
Stephen Boyddfc202e2015-02-02 14:37:41 -08001/*
Amit Nischal15aca8c2017-03-06 16:40:58 +05302 * Copyright (c) 2014-2015, 2017, The Linux Foundation. All rights reserved.
Stephen Boyddfc202e2015-02-02 14:37:41 -08003 *
4 * This software is licensed under the terms of the GNU General Public
5 * License version 2, as published by the Free Software Foundation, and
6 * may be copied, distributed, and modified under those terms.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13#undef TRACE_SYSTEM
14#define TRACE_SYSTEM clk
15
16#if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ)
17#define _TRACE_CLK_H
18
19#include <linux/tracepoint.h>
20
21struct clk_core;
22
23DECLARE_EVENT_CLASS(clk,
24
25 TP_PROTO(struct clk_core *core),
26
27 TP_ARGS(core),
28
29 TP_STRUCT__entry(
30 __string( name, core->name )
31 ),
32
33 TP_fast_assign(
34 __assign_str(name, core->name);
35 ),
36
37 TP_printk("%s", __get_str(name))
38);
39
40DEFINE_EVENT(clk, clk_enable,
41
42 TP_PROTO(struct clk_core *core),
43
44 TP_ARGS(core)
45);
46
47DEFINE_EVENT(clk, clk_enable_complete,
48
49 TP_PROTO(struct clk_core *core),
50
51 TP_ARGS(core)
52);
53
54DEFINE_EVENT(clk, clk_disable,
55
56 TP_PROTO(struct clk_core *core),
57
58 TP_ARGS(core)
59);
60
61DEFINE_EVENT(clk, clk_disable_complete,
62
63 TP_PROTO(struct clk_core *core),
64
65 TP_ARGS(core)
66);
67
68DEFINE_EVENT(clk, clk_prepare,
69
70 TP_PROTO(struct clk_core *core),
71
72 TP_ARGS(core)
73);
74
75DEFINE_EVENT(clk, clk_prepare_complete,
76
77 TP_PROTO(struct clk_core *core),
78
79 TP_ARGS(core)
80);
81
82DEFINE_EVENT(clk, clk_unprepare,
83
84 TP_PROTO(struct clk_core *core),
85
86 TP_ARGS(core)
87);
88
89DEFINE_EVENT(clk, clk_unprepare_complete,
90
91 TP_PROTO(struct clk_core *core),
92
93 TP_ARGS(core)
94);
95
96DECLARE_EVENT_CLASS(clk_rate,
97
98 TP_PROTO(struct clk_core *core, unsigned long rate),
99
100 TP_ARGS(core, rate),
101
102 TP_STRUCT__entry(
103 __string( name, core->name )
104 __field(unsigned long, rate )
105 ),
106
107 TP_fast_assign(
108 __assign_str(name, core->name);
109 __entry->rate = rate;
110 ),
111
112 TP_printk("%s %lu", __get_str(name), (unsigned long)__entry->rate)
113);
114
115DEFINE_EVENT(clk_rate, clk_set_rate,
116
117 TP_PROTO(struct clk_core *core, unsigned long rate),
118
119 TP_ARGS(core, rate)
120);
121
122DEFINE_EVENT(clk_rate, clk_set_rate_complete,
123
124 TP_PROTO(struct clk_core *core, unsigned long rate),
125
126 TP_ARGS(core, rate)
127);
128
129DECLARE_EVENT_CLASS(clk_parent,
130
131 TP_PROTO(struct clk_core *core, struct clk_core *parent),
132
133 TP_ARGS(core, parent),
134
135 TP_STRUCT__entry(
136 __string( name, core->name )
Cai Li82acb5f2017-11-21 17:24:38 +0800137 __string( pname, parent ? parent->name : "none" )
Stephen Boyddfc202e2015-02-02 14:37:41 -0800138 ),
139
140 TP_fast_assign(
141 __assign_str(name, core->name);
Cai Li82acb5f2017-11-21 17:24:38 +0800142 __assign_str(pname, parent ? parent->name : "none");
Stephen Boyddfc202e2015-02-02 14:37:41 -0800143 ),
144
145 TP_printk("%s %s", __get_str(name), __get_str(pname))
146);
147
148DEFINE_EVENT(clk_parent, clk_set_parent,
149
150 TP_PROTO(struct clk_core *core, struct clk_core *parent),
151
152 TP_ARGS(core, parent)
153);
154
155DEFINE_EVENT(clk_parent, clk_set_parent_complete,
156
157 TP_PROTO(struct clk_core *core, struct clk_core *parent),
158
159 TP_ARGS(core, parent)
160);
161
162DECLARE_EVENT_CLASS(clk_phase,
163
164 TP_PROTO(struct clk_core *core, int phase),
165
166 TP_ARGS(core, phase),
167
168 TP_STRUCT__entry(
169 __string( name, core->name )
170 __field( int, phase )
171 ),
172
173 TP_fast_assign(
174 __assign_str(name, core->name);
175 __entry->phase = phase;
176 ),
177
178 TP_printk("%s %d", __get_str(name), (int)__entry->phase)
179);
180
181DEFINE_EVENT(clk_phase, clk_set_phase,
182
183 TP_PROTO(struct clk_core *core, int phase),
184
185 TP_ARGS(core, phase)
186);
187
188DEFINE_EVENT(clk_phase, clk_set_phase_complete,
189
190 TP_PROTO(struct clk_core *core, int phase),
191
192 TP_ARGS(core, phase)
193);
194
Amit Nischal15aca8c2017-03-06 16:40:58 +0530195DECLARE_EVENT_CLASS(clk_state_dump,
196
197 TP_PROTO(const char *name, unsigned int prepare_count,
198 unsigned int enable_count, unsigned long rate, unsigned int vdd_level),
199
200 TP_ARGS(name, prepare_count, enable_count, rate, vdd_level),
201
202 TP_STRUCT__entry(
203 __string(name, name)
204 __field(unsigned int, prepare_count)
205 __field(unsigned int, enable_count)
206 __field(unsigned long, rate)
207 __field(unsigned int, vdd_level)
208 ),
209
210 TP_fast_assign(
211 __assign_str(name, name);
212 __entry->prepare_count = prepare_count;
213 __entry->enable_count = enable_count;
214 __entry->rate = rate;
215 __entry->vdd_level = vdd_level;
216 ),
217
218 TP_printk("%s\tprepare:enable cnt [%u:%u]\trate: vdd_level [%lu:%u]",
219 __get_str(name), __entry->prepare_count, __entry->enable_count,
220 __entry->rate, __entry->vdd_level)
221);
222
223DEFINE_EVENT(clk_state_dump, clk_state,
224
225 TP_PROTO(const char *name, unsigned int prepare_count,
226 unsigned int enable_count, unsigned long rate, unsigned int vdd_level),
227
228 TP_ARGS(name, prepare_count, enable_count, rate, vdd_level)
229);
230
Stephen Boyddfc202e2015-02-02 14:37:41 -0800231#endif /* _TRACE_CLK_H */
232
233/* This part must be outside protection */
234#include <trace/define_trace.h>