3 #define TRACE_SYSTEM rpm
5 #if !defined(_TRACE_RUNTIME_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_RUNTIME_POWER_H
8 #include <linux/ktime.h>
9 #include <linux/tracepoint.h>
10 #include <linux/device.h>
13 * The rpm_internal events are used for tracing some important
14 * runtime pm internal functions.
16 DECLARE_EVENT_CLASS(rpm_internal
,
18 TP_PROTO(struct device
*dev
, int flags
),
23 __string( name
, dev_name(dev
) )
25 __field( int , usage_count
)
26 __field( int , disable_depth
)
27 __field( int , runtime_auto
)
28 __field( int , request_pending
)
29 __field( int , irq_safe
)
30 __field( int , child_count
)
34 __assign_str(name
, dev_name(dev
));
35 __entry
->flags
= flags
;
36 __entry
->usage_count
= atomic_read(
37 &dev
->power
.usage_count
);
38 __entry
->disable_depth
= dev
->power
.disable_depth
;
39 __entry
->runtime_auto
= dev
->power
.runtime_auto
;
40 __entry
->request_pending
= dev
->power
.request_pending
;
41 __entry
->irq_safe
= dev
->power
.irq_safe
;
42 __entry
->child_count
= atomic_read(
43 &dev
->power
.child_count
);
46 TP_printk("%s flags-%x cnt-%-2d dep-%-2d auto-%-1d p-%-1d"
48 __get_str(name
), __entry
->flags
,
50 __entry
->disable_depth
,
51 __entry
->runtime_auto
,
52 __entry
->request_pending
,
57 DEFINE_EVENT(rpm_internal
, rpm_suspend
,
59 TP_PROTO(struct device
*dev
, int flags
),
63 DEFINE_EVENT(rpm_internal
, rpm_resume
,
65 TP_PROTO(struct device
*dev
, int flags
),
69 DEFINE_EVENT(rpm_internal
, rpm_idle
,
71 TP_PROTO(struct device
*dev
, int flags
),
76 TRACE_EVENT(rpm_return_int
,
77 TP_PROTO(struct device
*dev
, unsigned long ip
, int ret
),
78 TP_ARGS(dev
, ip
, ret
),
81 __string( name
, dev_name(dev
))
82 __field( unsigned long, ip
)
87 __assign_str(name
, dev_name(dev
));
92 TP_printk("%pS:%s ret=%d", (void *)__entry
->ip
, __get_str(name
),
96 #endif /* _TRACE_RUNTIME_POWER_H */
98 /* This part must be outside protection */
99 #include <trace/define_trace.h>