thermal: trace: Trace when temperature is above a trip point
[deliverable/linux.git] / drivers / thermal / thermal_core.c
index 71b0ec0c370d73aad18d685118c197735c5b2833..454884aa15f776d0f607c186612b481bd49904b3 100644 (file)
@@ -38,6 +38,9 @@
 #include <net/netlink.h>
 #include <net/genetlink.h>
 
+#define CREATE_TRACE_POINTS
+#include <trace/events/thermal.h>
+
 #include "thermal_core.h"
 #include "thermal_hwmon.h"
 
@@ -368,6 +371,8 @@ static void handle_critical_trips(struct thermal_zone_device *tz,
        if (tz->temperature < trip_temp)
                return;
 
+       trace_thermal_zone_trip(tz, trip, trip_type);
+
        if (tz->ops->notify)
                tz->ops->notify(tz, trip, trip_type);
 
@@ -463,6 +468,7 @@ static void update_temperature(struct thermal_zone_device *tz)
        tz->temperature = temp;
        mutex_unlock(&tz->lock);
 
+       trace_thermal_temperature(tz);
        dev_dbg(&tz->device, "last_temperature=%d, current_temperature=%d\n",
                                tz->last_temperature, tz->temperature);
 }
@@ -1287,6 +1293,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);
This page took 0.023913 seconds and 5 git commands to generate.