Skip to content

Commit

Permalink
trace: thermal: add another parameter 'power' to the tracing function
Browse files Browse the repository at this point in the history
This patch adds another parameter to the trace function:
trace_thermal_power_devfreq_get_power().

In case when we call directly driver's code for the real power,
we do not have static/dynamic_power values. Instead we get total
power in the '*power' value. The 'static_power' and
'dynamic_power' are set to 0.

Therefore, we have to trace that '*power' value in this scenario.

CC: Steven Rostedt <[email protected]>
CC: Ingo Molnar <[email protected]>
CC: Zhang Rui <[email protected]>
CC: Eduardo Valentin <[email protected]>
Acked-by: Javi Merino <[email protected]>
Signed-off-by: Lukasz Luba <[email protected]>
  • Loading branch information
lukaszluba-arm authored and zhang-rui committed May 5, 2017
1 parent 2be83da commit 771ffa1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion drivers/thermal/devfreq_cooling.c
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static int devfreq_cooling_get_requested_power(struct thermal_cooling_device *cd
}

trace_thermal_power_devfreq_get_power(cdev, status, freq, dyn_power,
static_power);
static_power, *power);

return 0;
fail:
Expand Down
11 changes: 7 additions & 4 deletions include/trace/events/thermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,16 +151,17 @@ TRACE_EVENT(thermal_power_cpu_limit,
TRACE_EVENT(thermal_power_devfreq_get_power,
TP_PROTO(struct thermal_cooling_device *cdev,
struct devfreq_dev_status *status, unsigned long freq,
u32 dynamic_power, u32 static_power),
u32 dynamic_power, u32 static_power, u32 power),

TP_ARGS(cdev, status, freq, dynamic_power, static_power),
TP_ARGS(cdev, status, freq, dynamic_power, static_power, power),

TP_STRUCT__entry(
__string(type, cdev->type )
__field(unsigned long, freq )
__field(u32, load )
__field(u32, dynamic_power )
__field(u32, static_power )
__field(u32, power)
),

TP_fast_assign(
Expand All @@ -169,11 +170,13 @@ TRACE_EVENT(thermal_power_devfreq_get_power,
__entry->load = (100 * status->busy_time) / status->total_time;
__entry->dynamic_power = dynamic_power;
__entry->static_power = static_power;
__entry->power = power;
),

TP_printk("type=%s freq=%lu load=%u dynamic_power=%u static_power=%u",
TP_printk("type=%s freq=%lu load=%u dynamic_power=%u static_power=%u power=%u",
__get_str(type), __entry->freq,
__entry->load, __entry->dynamic_power, __entry->static_power)
__entry->load, __entry->dynamic_power, __entry->static_power,
__entry->power)
);

TRACE_EVENT(thermal_power_devfreq_limit,
Expand Down

0 comments on commit 771ffa1

Please sign in to comment.