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 #include "thermal_core.h" 11 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), 18 TP_STRUCT__entry( 19 __field(int, tz_id ) 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 ) 27 ), 28 TP_fast_assign( 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; 37 ), 38 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, 43 __entry->delta_temp) 44 ); 45 46 TRACE_EVENT(thermal_power_actor, 47 TP_PROTO(struct thermal_zone_device *tz, int actor_id, u32 req_power, 48 u32 granted_power), 49 TP_ARGS(tz, actor_id, req_power, granted_power), 50 TP_STRUCT__entry( 51 __field(int, tz_id) 52 __field(int, actor_id) 53 __field(u32, req_power) 54 __field(u32, granted_power) 55 ), 56 TP_fast_assign( 57 __entry->tz_id = tz->id; 58 __entry->actor_id = actor_id; 59 __entry->req_power = req_power; 60 __entry->granted_power = granted_power; 61 ), 62 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) 66 ); 67 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), 72 TP_STRUCT__entry( 73 __field(int, tz_id ) 74 __field(s32, err ) 75 __field(s32, err_integral) 76 __field(s64, p ) 77 __field(s64, i ) 78 __field(s64, d ) 79 __field(s32, output ) 80 ), 81 TP_fast_assign( 82 __entry->tz_id = tz->id; 83 __entry->err = err; 84 __entry->err_integral = err_integral; 85 __entry->p = p; 86 __entry->i = i; 87 __entry->d = d; 88 __entry->output = output; 89 ), 90 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) 94 ); 95 #endif /* _TRACE_THERMAL_POWER_ALLOCATOR_H */ 96 97 #undef TRACE_INCLUDE_PATH 98 #define TRACE_INCLUDE_PATH . 99 100 #undef TRACE_INCLUDE_FILE 101 #define TRACE_INCLUDE_FILE thermal_trace_ipa 102 103 /* This part must be outside protection */ 104 #include <trace/define_trace.h> 105