Linux Audio

Check our new training course

Loading...
v6.13.7
  1/* SPDX-License-Identifier: GPL-2.0 */
  2#undef TRACE_SYSTEM
  3#define TRACE_SYSTEM power
  4
  5#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
  6#define _TRACE_POWER_H
  7
  8#include <linux/cpufreq.h>
  9#include <linux/ktime.h>
 10#include <linux/pm_qos.h>
 11#include <linux/tracepoint.h>
 12#include <linux/trace_events.h>
 13
 14#define TPS(x)  tracepoint_string(x)
 15
 16DECLARE_EVENT_CLASS(cpu,
 17
 18	TP_PROTO(unsigned int state, unsigned int cpu_id),
 19
 20	TP_ARGS(state, cpu_id),
 21
 22	TP_STRUCT__entry(
 23		__field(	u32,		state		)
 24		__field(	u32,		cpu_id		)
 25	),
 26
 27	TP_fast_assign(
 28		__entry->state = state;
 29		__entry->cpu_id = cpu_id;
 30	),
 31
 32	TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
 33		  (unsigned long)__entry->cpu_id)
 34);
 35
 36DEFINE_EVENT(cpu, cpu_idle,
 37
 38	TP_PROTO(unsigned int state, unsigned int cpu_id),
 39
 40	TP_ARGS(state, cpu_id)
 41);
 42
 43TRACE_EVENT(cpu_idle_miss,
 44
 45	TP_PROTO(unsigned int cpu_id, unsigned int state, bool below),
 46
 47	TP_ARGS(cpu_id, state, below),
 48
 49	TP_STRUCT__entry(
 50		__field(u32,		cpu_id)
 51		__field(u32,		state)
 52		__field(bool,		below)
 53	),
 54
 55	TP_fast_assign(
 56		__entry->cpu_id = cpu_id;
 57		__entry->state = state;
 58		__entry->below = below;
 59	),
 60
 61	TP_printk("cpu_id=%lu state=%lu type=%s", (unsigned long)__entry->cpu_id,
 62		(unsigned long)__entry->state, (__entry->below)?"below":"above")
 63);
 64
 65TRACE_EVENT(powernv_throttle,
 66
 67	TP_PROTO(int chip_id, const char *reason, int pmax),
 68
 69	TP_ARGS(chip_id, reason, pmax),
 70
 71	TP_STRUCT__entry(
 72		__field(int, chip_id)
 73		__string(reason, reason)
 74		__field(int, pmax)
 75	),
 76
 77	TP_fast_assign(
 78		__entry->chip_id = chip_id;
 79		__assign_str(reason);
 80		__entry->pmax = pmax;
 81	),
 82
 83	TP_printk("Chip %d Pmax %d %s", __entry->chip_id,
 84		  __entry->pmax, __get_str(reason))
 85);
 86
 87TRACE_EVENT(pstate_sample,
 88
 89	TP_PROTO(u32 core_busy,
 90		u32 scaled_busy,
 91		u32 from,
 92		u32 to,
 93		u64 mperf,
 94		u64 aperf,
 95		u64 tsc,
 96		u32 freq,
 97		u32 io_boost
 98		),
 99
100	TP_ARGS(core_busy,
101		scaled_busy,
102		from,
103		to,
104		mperf,
105		aperf,
106		tsc,
107		freq,
108		io_boost
109		),
110
111	TP_STRUCT__entry(
112		__field(u32, core_busy)
113		__field(u32, scaled_busy)
114		__field(u32, from)
115		__field(u32, to)
116		__field(u64, mperf)
117		__field(u64, aperf)
118		__field(u64, tsc)
119		__field(u32, freq)
120		__field(u32, io_boost)
121		),
122
123	TP_fast_assign(
124		__entry->core_busy = core_busy;
125		__entry->scaled_busy = scaled_busy;
126		__entry->from = from;
127		__entry->to = to;
128		__entry->mperf = mperf;
129		__entry->aperf = aperf;
130		__entry->tsc = tsc;
131		__entry->freq = freq;
132		__entry->io_boost = io_boost;
133		),
134
135	TP_printk("core_busy=%lu scaled=%lu from=%lu to=%lu mperf=%llu aperf=%llu tsc=%llu freq=%lu io_boost=%lu",
136		(unsigned long)__entry->core_busy,
137		(unsigned long)__entry->scaled_busy,
138		(unsigned long)__entry->from,
139		(unsigned long)__entry->to,
140		(unsigned long long)__entry->mperf,
141		(unsigned long long)__entry->aperf,
142		(unsigned long long)__entry->tsc,
143		(unsigned long)__entry->freq,
144		(unsigned long)__entry->io_boost
145		)
146
147);
148
149/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
150#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
151#define _PWR_EVENT_AVOID_DOUBLE_DEFINING
152
153#define PWR_EVENT_EXIT -1
154#endif
155
156#define pm_verb_symbolic(event) \
157	__print_symbolic(event, \
158		{ PM_EVENT_SUSPEND, "suspend" }, \
159		{ PM_EVENT_RESUME, "resume" }, \
160		{ PM_EVENT_FREEZE, "freeze" }, \
161		{ PM_EVENT_QUIESCE, "quiesce" }, \
162		{ PM_EVENT_HIBERNATE, "hibernate" }, \
163		{ PM_EVENT_THAW, "thaw" }, \
164		{ PM_EVENT_RESTORE, "restore" }, \
165		{ PM_EVENT_RECOVER, "recover" })
166
167DEFINE_EVENT(cpu, cpu_frequency,
168
169	TP_PROTO(unsigned int frequency, unsigned int cpu_id),
170
171	TP_ARGS(frequency, cpu_id)
172);
173
174TRACE_EVENT(cpu_frequency_limits,
175
176	TP_PROTO(struct cpufreq_policy *policy),
177
178	TP_ARGS(policy),
179
180	TP_STRUCT__entry(
181		__field(u32, min_freq)
182		__field(u32, max_freq)
183		__field(u32, cpu_id)
184	),
185
186	TP_fast_assign(
187		__entry->min_freq = policy->min;
188		__entry->max_freq = policy->max;
189		__entry->cpu_id = policy->cpu;
190	),
191
192	TP_printk("min=%lu max=%lu cpu_id=%lu",
193		  (unsigned long)__entry->min_freq,
194		  (unsigned long)__entry->max_freq,
195		  (unsigned long)__entry->cpu_id)
196);
197
198TRACE_EVENT(device_pm_callback_start,
199
200	TP_PROTO(struct device *dev, const char *pm_ops, int event),
201
202	TP_ARGS(dev, pm_ops, event),
203
204	TP_STRUCT__entry(
205		__string(device, dev_name(dev))
206		__string(driver, dev_driver_string(dev))
207		__string(parent, dev->parent ? dev_name(dev->parent) : "none")
208		__string(pm_ops, pm_ops ? pm_ops : "none ")
209		__field(int, event)
210	),
211
212	TP_fast_assign(
213		__assign_str(device);
214		__assign_str(driver);
215		__assign_str(parent);
216		__assign_str(pm_ops);
217		__entry->event = event;
218	),
219
220	TP_printk("%s %s, parent: %s, %s[%s]", __get_str(driver),
221		__get_str(device), __get_str(parent), __get_str(pm_ops),
222		pm_verb_symbolic(__entry->event))
223);
224
225TRACE_EVENT(device_pm_callback_end,
226
227	TP_PROTO(struct device *dev, int error),
228
229	TP_ARGS(dev, error),
 
230
231	TP_STRUCT__entry(
232		__string(device, dev_name(dev))
233		__string(driver, dev_driver_string(dev))
234		__field(int, error)
235	),
236
237	TP_fast_assign(
238		__assign_str(device);
239		__assign_str(driver);
240		__entry->error = error;
241	),
242
243	TP_printk("%s %s, err=%d",
244		__get_str(driver), __get_str(device), __entry->error)
245);
246
247TRACE_EVENT(suspend_resume,
 
 
 
 
 
 
248
249	TP_PROTO(const char *action, int val, bool start),
250
251	TP_ARGS(action, val, start),
252
253	TP_STRUCT__entry(
254		__field(const char *, action)
255		__field(int, val)
256		__field(bool, start)
257	),
258
259	TP_fast_assign(
260		__entry->action = action;
261		__entry->val = val;
262		__entry->start = start;
263	),
264
265	TP_printk("%s[%u] %s", __entry->action, (unsigned int)__entry->val,
266		(__entry->start)?"begin":"end")
267);
268
269DECLARE_EVENT_CLASS(wakeup_source,
270
271	TP_PROTO(const char *name, unsigned int state),
272
273	TP_ARGS(name, state),
 
274
275	TP_STRUCT__entry(
276		__string(       name,           name            )
277		__field(        u64,            state           )
278	),
279
280	TP_fast_assign(
281		__assign_str(name);
282		__entry->state = state;
283	),
284
285	TP_printk("%s state=0x%lx", __get_str(name),
286		(unsigned long)__entry->state)
287);
288
289DEFINE_EVENT(wakeup_source, wakeup_source_activate,
290
291	TP_PROTO(const char *name, unsigned int state),
292
293	TP_ARGS(name, state)
294);
295
296DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
 
 
297
298	TP_PROTO(const char *name, unsigned int state),
 
 
 
 
299
300	TP_ARGS(name, state)
301);
302
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
303/*
304 * The clock events are used for clock enable/disable and for
305 *  clock rate change
306 */
307DECLARE_EVENT_CLASS(clock,
308
309	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
310
311	TP_ARGS(name, state, cpu_id),
312
313	TP_STRUCT__entry(
314		__string(       name,           name            )
315		__field(        u64,            state           )
316		__field(        u64,            cpu_id          )
317	),
318
319	TP_fast_assign(
320		__assign_str(name);
321		__entry->state = state;
322		__entry->cpu_id = cpu_id;
323	),
324
325	TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
326		(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
327);
328
329DEFINE_EVENT(clock, clock_enable,
330
331	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
332
333	TP_ARGS(name, state, cpu_id)
334);
335
336DEFINE_EVENT(clock, clock_disable,
337
338	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
339
340	TP_ARGS(name, state, cpu_id)
341);
342
343DEFINE_EVENT(clock, clock_set_rate,
344
345	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
346
347	TP_ARGS(name, state, cpu_id)
348);
349
350/*
351 * The power domain events are used for power domains transitions
352 */
353DECLARE_EVENT_CLASS(power_domain,
354
355	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
356
357	TP_ARGS(name, state, cpu_id),
358
359	TP_STRUCT__entry(
360		__string(       name,           name            )
361		__field(        u64,            state           )
362		__field(        u64,            cpu_id          )
363	),
364
365	TP_fast_assign(
366		__assign_str(name);
367		__entry->state = state;
368		__entry->cpu_id = cpu_id;
369),
370
371	TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
372		(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
373);
374
375DEFINE_EVENT(power_domain, power_domain_target,
376
377	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
378
379	TP_ARGS(name, state, cpu_id)
380);
381
382/*
383 * CPU latency QoS events used for global CPU latency QoS list updates
384 */
385DECLARE_EVENT_CLASS(cpu_latency_qos_request,
386
387	TP_PROTO(s32 value),
388
389	TP_ARGS(value),
390
391	TP_STRUCT__entry(
392		__field( s32,                    value          )
393	),
394
395	TP_fast_assign(
396		__entry->value = value;
397	),
398
399	TP_printk("CPU_DMA_LATENCY value=%d",
400		  __entry->value)
401);
402
403DEFINE_EVENT(cpu_latency_qos_request, pm_qos_add_request,
404
405	TP_PROTO(s32 value),
406
407	TP_ARGS(value)
408);
409
410DEFINE_EVENT(cpu_latency_qos_request, pm_qos_update_request,
411
412	TP_PROTO(s32 value),
413
414	TP_ARGS(value)
415);
416
417DEFINE_EVENT(cpu_latency_qos_request, pm_qos_remove_request,
418
419	TP_PROTO(s32 value),
420
421	TP_ARGS(value)
422);
423
424/*
425 * General PM QoS events used for updates of PM QoS request lists
426 */
427DECLARE_EVENT_CLASS(pm_qos_update,
428
429	TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
430
431	TP_ARGS(action, prev_value, curr_value),
432
433	TP_STRUCT__entry(
434		__field( enum pm_qos_req_action, action         )
435		__field( int,                    prev_value     )
436		__field( int,                    curr_value     )
437	),
438
439	TP_fast_assign(
440		__entry->action = action;
441		__entry->prev_value = prev_value;
442		__entry->curr_value = curr_value;
443	),
444
445	TP_printk("action=%s prev_value=%d curr_value=%d",
446		  __print_symbolic(__entry->action,
447			{ PM_QOS_ADD_REQ,	"ADD_REQ" },
448			{ PM_QOS_UPDATE_REQ,	"UPDATE_REQ" },
449			{ PM_QOS_REMOVE_REQ,	"REMOVE_REQ" }),
450		  __entry->prev_value, __entry->curr_value)
451);
452
453DEFINE_EVENT(pm_qos_update, pm_qos_update_target,
454
455	TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
456
457	TP_ARGS(action, prev_value, curr_value)
458);
459
460DEFINE_EVENT_PRINT(pm_qos_update, pm_qos_update_flags,
461
462	TP_PROTO(enum pm_qos_req_action action, int prev_value, int curr_value),
463
464	TP_ARGS(action, prev_value, curr_value),
465
466	TP_printk("action=%s prev_value=0x%x curr_value=0x%x",
467		  __print_symbolic(__entry->action,
468			{ PM_QOS_ADD_REQ,	"ADD_REQ" },
469			{ PM_QOS_UPDATE_REQ,	"UPDATE_REQ" },
470			{ PM_QOS_REMOVE_REQ,	"REMOVE_REQ" }),
471		  __entry->prev_value, __entry->curr_value)
472);
473
474DECLARE_EVENT_CLASS(dev_pm_qos_request,
475
476	TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
477		 s32 new_value),
478
479	TP_ARGS(name, type, new_value),
480
481	TP_STRUCT__entry(
482		__string( name,                    name         )
483		__field( enum dev_pm_qos_req_type, type         )
484		__field( s32,                      new_value    )
485	),
486
487	TP_fast_assign(
488		__assign_str(name);
489		__entry->type = type;
490		__entry->new_value = new_value;
491	),
492
493	TP_printk("device=%s type=%s new_value=%d",
494		  __get_str(name),
495		  __print_symbolic(__entry->type,
496			{ DEV_PM_QOS_RESUME_LATENCY, "DEV_PM_QOS_RESUME_LATENCY" },
497			{ DEV_PM_QOS_FLAGS, "DEV_PM_QOS_FLAGS" }),
498		  __entry->new_value)
499);
500
501DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_add_request,
502
503	TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
504		 s32 new_value),
505
506	TP_ARGS(name, type, new_value)
507);
508
509DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_update_request,
510
511	TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
512		 s32 new_value),
513
514	TP_ARGS(name, type, new_value)
515);
516
517DEFINE_EVENT(dev_pm_qos_request, dev_pm_qos_remove_request,
518
519	TP_PROTO(const char *name, enum dev_pm_qos_req_type type,
520		 s32 new_value),
521
522	TP_ARGS(name, type, new_value)
523);
524
525TRACE_EVENT(guest_halt_poll_ns,
526
527	TP_PROTO(bool grow, unsigned int new, unsigned int old),
528
529	TP_ARGS(grow, new, old),
530
531	TP_STRUCT__entry(
532		__field(bool, grow)
533		__field(unsigned int, new)
534		__field(unsigned int, old)
535	),
536
537	TP_fast_assign(
538		__entry->grow   = grow;
539		__entry->new    = new;
540		__entry->old    = old;
541	),
542
543	TP_printk("halt_poll_ns %u (%s %u)",
544		__entry->new,
545		__entry->grow ? "grow" : "shrink",
546		__entry->old)
547);
548
549#define trace_guest_halt_poll_ns_grow(new, old) \
550	trace_guest_halt_poll_ns(true, new, old)
551#define trace_guest_halt_poll_ns_shrink(new, old) \
552	trace_guest_halt_poll_ns(false, new, old)
553#endif /* _TRACE_POWER_H */
554
555/* This part must be outside protection */
556#include <trace/define_trace.h>
v3.5.6
 
  1#undef TRACE_SYSTEM
  2#define TRACE_SYSTEM power
  3
  4#if !defined(_TRACE_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
  5#define _TRACE_POWER_H
  6
 
  7#include <linux/ktime.h>
 
  8#include <linux/tracepoint.h>
 
 
 
  9
 10DECLARE_EVENT_CLASS(cpu,
 11
 12	TP_PROTO(unsigned int state, unsigned int cpu_id),
 13
 14	TP_ARGS(state, cpu_id),
 15
 16	TP_STRUCT__entry(
 17		__field(	u32,		state		)
 18		__field(	u32,		cpu_id		)
 19	),
 20
 21	TP_fast_assign(
 22		__entry->state = state;
 23		__entry->cpu_id = cpu_id;
 24	),
 25
 26	TP_printk("state=%lu cpu_id=%lu", (unsigned long)__entry->state,
 27		  (unsigned long)__entry->cpu_id)
 28);
 29
 30DEFINE_EVENT(cpu, cpu_idle,
 31
 32	TP_PROTO(unsigned int state, unsigned int cpu_id),
 33
 34	TP_ARGS(state, cpu_id)
 35);
 36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 37/* This file can get included multiple times, TRACE_HEADER_MULTI_READ at top */
 38#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING
 39#define _PWR_EVENT_AVOID_DOUBLE_DEFINING
 40
 41#define PWR_EVENT_EXIT -1
 42#endif
 43
 
 
 
 
 
 
 
 
 
 
 
 44DEFINE_EVENT(cpu, cpu_frequency,
 45
 46	TP_PROTO(unsigned int frequency, unsigned int cpu_id),
 47
 48	TP_ARGS(frequency, cpu_id)
 49);
 50
 51TRACE_EVENT(machine_suspend,
 52
 53	TP_PROTO(unsigned int state),
 54
 55	TP_ARGS(state),
 56
 57	TP_STRUCT__entry(
 58		__field(	u32,		state		)
 
 
 59	),
 60
 61	TP_fast_assign(
 62		__entry->state = state;
 
 
 63	),
 64
 65	TP_printk("state=%lu", (unsigned long)__entry->state)
 
 
 
 66);
 67
 68DECLARE_EVENT_CLASS(wakeup_source,
 69
 70	TP_PROTO(const char *name, unsigned int state),
 71
 72	TP_ARGS(name, state),
 73
 74	TP_STRUCT__entry(
 75		__string(       name,           name            )
 76		__field(        u64,            state           )
 
 
 
 77	),
 78
 79	TP_fast_assign(
 80		__assign_str(name, name);
 81		__entry->state = state;
 
 
 
 82	),
 83
 84	TP_printk("%s state=0x%lx", __get_str(name),
 85		(unsigned long)__entry->state)
 
 86);
 87
 88DEFINE_EVENT(wakeup_source, wakeup_source_activate,
 89
 90	TP_PROTO(const char *name, unsigned int state),
 91
 92	TP_ARGS(name, state)
 93);
 94
 95DEFINE_EVENT(wakeup_source, wakeup_source_deactivate,
 
 
 
 
 96
 97	TP_PROTO(const char *name, unsigned int state),
 
 
 
 
 98
 99	TP_ARGS(name, state)
 
100);
101
102#ifdef CONFIG_EVENT_POWER_TRACING_DEPRECATED
103
104/*
105 * The power events are used for cpuidle & suspend (power_start, power_end)
106 *  and for cpufreq (power_frequency)
107 */
108DECLARE_EVENT_CLASS(power,
109
110	TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
111
112	TP_ARGS(type, state, cpu_id),
113
114	TP_STRUCT__entry(
115		__field(	u64,		type		)
116		__field(	u64,		state		)
117		__field(	u64,		cpu_id		)
118	),
119
120	TP_fast_assign(
121		__entry->type = type;
122		__entry->state = state;
123		__entry->cpu_id = cpu_id;
124	),
125
126	TP_printk("type=%lu state=%lu cpu_id=%lu", (unsigned long)__entry->type,
127		(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
128);
129
130DEFINE_EVENT(power, power_start,
131
132	TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
133
134	TP_ARGS(type, state, cpu_id)
135);
136
137DEFINE_EVENT(power, power_frequency,
 
 
 
138
139	TP_PROTO(unsigned int type, unsigned int state, unsigned int cpu_id),
 
 
 
140
141	TP_ARGS(type, state, cpu_id)
 
142);
143
144TRACE_EVENT(power_end,
145
146	TP_PROTO(unsigned int cpu_id),
147
148	TP_ARGS(cpu_id),
 
149
150	TP_STRUCT__entry(
151		__field(	u64,		cpu_id		)
152	),
153
154	TP_fast_assign(
155		__entry->cpu_id = cpu_id;
156	),
157
158	TP_printk("cpu_id=%lu", (unsigned long)__entry->cpu_id)
159
 
160);
161
162/* Deprecated dummy functions must be protected against multi-declartion */
163#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
164#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
165
166enum {
167	POWER_NONE = 0,
168	POWER_CSTATE = 1,
169	POWER_PSTATE = 2,
170};
171#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
172
173#else /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
174
175#ifndef _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
176#define _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED
177enum {
178       POWER_NONE = 0,
179       POWER_CSTATE = 1,
180       POWER_PSTATE = 2,
181};
182
183/* These dummy declaration have to be ripped out when the deprecated
184   events get removed */
185static inline void trace_power_start(u64 type, u64 state, u64 cpuid) {};
186static inline void trace_power_end(u64 cpuid) {};
187static inline void trace_power_start_rcuidle(u64 type, u64 state, u64 cpuid) {};
188static inline void trace_power_end_rcuidle(u64 cpuid) {};
189static inline void trace_power_frequency(u64 type, u64 state, u64 cpuid) {};
190#endif /* _PWR_EVENT_AVOID_DOUBLE_DEFINING_DEPRECATED */
191
192#endif /* CONFIG_EVENT_POWER_TRACING_DEPRECATED */
193
194/*
195 * The clock events are used for clock enable/disable and for
196 *  clock rate change
197 */
198DECLARE_EVENT_CLASS(clock,
199
200	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
201
202	TP_ARGS(name, state, cpu_id),
203
204	TP_STRUCT__entry(
205		__string(       name,           name            )
206		__field(        u64,            state           )
207		__field(        u64,            cpu_id          )
208	),
209
210	TP_fast_assign(
211		__assign_str(name, name);
212		__entry->state = state;
213		__entry->cpu_id = cpu_id;
214	),
215
216	TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
217		(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
218);
219
220DEFINE_EVENT(clock, clock_enable,
221
222	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
223
224	TP_ARGS(name, state, cpu_id)
225);
226
227DEFINE_EVENT(clock, clock_disable,
228
229	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
230
231	TP_ARGS(name, state, cpu_id)
232);
233
234DEFINE_EVENT(clock, clock_set_rate,
235
236	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
237
238	TP_ARGS(name, state, cpu_id)
239);
240
241/*
242 * The power domain events are used for power domains transitions
243 */
244DECLARE_EVENT_CLASS(power_domain,
245
246	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
247
248	TP_ARGS(name, state, cpu_id),
249
250	TP_STRUCT__entry(
251		__string(       name,           name            )
252		__field(        u64,            state           )
253		__field(        u64,            cpu_id          )
254	),
255
256	TP_fast_assign(
257		__assign_str(name, name);
258		__entry->state = state;
259		__entry->cpu_id = cpu_id;
260),
261
262	TP_printk("%s state=%lu cpu_id=%lu", __get_str(name),
263		(unsigned long)__entry->state, (unsigned long)__entry->cpu_id)
264);
265
266DEFINE_EVENT(power_domain, power_domain_target,
267
268	TP_PROTO(const char *name, unsigned int state, unsigned int cpu_id),
269
270	TP_ARGS(name, state, cpu_id)
271);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272#endif /* _TRACE_POWER_H */
273
274/* This part must be outside protection */
275#include <trace/define_trace.h>