1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
6 #define TRACE_SYSTEM clk
8 #if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ)
11 #include <linux/tracepoint.h>
15 DECLARE_EVENT_CLASS(clk
,
17 TP_PROTO(struct clk_core
*core
),
22 __string( name
, core
->name
)
26 __assign_str(name
, core
->name
);
29 TP_printk("%s", __get_str(name
))
32 DEFINE_EVENT(clk
, clk_enable
,
34 TP_PROTO(struct clk_core
*core
),
39 DEFINE_EVENT(clk
, clk_enable_complete
,
41 TP_PROTO(struct clk_core
*core
),
46 DEFINE_EVENT(clk
, clk_disable
,
48 TP_PROTO(struct clk_core
*core
),
53 DEFINE_EVENT(clk
, clk_disable_complete
,
55 TP_PROTO(struct clk_core
*core
),
60 DEFINE_EVENT(clk
, clk_prepare
,
62 TP_PROTO(struct clk_core
*core
),
67 DEFINE_EVENT(clk
, clk_prepare_complete
,
69 TP_PROTO(struct clk_core
*core
),
74 DEFINE_EVENT(clk
, clk_unprepare
,
76 TP_PROTO(struct clk_core
*core
),
81 DEFINE_EVENT(clk
, clk_unprepare_complete
,
83 TP_PROTO(struct clk_core
*core
),
88 DECLARE_EVENT_CLASS(clk_rate
,
90 TP_PROTO(struct clk_core
*core
, unsigned long rate
),
95 __string( name
, core
->name
)
96 __field(unsigned long, rate
)
100 __assign_str(name
, core
->name
);
101 __entry
->rate
= rate
;
104 TP_printk("%s %lu", __get_str(name
), (unsigned long)__entry
->rate
)
107 DEFINE_EVENT(clk_rate
, clk_set_rate
,
109 TP_PROTO(struct clk_core
*core
, unsigned long rate
),
114 DEFINE_EVENT(clk_rate
, clk_set_rate_complete
,
116 TP_PROTO(struct clk_core
*core
, unsigned long rate
),
121 DEFINE_EVENT(clk_rate
, clk_set_min_rate
,
123 TP_PROTO(struct clk_core
*core
, unsigned long rate
),
128 DEFINE_EVENT(clk_rate
, clk_set_max_rate
,
130 TP_PROTO(struct clk_core
*core
, unsigned long rate
),
135 DECLARE_EVENT_CLASS(clk_rate_range
,
137 TP_PROTO(struct clk_core
*core
, unsigned long min
, unsigned long max
),
139 TP_ARGS(core
, min
, max
),
142 __string( name
, core
->name
)
143 __field(unsigned long, min
)
144 __field(unsigned long, max
)
148 __assign_str(name
, core
->name
);
153 TP_printk("%s min %lu max %lu", __get_str(name
),
154 (unsigned long)__entry
->min
,
155 (unsigned long)__entry
->max
)
158 DEFINE_EVENT(clk_rate_range
, clk_set_rate_range
,
160 TP_PROTO(struct clk_core
*core
, unsigned long min
, unsigned long max
),
162 TP_ARGS(core
, min
, max
)
165 DECLARE_EVENT_CLASS(clk_parent
,
167 TP_PROTO(struct clk_core
*core
, struct clk_core
*parent
),
169 TP_ARGS(core
, parent
),
172 __string( name
, core
->name
)
173 __string( pname
, parent
? parent
->name
: "none" )
177 __assign_str(name
, core
->name
);
178 __assign_str(pname
, parent
? parent
->name
: "none");
181 TP_printk("%s %s", __get_str(name
), __get_str(pname
))
184 DEFINE_EVENT(clk_parent
, clk_set_parent
,
186 TP_PROTO(struct clk_core
*core
, struct clk_core
*parent
),
188 TP_ARGS(core
, parent
)
191 DEFINE_EVENT(clk_parent
, clk_set_parent_complete
,
193 TP_PROTO(struct clk_core
*core
, struct clk_core
*parent
),
195 TP_ARGS(core
, parent
)
198 DECLARE_EVENT_CLASS(clk_phase
,
200 TP_PROTO(struct clk_core
*core
, int phase
),
202 TP_ARGS(core
, phase
),
205 __string( name
, core
->name
)
206 __field( int, phase
)
210 __assign_str(name
, core
->name
);
211 __entry
->phase
= phase
;
214 TP_printk("%s %d", __get_str(name
), (int)__entry
->phase
)
217 DEFINE_EVENT(clk_phase
, clk_set_phase
,
219 TP_PROTO(struct clk_core
*core
, int phase
),
224 DEFINE_EVENT(clk_phase
, clk_set_phase_complete
,
226 TP_PROTO(struct clk_core
*core
, int phase
),
231 DECLARE_EVENT_CLASS(clk_duty_cycle
,
233 TP_PROTO(struct clk_core
*core
, struct clk_duty
*duty
),
238 __string( name
, core
->name
)
239 __field( unsigned int, num
)
240 __field( unsigned int, den
)
244 __assign_str(name
, core
->name
);
245 __entry
->num
= duty
->num
;
246 __entry
->den
= duty
->den
;
249 TP_printk("%s %u/%u", __get_str(name
), (unsigned int)__entry
->num
,
250 (unsigned int)__entry
->den
)
253 DEFINE_EVENT(clk_duty_cycle
, clk_set_duty_cycle
,
255 TP_PROTO(struct clk_core
*core
, struct clk_duty
*duty
),
260 DEFINE_EVENT(clk_duty_cycle
, clk_set_duty_cycle_complete
,
262 TP_PROTO(struct clk_core
*core
, struct clk_duty
*duty
),
267 #endif /* _TRACE_CLK_H */
269 /* This part must be outside protection */
270 #include <trace/define_trace.h>