xref: /linux/drivers/thermal/thermal_trace_ipa.h (revision 24b10e5f8e0d2bee1a10fc67011ea5d936c1a389)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #undef TRACE_SYSTEM
3 #define TRACE_SYSTEM thermal_power_allocator
4 
5 #if !defined(_TRACE_THERMAL_POWER_ALLOCATOR_H) || defined(TRACE_HEADER_MULTI_READ)
6 #define _TRACE_THERMAL_POWER_ALLOCATOR_H
7 
8 #include <linux/tracepoint.h>
9 
10 TRACE_EVENT(thermal_power_allocator,
11 	TP_PROTO(struct thermal_zone_device *tz, u32 total_req_power,
12 		 u32 total_granted_power, int num_actors, u32 power_range,
13 		 u32 max_allocatable_power, int current_temp, s32 delta_temp),
14 	TP_ARGS(tz, total_req_power, total_granted_power, num_actors,
15 		power_range, max_allocatable_power, current_temp, delta_temp),
16 	TP_STRUCT__entry(
17 		__field(int,           tz_id          )
18 		__field(u32,           total_req_power          )
19 		__field(u32,           total_granted_power      )
20 		__field(size_t,        num_actors               )
21 		__field(u32,           power_range              )
22 		__field(u32,           max_allocatable_power    )
23 		__field(int,           current_temp             )
24 		__field(s32,           delta_temp               )
25 	),
26 	TP_fast_assign(
27 		__entry->tz_id = tz->id;
28 		__entry->total_req_power = total_req_power;
29 		__entry->total_granted_power = total_granted_power;
30 		__entry->num_actors = num_actors;
31 		__entry->power_range = power_range;
32 		__entry->max_allocatable_power = max_allocatable_power;
33 		__entry->current_temp = current_temp;
34 		__entry->delta_temp = delta_temp;
35 	),
36 
37 	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",
38 		__entry->tz_id,	__entry->total_req_power,
39 		__entry->total_granted_power, __entry->power_range,
40 		__entry->max_allocatable_power, __entry->current_temp,
41 		__entry->delta_temp)
42 );
43 
44 TRACE_EVENT(thermal_power_actor,
45 	TP_PROTO(struct thermal_zone_device *tz, int actor_id, u32 req_power,
46 		 u32 granted_power),
47 	TP_ARGS(tz, actor_id, req_power, granted_power),
48 	TP_STRUCT__entry(
49 		__field(int, tz_id)
50 		__field(int, actor_id)
51 		__field(u32, req_power)
52 		__field(u32, granted_power)
53 	),
54 	TP_fast_assign(
55 		__entry->tz_id = tz->id;
56 		__entry->actor_id = actor_id;
57 		__entry->req_power = req_power;
58 		__entry->granted_power = granted_power;
59 	),
60 
61 	TP_printk("thermal_zone_id=%d actor_id=%d req_power=%u granted_power=%u",
62 		__entry->tz_id,	__entry->actor_id, __entry->req_power,
63 		__entry->granted_power)
64 );
65 
66 TRACE_EVENT(thermal_power_allocator_pid,
67 	TP_PROTO(struct thermal_zone_device *tz, s32 err, s32 err_integral,
68 		 s64 p, s64 i, s64 d, s32 output),
69 	TP_ARGS(tz, err, err_integral, p, i, d, output),
70 	TP_STRUCT__entry(
71 		__field(int, tz_id       )
72 		__field(s32, err         )
73 		__field(s32, err_integral)
74 		__field(s64, p           )
75 		__field(s64, i           )
76 		__field(s64, d           )
77 		__field(s32, output      )
78 	),
79 	TP_fast_assign(
80 		__entry->tz_id = tz->id;
81 		__entry->err = err;
82 		__entry->err_integral = err_integral;
83 		__entry->p = p;
84 		__entry->i = i;
85 		__entry->d = d;
86 		__entry->output = output;
87 	),
88 
89 	TP_printk("thermal_zone_id=%d err=%d err_integral=%d p=%lld i=%lld d=%lld output=%d",
90 		  __entry->tz_id, __entry->err, __entry->err_integral,
91 		  __entry->p, __entry->i, __entry->d, __entry->output)
92 );
93 #endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */
94 
95 #undef TRACE_INCLUDE_PATH
96 #define TRACE_INCLUDE_PATH .
97 
98 #undef TRACE_INCLUDE_FILE
99 #define TRACE_INCLUDE_FILE thermal_trace_ipa
100 
101 /* This part must be outside protection */
102 #include <trace/define_trace.h>
103