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

Commit 4185d52d authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: thermal: Add trace events for thermal device update events



Add trace events for the actions like set trip temperature,
handle thermal trip and the thermal device update events.

Change-Id: I2157cb5004da50df3abcc45ad72e93719acb7638
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent e19174d2
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -477,6 +477,7 @@ void handle_thermal_trip(struct thermal_zone_device *tz, int trip)
	 * So, start monitoring again.
	 */
	monitor_thermal_zone(tz);
	trace_thermal_handle_trip(tz, trip);
}

/**
@@ -567,6 +568,7 @@ void thermal_zone_set_trips(struct thermal_zone_device *tz)
	ret = tz->ops->set_trips(tz, low, high);
	if (ret)
		dev_err(&tz->device, "Failed to set trips: %d\n", ret);
	trace_thermal_set_trip(tz);

exit:
	mutex_unlock(&tz->lock);
@@ -621,6 +623,7 @@ void thermal_zone_device_update(struct thermal_zone_device *tz,
	if (!tz->ops->get_temp)
		return;

	trace_thermal_device_update(tz, event);
	update_temperature(tz);

	thermal_zone_set_trips(tz);
@@ -1826,6 +1829,7 @@ void thermal_cdev_update(struct thermal_cooling_device *cdev)
				current_target = instance->target;
		}
	}
	trace_cdev_update_start(cdev);
	cdev->ops->set_cur_state(cdev, current_target);
	if (cdev->ops->set_min_state)
		cdev->ops->set_min_state(cdev, min_target);
+86 −0
Original line number Diff line number Diff line
@@ -45,6 +45,23 @@ TRACE_EVENT(thermal_temperature,
		__entry->temp)
);

TRACE_EVENT(cdev_update_start,

	TP_PROTO(struct thermal_cooling_device *cdev),

	TP_ARGS(cdev),

	TP_STRUCT__entry(
		__string(type, cdev->type)
	),

	TP_fast_assign(
		__assign_str(type, cdev->type);
	),

	TP_printk("type=%s update start", __get_str(type))
);

TRACE_EVENT(cdev_update,

	TP_PROTO(struct thermal_cooling_device *cdev, unsigned long target,
@@ -98,6 +115,75 @@ TRACE_EVENT(thermal_zone_trip,
		show_tzt_type(__entry->trip_type))
);

TRACE_EVENT(thermal_handle_trip,

	TP_PROTO(struct thermal_zone_device *tz, int trip),

	TP_ARGS(tz, trip),

	TP_STRUCT__entry(
		__string(thermal_zone, tz->type)
		__field(int, id)
		__field(int, trip)
	),

	TP_fast_assign(
		__assign_str(thermal_zone, tz->type);
		__entry->id = tz->id;
		__entry->trip = trip;
	),

	TP_printk("thermal_zone=%s id=%d handle trip=%d",
		__get_str(thermal_zone), __entry->id, __entry->trip)
);

TRACE_EVENT(thermal_device_update,

	TP_PROTO(struct thermal_zone_device *tz, int event),

	TP_ARGS(tz, event),

	TP_STRUCT__entry(
		__string(thermal_zone, tz->type)
		__field(int, id)
		__field(int, event)
	),

	TP_fast_assign(
		__assign_str(thermal_zone, tz->type);
		__entry->id = tz->id;
		__entry->event = event;
	),

	TP_printk("thermal_zone=%s id=%d received event:%d",
		__get_str(thermal_zone), __entry->id, __entry->event)
);

TRACE_EVENT(thermal_set_trip,

	TP_PROTO(struct thermal_zone_device *tz),

	TP_ARGS(tz),

	TP_STRUCT__entry(
		__string(thermal_zone, tz->type)
		__field(int, id)
		__field(int, low)
		__field(int, high)
	),

	TP_fast_assign(
		__assign_str(thermal_zone, tz->type);
		__entry->id = tz->id;
		__entry->low = tz->prev_low_trip;
		__entry->high = tz->prev_high_trip;
	),

	TP_printk("thermal_zone=%s id=%d low trip=%d high trip=%d",
		__get_str(thermal_zone), __entry->id, __entry->low,
		__entry->high)
);

TRACE_EVENT(thermal_power_cpu_get_power,
	TP_PROTO(const struct cpumask *cpus, unsigned long freq, u32 *load,
		size_t load_len, u32 dynamic_power, u32 static_power),