1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM devfreq
5 #if !defined(_TRACE_DEVFREQ_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_DEVFREQ_H
8 #include <linux/devfreq.h>
9 #include <linux/tracepoint.h>
11 TRACE_EVENT(devfreq_monitor
,
12 TP_PROTO(struct devfreq
*devfreq
),
17 __field(unsigned long, freq
)
18 __field(unsigned long, busy_time
)
19 __field(unsigned long, total_time
)
20 __field(unsigned int, polling_ms
)
21 __string(dev_name
, dev_name(&devfreq
->dev
))
25 __entry
->freq
= devfreq
->previous_freq
;
26 __entry
->busy_time
= devfreq
->last_status
.busy_time
;
27 __entry
->total_time
= devfreq
->last_status
.total_time
;
28 __entry
->polling_ms
= devfreq
->profile
->polling_ms
;
29 __assign_str(dev_name
, dev_name(&devfreq
->dev
));
32 TP_printk("dev_name=%s freq=%lu polling_ms=%u load=%lu",
33 __get_str(dev_name
), __entry
->freq
, __entry
->polling_ms
,
34 __entry
->total_time
== 0 ? 0 :
35 (100 * __entry
->busy_time
) / __entry
->total_time
)
37 #endif /* _TRACE_DEVFREQ_H */
39 /* This part must be outside protection */
40 #include <trace/define_trace.h>