Commit 792c3dc0 authored by Lukasz Luba's avatar Lukasz Luba Committed by Rafael J. Wysocki

thermal: gov_power_allocator: Change trace functions

Change trace event trace_thermal_power_allocator() to not use dynamic
array for requested power and granted power for all power actors.
Instead, simplify the trace event and print other simple values.

Add new trace event to print power actor information of requested power
and granted power. That trace event would be called in a loop for each
power actor. The trace data would be easier to parse comparing to the
dynamic array implementation.
Signed-off-by: default avatarLukasz Luba <lukasz.luba@arm.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 3d827317
......@@ -469,11 +469,12 @@ static int allocate_power(struct thermal_zone_device *tz, int control_temp)
granted_power[i]);
total_granted_power += granted_power[i];
trace_thermal_power_actor(tz, i, req_power[i],
granted_power[i]);
i++;
}
trace_thermal_power_allocator(tz, req_power, total_req_power,
granted_power, total_granted_power,
trace_thermal_power_allocator(tz, total_req_power, total_granted_power,
num_actors, power_range,
max_allocatable_power, tz->temperature,
control_temp - tz->temperature);
......
......@@ -8,19 +8,14 @@
#include <linux/tracepoint.h>
TRACE_EVENT(thermal_power_allocator,
TP_PROTO(struct thermal_zone_device *tz, u32 *req_power,
u32 total_req_power, u32 *granted_power,
u32 total_granted_power, size_t num_actors,
u32 power_range, u32 max_allocatable_power,
int current_temp, s32 delta_temp),
TP_ARGS(tz, req_power, total_req_power, granted_power,
total_granted_power, num_actors, power_range,
max_allocatable_power, current_temp, delta_temp),
TP_PROTO(struct thermal_zone_device *tz, u32 total_req_power,
u32 total_granted_power, int num_actors, u32 power_range,
u32 max_allocatable_power, int current_temp, s32 delta_temp),
TP_ARGS(tz, total_req_power, total_granted_power, num_actors,
power_range, max_allocatable_power, current_temp, delta_temp),
TP_STRUCT__entry(
__field(int, tz_id )
__dynamic_array(u32, req_power, num_actors )
__field(u32, total_req_power )
__dynamic_array(u32, granted_power, num_actors)
__field(u32, total_granted_power )
__field(size_t, num_actors )
__field(u32, power_range )
......@@ -30,11 +25,7 @@ TRACE_EVENT(thermal_power_allocator,
),
TP_fast_assign(
__entry->tz_id = tz->id;
memcpy(__get_dynamic_array(req_power), req_power,
num_actors * sizeof(*req_power));
__entry->total_req_power = total_req_power;
memcpy(__get_dynamic_array(granted_power), granted_power,
num_actors * sizeof(*granted_power));
__entry->total_granted_power = total_granted_power;
__entry->num_actors = num_actors;
__entry->power_range = power_range;
......@@ -43,18 +34,35 @@ TRACE_EVENT(thermal_power_allocator,
__entry->delta_temp = delta_temp;
),
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",
__entry->tz_id,
__print_array(__get_dynamic_array(req_power),
__entry->num_actors, 4),
__entry->total_req_power,
__print_array(__get_dynamic_array(granted_power),
__entry->num_actors, 4),
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",
__entry->tz_id, __entry->total_req_power,
__entry->total_granted_power, __entry->power_range,
__entry->max_allocatable_power, __entry->current_temp,
__entry->delta_temp)
);
TRACE_EVENT(thermal_power_actor,
TP_PROTO(struct thermal_zone_device *tz, int actor_id, u32 req_power,
u32 granted_power),
TP_ARGS(tz, actor_id, req_power, granted_power),
TP_STRUCT__entry(
__field(int, tz_id)
__field(int, actor_id)
__field(u32, req_power)
__field(u32, granted_power)
),
TP_fast_assign(
__entry->tz_id = tz->id;
__entry->actor_id = actor_id;
__entry->req_power = req_power;
__entry->granted_power = granted_power;
),
TP_printk("thermal_zone_id=%d actor_id=%d req_power=%u granted_power=%u",
__entry->tz_id, __entry->actor_id, __entry->req_power,
__entry->granted_power)
);
TRACE_EVENT(thermal_power_allocator_pid,
TP_PROTO(struct thermal_zone_device *tz, s32 err, s32 err_integral,
s64 p, s64 i, s64 d, s32 output),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment