2 #define TRACE_SYSTEM thermal_power_allocator
4 #if !defined(_TRACE_THERMAL_POWER_ALLOCATOR_H) || defined(TRACE_HEADER_MULTI_READ)
5 #define _TRACE_THERMAL_POWER_ALLOCATOR_H
7 #include <linux/tracepoint.h>
9 TRACE_EVENT(thermal_power_allocator
,
10 TP_PROTO(struct thermal_zone_device
*tz
, u32
*req_power
,
11 u32 total_req_power
, u32
*granted_power
,
12 u32 total_granted_power
, size_t num_actors
,
13 u32 power_range
, u32 max_allocatable_power
,
14 int current_temp
, s32 delta_temp
),
15 TP_ARGS(tz
, req_power
, total_req_power
, granted_power
,
16 total_granted_power
, num_actors
, power_range
,
17 max_allocatable_power
, current_temp
, delta_temp
),
20 __dynamic_array(u32
, req_power
, num_actors
)
21 __field(u32
, total_req_power
)
22 __dynamic_array(u32
, granted_power
, num_actors
)
23 __field(u32
, total_granted_power
)
24 __field(size_t, num_actors
)
25 __field(u32
, power_range
)
26 __field(u32
, max_allocatable_power
)
27 __field(int, current_temp
)
28 __field(s32
, delta_temp
)
31 __entry
->tz_id
= tz
->id
;
32 memcpy(__get_dynamic_array(req_power
), req_power
,
33 num_actors
* sizeof(*req_power
));
34 __entry
->total_req_power
= total_req_power
;
35 memcpy(__get_dynamic_array(granted_power
), granted_power
,
36 num_actors
* sizeof(*granted_power
));
37 __entry
->total_granted_power
= total_granted_power
;
38 __entry
->num_actors
= num_actors
;
39 __entry
->power_range
= power_range
;
40 __entry
->max_allocatable_power
= max_allocatable_power
;
41 __entry
->current_temp
= current_temp
;
42 __entry
->delta_temp
= delta_temp
;
45 TP_printk("thermal_zone_id=%d req_power={%s} total_req_power=%u granted_power={%s} total_granted_power=%u power_range=%u max_allocatable_power=%u current_temperature=%d delta_temperature=%d",
47 __print_array(__get_dynamic_array(req_power
),
48 __entry
->num_actors
, 4),
49 __entry
->total_req_power
,
50 __print_array(__get_dynamic_array(granted_power
),
51 __entry
->num_actors
, 4),
52 __entry
->total_granted_power
, __entry
->power_range
,
53 __entry
->max_allocatable_power
, __entry
->current_temp
,
57 TRACE_EVENT(thermal_power_allocator_pid
,
58 TP_PROTO(struct thermal_zone_device
*tz
, s32 err
, s32 err_integral
,
59 s64 p
, s64 i
, s64 d
, s32 output
),
60 TP_ARGS(tz
, err
, err_integral
, p
, i
, d
, output
),
64 __field(s32
, err_integral
)
71 __entry
->tz_id
= tz
->id
;
73 __entry
->err_integral
= err_integral
;
77 __entry
->output
= output
;
80 TP_printk("thermal_zone_id=%d err=%d err_integral=%d p=%lld i=%lld d=%lld output=%d",
81 __entry
->tz_id
, __entry
->err
, __entry
->err_integral
,
82 __entry
->p
, __entry
->i
, __entry
->d
, __entry
->output
)
84 #endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
86 /* This part must be outside protection */
87 #include <trace/define_trace.h>