xref: /openbmc/linux/include/trace/events/clk.h (revision 03813d9b7d4368d4a8c9bb8f5a2a1e23dac8f1b5)
19c92ab61SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */
2dfc202eaSStephen Boyd /*
3dfc202eaSStephen Boyd  * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved.
4dfc202eaSStephen Boyd  */
5dfc202eaSStephen Boyd #undef TRACE_SYSTEM
6dfc202eaSStephen Boyd #define TRACE_SYSTEM clk
7dfc202eaSStephen Boyd 
8dfc202eaSStephen Boyd #if !defined(_TRACE_CLK_H) || defined(TRACE_HEADER_MULTI_READ)
9dfc202eaSStephen Boyd #define _TRACE_CLK_H
10dfc202eaSStephen Boyd 
11dfc202eaSStephen Boyd #include <linux/tracepoint.h>
12dfc202eaSStephen Boyd 
13dfc202eaSStephen Boyd struct clk_core;
14dfc202eaSStephen Boyd 
15dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk,
16dfc202eaSStephen Boyd 
17dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
18dfc202eaSStephen Boyd 
19dfc202eaSStephen Boyd 	TP_ARGS(core),
20dfc202eaSStephen Boyd 
21dfc202eaSStephen Boyd 	TP_STRUCT__entry(
22dfc202eaSStephen Boyd 		__string(        name,           core->name       )
23dfc202eaSStephen Boyd 	),
24dfc202eaSStephen Boyd 
25dfc202eaSStephen Boyd 	TP_fast_assign(
26dfc202eaSStephen Boyd 		__assign_str(name, core->name);
27dfc202eaSStephen Boyd 	),
28dfc202eaSStephen Boyd 
29dfc202eaSStephen Boyd 	TP_printk("%s", __get_str(name))
30dfc202eaSStephen Boyd );
31dfc202eaSStephen Boyd 
32dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_enable,
33dfc202eaSStephen Boyd 
34dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
35dfc202eaSStephen Boyd 
36dfc202eaSStephen Boyd 	TP_ARGS(core)
37dfc202eaSStephen Boyd );
38dfc202eaSStephen Boyd 
39dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_enable_complete,
40dfc202eaSStephen Boyd 
41dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
42dfc202eaSStephen Boyd 
43dfc202eaSStephen Boyd 	TP_ARGS(core)
44dfc202eaSStephen Boyd );
45dfc202eaSStephen Boyd 
46dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_disable,
47dfc202eaSStephen Boyd 
48dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
49dfc202eaSStephen Boyd 
50dfc202eaSStephen Boyd 	TP_ARGS(core)
51dfc202eaSStephen Boyd );
52dfc202eaSStephen Boyd 
53dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_disable_complete,
54dfc202eaSStephen Boyd 
55dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
56dfc202eaSStephen Boyd 
57dfc202eaSStephen Boyd 	TP_ARGS(core)
58dfc202eaSStephen Boyd );
59dfc202eaSStephen Boyd 
60dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_prepare,
61dfc202eaSStephen Boyd 
62dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
63dfc202eaSStephen Boyd 
64dfc202eaSStephen Boyd 	TP_ARGS(core)
65dfc202eaSStephen Boyd );
66dfc202eaSStephen Boyd 
67dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_prepare_complete,
68dfc202eaSStephen Boyd 
69dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
70dfc202eaSStephen Boyd 
71dfc202eaSStephen Boyd 	TP_ARGS(core)
72dfc202eaSStephen Boyd );
73dfc202eaSStephen Boyd 
74dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_unprepare,
75dfc202eaSStephen Boyd 
76dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
77dfc202eaSStephen Boyd 
78dfc202eaSStephen Boyd 	TP_ARGS(core)
79dfc202eaSStephen Boyd );
80dfc202eaSStephen Boyd 
81dfc202eaSStephen Boyd DEFINE_EVENT(clk, clk_unprepare_complete,
82dfc202eaSStephen Boyd 
83dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core),
84dfc202eaSStephen Boyd 
85dfc202eaSStephen Boyd 	TP_ARGS(core)
86dfc202eaSStephen Boyd );
87dfc202eaSStephen Boyd 
88dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk_rate,
89dfc202eaSStephen Boyd 
90dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, unsigned long rate),
91dfc202eaSStephen Boyd 
92dfc202eaSStephen Boyd 	TP_ARGS(core, rate),
93dfc202eaSStephen Boyd 
94dfc202eaSStephen Boyd 	TP_STRUCT__entry(
95dfc202eaSStephen Boyd 		__string(        name,           core->name                )
96dfc202eaSStephen Boyd 		__field(unsigned long,           rate                      )
97dfc202eaSStephen Boyd 	),
98dfc202eaSStephen Boyd 
99dfc202eaSStephen Boyd 	TP_fast_assign(
100dfc202eaSStephen Boyd 		__assign_str(name, core->name);
101dfc202eaSStephen Boyd 		__entry->rate = rate;
102dfc202eaSStephen Boyd 	),
103dfc202eaSStephen Boyd 
104dfc202eaSStephen Boyd 	TP_printk("%s %lu", __get_str(name), (unsigned long)__entry->rate)
105dfc202eaSStephen Boyd );
106dfc202eaSStephen Boyd 
107dfc202eaSStephen Boyd DEFINE_EVENT(clk_rate, clk_set_rate,
108dfc202eaSStephen Boyd 
109dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, unsigned long rate),
110dfc202eaSStephen Boyd 
111dfc202eaSStephen Boyd 	TP_ARGS(core, rate)
112dfc202eaSStephen Boyd );
113dfc202eaSStephen Boyd 
114dfc202eaSStephen Boyd DEFINE_EVENT(clk_rate, clk_set_rate_complete,
115dfc202eaSStephen Boyd 
116dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, unsigned long rate),
117dfc202eaSStephen Boyd 
118dfc202eaSStephen Boyd 	TP_ARGS(core, rate)
119dfc202eaSStephen Boyd );
120dfc202eaSStephen Boyd 
121*03813d9bSMaxime Ripard DEFINE_EVENT(clk_rate, clk_set_min_rate,
122*03813d9bSMaxime Ripard 
123*03813d9bSMaxime Ripard 	TP_PROTO(struct clk_core *core, unsigned long rate),
124*03813d9bSMaxime Ripard 
125*03813d9bSMaxime Ripard 	TP_ARGS(core, rate)
126*03813d9bSMaxime Ripard );
127*03813d9bSMaxime Ripard 
128*03813d9bSMaxime Ripard DEFINE_EVENT(clk_rate, clk_set_max_rate,
129*03813d9bSMaxime Ripard 
130*03813d9bSMaxime Ripard 	TP_PROTO(struct clk_core *core, unsigned long rate),
131*03813d9bSMaxime Ripard 
132*03813d9bSMaxime Ripard 	TP_ARGS(core, rate)
133*03813d9bSMaxime Ripard );
134*03813d9bSMaxime Ripard 
135*03813d9bSMaxime Ripard DECLARE_EVENT_CLASS(clk_rate_range,
136*03813d9bSMaxime Ripard 
137*03813d9bSMaxime Ripard 	TP_PROTO(struct clk_core *core, unsigned long min, unsigned long max),
138*03813d9bSMaxime Ripard 
139*03813d9bSMaxime Ripard 	TP_ARGS(core, min, max),
140*03813d9bSMaxime Ripard 
141*03813d9bSMaxime Ripard 	TP_STRUCT__entry(
142*03813d9bSMaxime Ripard 		__string(        name,           core->name                )
143*03813d9bSMaxime Ripard 		__field(unsigned long,           min                       )
144*03813d9bSMaxime Ripard 		__field(unsigned long,           max                       )
145*03813d9bSMaxime Ripard 	),
146*03813d9bSMaxime Ripard 
147*03813d9bSMaxime Ripard 	TP_fast_assign(
148*03813d9bSMaxime Ripard 		__assign_str(name, core->name);
149*03813d9bSMaxime Ripard 		__entry->min = min;
150*03813d9bSMaxime Ripard 		__entry->max = max;
151*03813d9bSMaxime Ripard 	),
152*03813d9bSMaxime Ripard 
153*03813d9bSMaxime Ripard 	TP_printk("%s min %lu max %lu", __get_str(name),
154*03813d9bSMaxime Ripard 		  (unsigned long)__entry->min,
155*03813d9bSMaxime Ripard 		  (unsigned long)__entry->max)
156*03813d9bSMaxime Ripard );
157*03813d9bSMaxime Ripard 
158*03813d9bSMaxime Ripard DEFINE_EVENT(clk_rate_range, clk_set_rate_range,
159*03813d9bSMaxime Ripard 
160*03813d9bSMaxime Ripard 	TP_PROTO(struct clk_core *core, unsigned long min, unsigned long max),
161*03813d9bSMaxime Ripard 
162*03813d9bSMaxime Ripard 	TP_ARGS(core, min, max)
163*03813d9bSMaxime Ripard );
164*03813d9bSMaxime Ripard 
165dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk_parent,
166dfc202eaSStephen Boyd 
167dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, struct clk_core *parent),
168dfc202eaSStephen Boyd 
169dfc202eaSStephen Boyd 	TP_ARGS(core, parent),
170dfc202eaSStephen Boyd 
171dfc202eaSStephen Boyd 	TP_STRUCT__entry(
172dfc202eaSStephen Boyd 		__string(        name,           core->name                )
173975b820bSCai Li 		__string(        pname, parent ? parent->name : "none"     )
174dfc202eaSStephen Boyd 	),
175dfc202eaSStephen Boyd 
176dfc202eaSStephen Boyd 	TP_fast_assign(
177dfc202eaSStephen Boyd 		__assign_str(name, core->name);
178975b820bSCai Li 		__assign_str(pname, parent ? parent->name : "none");
179dfc202eaSStephen Boyd 	),
180dfc202eaSStephen Boyd 
181dfc202eaSStephen Boyd 	TP_printk("%s %s", __get_str(name), __get_str(pname))
182dfc202eaSStephen Boyd );
183dfc202eaSStephen Boyd 
184dfc202eaSStephen Boyd DEFINE_EVENT(clk_parent, clk_set_parent,
185dfc202eaSStephen Boyd 
186dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, struct clk_core *parent),
187dfc202eaSStephen Boyd 
188dfc202eaSStephen Boyd 	TP_ARGS(core, parent)
189dfc202eaSStephen Boyd );
190dfc202eaSStephen Boyd 
191dfc202eaSStephen Boyd DEFINE_EVENT(clk_parent, clk_set_parent_complete,
192dfc202eaSStephen Boyd 
193dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, struct clk_core *parent),
194dfc202eaSStephen Boyd 
195dfc202eaSStephen Boyd 	TP_ARGS(core, parent)
196dfc202eaSStephen Boyd );
197dfc202eaSStephen Boyd 
198dfc202eaSStephen Boyd DECLARE_EVENT_CLASS(clk_phase,
199dfc202eaSStephen Boyd 
200dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, int phase),
201dfc202eaSStephen Boyd 
202dfc202eaSStephen Boyd 	TP_ARGS(core, phase),
203dfc202eaSStephen Boyd 
204dfc202eaSStephen Boyd 	TP_STRUCT__entry(
205dfc202eaSStephen Boyd 		__string(        name,           core->name                )
206dfc202eaSStephen Boyd 		__field(	  int,           phase                     )
207dfc202eaSStephen Boyd 	),
208dfc202eaSStephen Boyd 
209dfc202eaSStephen Boyd 	TP_fast_assign(
210dfc202eaSStephen Boyd 		__assign_str(name, core->name);
211dfc202eaSStephen Boyd 		__entry->phase = phase;
212dfc202eaSStephen Boyd 	),
213dfc202eaSStephen Boyd 
214dfc202eaSStephen Boyd 	TP_printk("%s %d", __get_str(name), (int)__entry->phase)
215dfc202eaSStephen Boyd );
216dfc202eaSStephen Boyd 
217dfc202eaSStephen Boyd DEFINE_EVENT(clk_phase, clk_set_phase,
218dfc202eaSStephen Boyd 
219dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, int phase),
220dfc202eaSStephen Boyd 
221dfc202eaSStephen Boyd 	TP_ARGS(core, phase)
222dfc202eaSStephen Boyd );
223dfc202eaSStephen Boyd 
224dfc202eaSStephen Boyd DEFINE_EVENT(clk_phase, clk_set_phase_complete,
225dfc202eaSStephen Boyd 
226dfc202eaSStephen Boyd 	TP_PROTO(struct clk_core *core, int phase),
227dfc202eaSStephen Boyd 
228dfc202eaSStephen Boyd 	TP_ARGS(core, phase)
229dfc202eaSStephen Boyd );
230dfc202eaSStephen Boyd 
2319fba738aSJerome Brunet DECLARE_EVENT_CLASS(clk_duty_cycle,
2329fba738aSJerome Brunet 
2339fba738aSJerome Brunet 	TP_PROTO(struct clk_core *core, struct clk_duty *duty),
2349fba738aSJerome Brunet 
2359fba738aSJerome Brunet 	TP_ARGS(core, duty),
2369fba738aSJerome Brunet 
2379fba738aSJerome Brunet 	TP_STRUCT__entry(
2389fba738aSJerome Brunet 		__string(        name,           core->name              )
2399fba738aSJerome Brunet 		__field( unsigned int,           num                     )
2409fba738aSJerome Brunet 		__field( unsigned int,           den                     )
2419fba738aSJerome Brunet 	),
2429fba738aSJerome Brunet 
2439fba738aSJerome Brunet 	TP_fast_assign(
2449fba738aSJerome Brunet 		__assign_str(name, core->name);
2459fba738aSJerome Brunet 		__entry->num = duty->num;
2469fba738aSJerome Brunet 		__entry->den = duty->den;
2479fba738aSJerome Brunet 	),
2489fba738aSJerome Brunet 
2499fba738aSJerome Brunet 	TP_printk("%s %u/%u", __get_str(name), (unsigned int)__entry->num,
2509fba738aSJerome Brunet 		  (unsigned int)__entry->den)
2519fba738aSJerome Brunet );
2529fba738aSJerome Brunet 
2539fba738aSJerome Brunet DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle,
2549fba738aSJerome Brunet 
2559fba738aSJerome Brunet 	TP_PROTO(struct clk_core *core, struct clk_duty *duty),
2569fba738aSJerome Brunet 
2579fba738aSJerome Brunet 	TP_ARGS(core, duty)
2589fba738aSJerome Brunet );
2599fba738aSJerome Brunet 
2609fba738aSJerome Brunet DEFINE_EVENT(clk_duty_cycle, clk_set_duty_cycle_complete,
2619fba738aSJerome Brunet 
2629fba738aSJerome Brunet 	TP_PROTO(struct clk_core *core, struct clk_duty *duty),
2639fba738aSJerome Brunet 
2649fba738aSJerome Brunet 	TP_ARGS(core, duty)
2659fba738aSJerome Brunet );
2669fba738aSJerome Brunet 
267dfc202eaSStephen Boyd #endif /* _TRACE_CLK_H */
268dfc202eaSStephen Boyd 
269dfc202eaSStephen Boyd /* This part must be outside protection */
270dfc202eaSStephen Boyd #include <trace/define_trace.h>
271