summaryrefslogtreecommitdiff
path: root/thermal/init.thermal.logging.sh
blob: de385ab577ae1c5ee9fe0ee918deb754af1b7aea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/vendor/bin/sh

if [ $# -eq 1 ]; then
  interval=$1
else
  exit 1
fi

while true
do
  logline="tz:"
  for f in /sys/class/thermal/thermal*
  do
    temp=`cat $f/temp`
    logline+="|$temp"
  done
  logline+=" cdev:"
  for f in /sys/class/thermal/cooling_device*
  do
    cur_state=`cat $f/cur_state`
    logline+="|$cur_state"
  done
  log -p w -t THERMAL_LOG $logline
  sleep $interval
done