Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b1c0d10 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: thermal: Add trace event for hysteresis clear



Add new trace event to display information related to hysteresis clear.
Also update the cdev trace to print the aggregated floor request for a
cooling device.

Update the step_wise and low limits governor to call the hysteresis
trace when the hysteresis temperature is cleared.

Change-Id: I265f90c247f4bab65abeece68175bfc8853d459d
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent e4e90297
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static int get_trip_level(struct thermal_zone_device *tz)
	 */
	if (count > 0) {
		tz->ops->get_trip_type(tz, count - 1, &trip_type);
		trace_thermal_zone_trip(tz, count - 1, trip_type);
		trace_thermal_zone_trip(tz, count - 1, trip_type, true);
	}

	return count;
+2 −1
Original line number Diff line number Diff line
@@ -67,10 +67,11 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)

		if (old_target == THERMAL_NO_TARGET &&
				instance->target != THERMAL_NO_TARGET) {
			trace_thermal_zone_trip(tz, trip, trip_type);
			trace_thermal_zone_trip(tz, trip, trip_type, true);
			tz->passive += 1;
		} else if (old_target != THERMAL_NO_TARGET &&
				instance->target == THERMAL_NO_TARGET) {
			trace_thermal_zone_trip(tz, trip, trip_type, false);
			tz->passive -= 1;
		}

+8 −7
Original line number Diff line number Diff line
@@ -169,12 +169,10 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)
		 */
		if (tz->temperature >= trip_temp ||
			(tz->temperature >= hyst_temp &&
			 old_target != THERMAL_NO_TARGET)) {
			 old_target != THERMAL_NO_TARGET))
			throttle = true;
			trace_thermal_zone_trip(tz, trip, trip_type);
		} else {
		else
			throttle = false;
		}

		instance->target = get_target_state(instance, trend, throttle);
		dev_dbg(&instance->cdev->device, "old_target=%d, target=%d\n",
@@ -185,12 +183,15 @@ static void thermal_zone_trip_update(struct thermal_zone_device *tz, int trip)

		/* Activate a passive thermal instance */
		if (old_target == THERMAL_NO_TARGET &&
			instance->target != THERMAL_NO_TARGET)
			instance->target != THERMAL_NO_TARGET) {
			update_passive_instance(tz, trip_type, 1);
			trace_thermal_zone_trip(tz, trip, trip_type, true);
		/* Deactivate a passive thermal instance */
		else if (old_target != THERMAL_NO_TARGET &&
			instance->target == THERMAL_NO_TARGET)
		} else if (old_target != THERMAL_NO_TARGET &&
			instance->target == THERMAL_NO_TARGET) {
			update_passive_instance(tz, trip_type, -1);
			trace_thermal_zone_trip(tz, trip, trip_type, false);
		}

		instance->initialized = true;
		mutex_lock(&instance->cdev->lock);
+2 −2
Original line number Diff line number Diff line
@@ -444,7 +444,7 @@ static void handle_critical_trips(struct thermal_zone_device *tz,
	if (trip_temp <= 0 || tz->temperature < trip_temp)
		return;

	trace_thermal_zone_trip(tz, trip, trip_type);
	trace_thermal_zone_trip(tz, trip, trip_type, true);

	if (tz->ops->notify)
		tz->ops->notify(tz, trip, trip_type);
@@ -1768,7 +1768,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
		cdev->ops->set_min_state(cdev, min_target);
	cdev->updated = true;
	mutex_unlock(&cdev->lock);
	trace_cdev_update(cdev, current_target);
	trace_cdev_update(cdev, current_target, min_target);
	dev_dbg(&cdev->device, "set to state %lu min state %lu\n",
				current_target, min_target);
}
+15 −7
Original line number Diff line number Diff line
@@ -47,35 +47,40 @@ TRACE_EVENT(thermal_temperature,

TRACE_EVENT(cdev_update,

	TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target),
	TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target,
		 unsigned long min_target),

	TP_ARGS(cdev, target),
	TP_ARGS(cdev, target, min_target),

	TP_STRUCT__entry(
		__string(type, cdev->type)
		__field(unsigned long, target)
		__field(unsigned long, min_target)
	),

	TP_fast_assign(
		__assign_str(type, cdev->type);
		__entry->target = target;
		__entry->min_target = min_target;
	),

	TP_printk("type=%s target=%lu", __get_str(type), __entry->target)
	TP_printk("type=%s target=%lu min_target=%lu", __get_str(type),
				__entry->target, __entry->min_target)
);

TRACE_EVENT(thermal_zone_trip,

	TP_PROTO(struct thermal_zone_device *tz, int trip,
		enum thermal_trip_type trip_type),
		enum thermal_trip_type trip_type, bool is_trip),

	TP_ARGS(tz, trip, trip_type),
	TP_ARGS(tz, trip, trip_type, is_trip),

	TP_STRUCT__entry(
		__string(thermal_zone, tz->type)
		__field(int, id)
		__field(int, trip)
		__field(enum thermal_trip_type, trip_type)
		__field(bool, is_trip)
	),

	TP_fast_assign(
@@ -83,10 +88,13 @@ TRACE_EVENT(thermal_zone_trip,
		__entry->id = tz->id;
		__entry->trip = trip;
		__entry->trip_type = trip_type;
		__entry->is_trip = is_trip;
	),

	TP_printk("thermal_zone=%s id=%d trip=%d trip_type=%s",
		__get_str(thermal_zone), __entry->id, __entry->trip,
	TP_printk("thermal_zone=%s id=%d %s=%d trip_type=%s",
		__get_str(thermal_zone), __entry->id,
		(__entry->is_trip) ? "trip" : "hyst",
		__entry->trip,
		show_tzt_type(__entry->trip_type))
);