Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <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>

authored by

Punit Agrawal and committed by
Eduardo Valentin
39811569 100a8fdb

+20
+1
drivers/thermal/thermal_core.c
··· 1291 1291 mutex_unlock(&cdev->lock); 1292 1292 cdev->ops->set_cur_state(cdev, target); 1293 1293 cdev->updated = true; 1294 + trace_cdev_update(cdev, target); 1294 1295 dev_dbg(&cdev->device, "set to state %lu\n", target); 1295 1296 } 1296 1297 EXPORT_SYMBOL(thermal_cdev_update);
+19
include/trace/events/thermal.h
··· 32 32 __entry->temp) 33 33 ); 34 34 35 + TRACE_EVENT(cdev_update, 36 + 37 + TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target), 38 + 39 + TP_ARGS(cdev, target), 40 + 41 + TP_STRUCT__entry( 42 + __string(type, cdev->type) 43 + __field(unsigned long, target) 44 + ), 45 + 46 + TP_fast_assign( 47 + __assign_str(type, cdev->type); 48 + __entry->target = target; 49 + ), 50 + 51 + TP_printk("type=%s target=%lu", __get_str(type), __entry->target) 52 + ); 53 + 35 54 #endif /* _TRACE_THERMAL_H */ 36 55 37 56 /* This part must be outside protection */