xref: /openbmc/linux/include/trace/events/clk.h (revision 0c874100)
1 /*
2  * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
3  *
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 
21 struct clk_core;
22 
23 DECLARE_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 
40 DEFINE_EVENT(clk, clk_enable,
41 
42 	TP_PROTO(struct clk_core *core),
43 
44 	TP_ARGS(core)
45 );
46 
47 DEFINE_EVENT(clk, clk_enable_complete,
48 
49 	TP_PROTO(struct clk_core *core),
50 
51 	TP_ARGS(core)
52 );
53 
54 DEFINE_EVENT(clk, clk_disable,
55 
56 	TP_PROTO(struct clk_core *core),
57 
58 	TP_ARGS(core)
59 );
60 
61 DEFINE_EVENT(clk, clk_disable_complete,
62 
63 	TP_PROTO(struct clk_core *core),
64 
65 	TP_ARGS(core)
66 );
67 
68 DEFINE_EVENT(clk, clk_prepare,
69 
70 	TP_PROTO(struct clk_core *core),
71 
72 	TP_ARGS(core)
73 );
74 
75 DEFINE_EVENT(clk, clk_prepare_complete,
76 
77 	TP_PROTO(struct clk_core *core),
78 
79 	TP_ARGS(core)
80 );
81 
82 DEFINE_EVENT(clk, clk_unprepare,
83 
84 	TP_PROTO(struct clk_core *core),
85 
86 	TP_ARGS(core)
87 );
88 
89 DEFINE_EVENT(clk, clk_unprepare_complete,
90 
91 	TP_PROTO(struct clk_core *core),
92 
93 	TP_ARGS(core)
94 );
95 
96 DECLARE_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 
115 DEFINE_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 
122 DEFINE_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 
129 DECLARE_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                )
137 		__string(        pname, parent ? parent->name : "none"     )
138 	),
139 
140 	TP_fast_assign(
141 		__assign_str(name, core->name);
142 		__assign_str(pname, parent ? parent->name : "none");
143 	),
144 
145 	TP_printk("%s %s", __get_str(name), __get_str(pname))
146 );
147 
148 DEFINE_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 
155 DEFINE_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 
162 DECLARE_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 
181 DEFINE_EVENT(clk_phase, clk_set_phase,
182 
183 	TP_PROTO(struct clk_core *core, int phase),
184 
185 	TP_ARGS(core, phase)
186 );
187 
188 DEFINE_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 
195 DECLARE_EVENT_CLASS(clk_duty_cycle,
196 
197 	TP_PROTO(struct clk_core *core, struct clk_duty *duty),
198 
199 	TP_ARGS(core, duty),
200 
201 	TP_STRUCT__entry(
202 		__string(        name,           core->name              )
203 		__field( unsigned int,           num                     )
204 		__field( unsigned int,           den                     )
205 	),
206 
207 	TP_fast_assign(
208 		__assign_str(name, core->name);
209 		__entry->num = duty->num;
210 		__entry->den = duty->den;
211 	),
212 
213 	TP_printk("%s %u/%u", __get_str(name), (unsigned int)__entry->num,
214 		  (unsigned int)__entry->den)
215 );
216 
217 DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle,
218 
219 	TP_PROTO(struct clk_core *core, struct clk_duty *duty),
220 
221 	TP_ARGS(core, duty)
222 );
223 
224 DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle_complete,
225 
226 	TP_PROTO(struct clk_core *core, struct clk_duty *duty),
227 
228 	TP_ARGS(core, duty)
229 );
230 
231 #endif /* _TRACE_CLK_H */
232 
233 /* This part must be outside protection */
234 #include <trace/define_trace.h>
235