2 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
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.
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.
14 #define TRACE_SYSTEM clk
16 #if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ)
19 #include <linux/tracepoint.h>
23 DECLARE_EVENT_CLASS(clk,
25 TP_PROTO(struct clk_core *core),
30 __string( name, core->name )
34 __assign_str(name, core->name);
37 TP_printk("%s", __get_str(name))
40 DEFINE_EVENT(clk, clk_enable,
42 TP_PROTO(struct clk_core *core),
47 DEFINE_EVENT(clk, clk_enable_complete,
49 TP_PROTO(struct clk_core *core),
54 DEFINE_EVENT(clk, clk_disable,
56 TP_PROTO(struct clk_core *core),
61 DEFINE_EVENT(clk, clk_disable_complete,
63 TP_PROTO(struct clk_core *core),
68 DEFINE_EVENT(clk, clk_prepare,
70 TP_PROTO(struct clk_core *core),
75 DEFINE_EVENT(clk, clk_prepare_complete,
77 TP_PROTO(struct clk_core *core),
82 DEFINE_EVENT(clk, clk_unprepare,
84 TP_PROTO(struct clk_core *core),
89 DEFINE_EVENT(clk, clk_unprepare_complete,
91 TP_PROTO(struct clk_core *core),
96 DECLARE_EVENT_CLASS(clk_rate,
98 TP_PROTO(struct clk_core *core, unsigned long rate),
103 __string( name, core->name )
104 __field(unsigned long, rate )
108 __assign_str(name, core->name);
109 __entry->rate = rate;
112 TP_printk("%s %lu", __get_str(name), (unsigned long)__entry->rate)
115 DEFINE_EVENT(clk_rate, clk_set_rate,
117 TP_PROTO(struct clk_core *core, unsigned long rate),
122 DEFINE_EVENT(clk_rate, clk_set_rate_complete,
124 TP_PROTO(struct clk_core *core, unsigned long rate),
129 DECLARE_EVENT_CLASS(clk_parent,
131 TP_PROTO(struct clk_core *core, struct clk_core *parent),
133 TP_ARGS(core, parent),
136 __string( name, core->name )
137 __string( pname, parent ? parent->name : "none" )
141 __assign_str(name, core->name);
142 __assign_str(pname, parent ? parent->name : "none");
145 TP_printk("%s %s", __get_str(name), __get_str(pname))
148 DEFINE_EVENT(clk_parent, clk_set_parent,
150 TP_PROTO(struct clk_core *core, struct clk_core *parent),
152 TP_ARGS(core, parent)
155 DEFINE_EVENT(clk_parent, clk_set_parent_complete,
157 TP_PROTO(struct clk_core *core, struct clk_core *parent),
159 TP_ARGS(core, parent)
162 DECLARE_EVENT_CLASS(clk_phase,
164 TP_PROTO(struct clk_core *core, int phase),
166 TP_ARGS(core, phase),
169 __string( name, core->name )
170 __field( int, phase )
174 __assign_str(name, core->name);
175 __entry->phase = phase;
178 TP_printk("%s %d", __get_str(name), (int)__entry->phase)
181 DEFINE_EVENT(clk_phase, clk_set_phase,
183 TP_PROTO(struct clk_core *core, int phase),
188 DEFINE_EVENT(clk_phase, clk_set_phase_complete,
190 TP_PROTO(struct clk_core *core, int phase),
195 DECLARE_EVENT_CLASS(clk_duty_cycle,
197 TP_PROTO(struct clk_core *core, struct clk_duty *duty),
202 __string( name, core->name )
203 __field( unsigned int, num )
204 __field( unsigned int, den )
208 __assign_str(name, core->name);
209 __entry->num = duty->num;
210 __entry->den = duty->den;
213 TP_printk("%s %u/%u", __get_str(name), (unsigned int)__entry->num,
214 (unsigned int)__entry->den)
217 DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle,
219 TP_PROTO(struct clk_core *core, struct clk_duty *duty),
224 DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle_complete,
226 TP_PROTO(struct clk_core *core, struct clk_duty *duty),
231 #endif /* _TRACE_CLK_H */
233 /* This part must be outside protection */
234 #include <trace/define_trace.h>