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 TRACE_EVENT(thermal_power_allocator,
11 TP_PROTO(struct thermal_zone_device *tz, u32 *req_power,
12 u32 total_req_power, u32 *granted_power,
13 u32 total_granted_power, size_t num_actors,
14 u32 power_range, u32 max_allocatable_power,
15 int current_temp, s32 delta_temp),
16 TP_ARGS(tz, req_power, total_req_power, granted_power,
17 total_granted_power, num_actors, power_range,
18 max_allocatable_power, current_temp, delta_temp),
21 __dynamic_array(u32, req_power, num_actors )
22 __field(u32, total_req_power )
23 __dynamic_array(u32, granted_power, num_actors)
24 __field(u32, total_granted_power )
25 __field(size_t, num_actors )
26 __field(u32, power_range )
27 __field(u32, max_allocatable_power )
28 __field(int, current_temp )
29 __field(s32, delta_temp )
32 __entry->tz_id = tz->id;
33 memcpy(__get_dynamic_array(req_power), req_power,
34 num_actors * sizeof(*req_power));
35 __entry->total_req_power = total_req_power;
36 memcpy(__get_dynamic_array(granted_power), granted_power,
37 num_actors * sizeof(*granted_power));
38 __entry->total_granted_power = total_granted_power;
39 __entry->num_actors = num_actors;
40 __entry->power_range = power_range;
41 __entry->max_allocatable_power = max_allocatable_power;
42 __entry->current_temp = current_temp;
43 __entry->delta_temp = delta_temp;
46 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",
48 __print_array(__get_dynamic_array(req_power),
49 __entry->num_actors, 4),
50 __entry->total_req_power,
51 __print_array(__get_dynamic_array(granted_power),
52 __entry->num_actors, 4),
53 __entry->total_granted_power, __entry->power_range,
54 __entry->max_allocatable_power, __entry->current_temp,
58 TRACE_EVENT(thermal_power_allocator_pid,
59 TP_PROTO(struct thermal_zone_device *tz, s32 err, s32 err_integral,
60 s64 p, s64 i, s64 d, s32 output),
61 TP_ARGS(tz, err, err_integral, p, i, d, output),
65 __field(s32, err_integral)
72 __entry->tz_id = tz->id;
74 __entry->err_integral = err_integral;
78 __entry->output = output;
81 TP_printk("thermal_zone_id=%d err=%d err_integral=%d p=%lld i=%lld d=%lld output=%d",
82 __entry->tz_id, __entry->err, __entry->err_integral,
83 __entry->p, __entry->i, __entry->d, __entry->output)
85 #endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
87 #undef TRACE_INCLUDE_PATH
88 #define TRACE_INCLUDE_PATH .
90 #undef TRACE_INCLUDE_FILE
91 #define TRACE_INCLUDE_FILE thermal_trace_ipa
93 /* This part must be outside protection */
94 #include <trace/define_trace.h>