Skip to content

Commit

Permalink
thermal: trace: Trace when a cooling device's state is updated
Browse files Browse the repository at this point in the history
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 <rui.zhang@intel.com>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Signed-off-by: Punit Agrawal <punit.agrawal@arm.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Punit Agrawal authored and Eduardo Valentin committed Jul 29, 2014
1 parent 100a8fd commit 3981156
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 19 additions & 0 deletions include/trace/events/thermal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 3981156

Please sign in to comment.