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

Commit c64569d3 authored by Ram Chandrasekar's avatar Ram Chandrasekar
Browse files

drivers: thermal: Print thermal temperature trace for userspace query



Print the thermal sensor temperature value in a new trace message. This
will print the temperature value read when it is queried via sysfs.

Change-Id: I7ff6859dcbea67ed068bae6b970d0e626ed0ec5b
Signed-off-by: default avatarRam Chandrasekar <rkumbako@codeaurora.org>
parent 5b93813a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -522,6 +522,7 @@ int thermal_zone_get_temp(struct thermal_zone_device *tz, int *temp)
		if (!ret && *temp < crit_temp)
			*temp = tz->emul_temperature;
	}
	trace_thermal_query_temp(tz, *temp);
	mutex_unlock(&tz->lock);
exit:
	return ret;
+23 −0
Original line number Diff line number Diff line
@@ -20,6 +20,29 @@ TRACE_DEFINE_ENUM(THERMAL_TRIP_ACTIVE);
			 { THERMAL_TRIP_PASSIVE,  "PASSIVE"},	\
			 { THERMAL_TRIP_ACTIVE,   "ACTIVE"})

TRACE_EVENT(thermal_query_temp,

	TP_PROTO(struct thermal_zone_device *tz, int temp),

	TP_ARGS(tz, temp),

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

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

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

TRACE_EVENT(thermal_temperature,

	TP_PROTO(struct thermal_zone_device *tz),