1 /* SPDX-License-Identifier: GPL-2.0 */
3 #define TRACE_SYSTEM thermal_power_allocator
5 #if !defined(_TRACE_THERMAL_POWER_ALLOCATOR_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_THERMAL_POWER_ALLOCATOR_H
8 #include <linux/tracepoint.h>
10 #include "thermal_core.h"
12 TRACE_EVENT(thermal_power_allocator
,
13 TP_PROTO(struct thermal_zone_device
*tz
, u32 total_req_power
,
14 u32 total_granted_power
, int num_actors
, u32 power_range
,
15 u32 max_allocatable_power
, int current_temp
, s32 delta_temp
),
16 TP_ARGS(tz
, total_req_power
, total_granted_power
, num_actors
,
17 power_range
, max_allocatable_power
, current_temp
, delta_temp
),
20 __field(u32
, total_req_power
)
21 __field(u32
, total_granted_power
)
22 __field(size_t, num_actors
)
23 __field(u32
, power_range
)
24 __field(u32
, max_allocatable_power
)
25 __field(int, current_temp
)
26 __field(s32
, delta_temp
)
29 __entry
->tz_id
= tz
->id
;
30 __entry
->total_req_power
= total_req_power
;
31 __entry
->total_granted_power
= total_granted_power
;
32 __entry
->num_actors
= num_actors
;
33 __entry
->power_range
= power_range
;
34 __entry
->max_allocatable_power
= max_allocatable_power
;
35 __entry
->current_temp
= current_temp
;
36 __entry
->delta_temp
= delta_temp
;
39 TP_printk("thermal_zone_id=%d total_req_power=%u total_granted_power=%u power_range=%u max_allocatable_power=%u current_temperature=%d delta_temperature=%d",
40 __entry
->tz_id
, __entry
->total_req_power
,
41 __entry
->total_granted_power
, __entry
->power_range
,
42 __entry
->max_allocatable_power
, __entry
->current_temp
,
46 TRACE_EVENT(thermal_power_actor
,
47 TP_PROTO(struct thermal_zone_device
*tz
, int actor_id
, u32 req_power
,
49 TP_ARGS(tz
, actor_id
, req_power
, granted_power
),
52 __field(int, actor_id
)
53 __field(u32
, req_power
)
54 __field(u32
, granted_power
)
57 __entry
->tz_id
= tz
->id
;
58 __entry
->actor_id
= actor_id
;
59 __entry
->req_power
= req_power
;
60 __entry
->granted_power
= granted_power
;
63 TP_printk("thermal_zone_id=%d actor_id=%d req_power=%u granted_power=%u",
64 __entry
->tz_id
, __entry
->actor_id
, __entry
->req_power
,
65 __entry
->granted_power
)
68 TRACE_EVENT(thermal_power_allocator_pid
,
69 TP_PROTO(struct thermal_zone_device
*tz
, s32 err
, s32 err_integral
,
70 s64 p
, s64 i
, s64 d
, s32 output
),
71 TP_ARGS(tz
, err
, err_integral
, p
, i
, d
, output
),
75 __field(s32
, err_integral
)
82 __entry
->tz_id
= tz
->id
;
84 __entry
->err_integral
= err_integral
;
88 __entry
->output
= output
;
91 TP_printk("thermal_zone_id=%d err=%d err_integral=%d p=%lld i=%lld d=%lld output=%d",
92 __entry
->tz_id
, __entry
->err
, __entry
->err_integral
,
93 __entry
->p
, __entry
->i
, __entry
->d
, __entry
->output
)
95 #endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
97 #undef TRACE_INCLUDE_PATH
98 #define TRACE_INCLUDE_PATH .
100 #undef TRACE_INCLUDE_FILE
101 #define TRACE_INCLUDE_FILE thermal_trace_ipa
103 /* This part must be outside protection */
104 #include <trace/define_trace.h>