This is a short tutorial that presents how you can monitor the SoC thermal activity in an Android system.
1. Thermal Data
The thermal data consists in:
- thermal zones named from TZ0 to TZN
For instance in the following picture a thermal session measurement is performed onto an LG Nexus5 phone.
This phone comes with several thermal sensors, out of which the most useful thermal zones are: TZ0 (CPU), TZ11 (phone's skin) or a thermal sensor placed near the battery.
2. Android /sys entries
The data is exposed through the following /sys entries that are available on most of the Android Linux kernels (but not on all of them), so when using the kernel you have to check if the entry is available in the first place.
CPU temperature: /sys/class/thermal/thermal_zone7/temp
Skin temperature: /sys/class/thermal/thermal_zone11/temp
Temperature near the battery (if available): /sys/class/power_supply/battery/temp
3. Data monitoring
Data is polled from the /sys entries and is displayed in the XPerf application as below.
3.1 Thermal data displayed by XPerf application