diff options
author | Punit Agrawal <[email protected]> | 2014-07-29 11:50:49 +0100 |
---|---|---|
committer | Eduardo Valentin <[email protected]> | 2014-07-29 09:27:54 -0400 |
commit | 39811569e43a81417bc0ddca3d0c7658c3dcd4b0 (patch) | |
tree | 72f3375f4000c27ba0f15d0a88c64d5536c32a8d | |
parent | 100a8fdbf525bb11796692a713c267be6523a890 (diff) |
thermal: trace: Trace when a cooling device's state is updated
Introduce and use an event to trace when a cooling device's state is
updated. This is useful to follow the effect of governor decisions on
cooling devices.
Cc: Zhang Rui <[email protected]>
Cc: Eduardo Valentin <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Ingo Molnar <[email protected]>
Signed-off-by: Punit Agrawal <[email protected]>
Signed-off-by: Eduardo Valentin <[email protected]>
-rw-r--r-- | drivers/thermal/thermal_core.c | 1 | ||||
-rw-r--r-- | include/trace/events/thermal.h | 19 |
2 files changed, 20 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 6b32391260a0..c74c78d28699 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -1291,6 +1291,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev) mutex_unlock(&cdev->lock); cdev->ops->set_cur_state(cdev, target); cdev->updated = true; + trace_cdev_update(cdev, target); dev_dbg(&cdev->device, "set to state %lu\n", target); } EXPORT_SYMBOL(thermal_cdev_update); diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h index 8c5ca96eccd6..894a79ea0686 100644 --- a/include/trace/events/thermal.h +++ b/include/trace/events/thermal.h @@ -32,6 +32,25 @@ TRACE_EVENT(thermal_temperature, __entry->temp) ); +TRACE_EVENT(cdev_update, + + TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target), + + TP_ARGS(cdev, target), + + TP_STRUCT__entry( + __string(type, cdev->type) + __field(unsigned long, target) + ), + + TP_fast_assign( + __assign_str(type, cdev->type); + __entry->target = target; + ), + + TP_printk("type=%s target=%lu", __get_str(type), __entry->target) +); + #endif /* _TRACE_THERMAL_H */ /* This part must be outside protection */ |