#!/system/bin/sh
# Run a few minutes after the swap (ideally after some load that warms the phone).
NAME=android.hardware.thermal-service.qti
pid=$(pidof $NAME)
echo "== service: $(getprop init.svc.vendor.thermal-hal) pid $pid threads $(ls /proc/$pid/task 2>/dev/null | wc -l)"
grep -E '^(Pss|Rss):' /proc/$pid/smaps_rollup 2>/dev/null
echo "== HAL log"
logcat -d -s thermal_hal | tail -30
echo "== temperatures and thresholds the framework sees"
dumpsys thermalservice | sed -n '/HAL Ready/,$p' | head -80
echo "== crash buffer (thermal)"
logcat -b crash -d | grep -i thermal | tail -20
echo "== avc (thermal)"
logcat -d | grep avc | grep -i hal_thermal | tail -10
