View Single Post
Benson's Avatar
Posts: 4,930 | Thanked: 2,272 times | Joined on Oct 2007
#21
Hmmm... this past weekend I got it too. And it seems to be recurring rather constantly... The odd thing was, I caught it with the battery drained to 7 hours (standby), the back cover was hot, but there were no processes running with over 4 minutes of CPU time (Xomap and hildon-desktop were about tied at that). So whatever is the problem seems to exit when I wake the tablet?

Originally Posted by benny1967 View Post
It would be cool if some of those good-looking, cool guys in here could write a script that writes time, top 3 tasks in terms of CPU-usage, battery status and maybe other useful information to a file every x seconds... Sure this would drain the battery even more, but maybe it helps finding out whats going on?
I can't judge about good-looking and cool, but here's a script anyway:
Code:
#!/bin/sh
LOGFILE=/media/mmc2/powerlog
DELAY=60
PROCCOUNT=3


LINECOUNT=`expr $PROCCOUNT + 3`
date '+***Logging start: %F %T' >>$LOGFILE
while true; do
  [ -x /usr/bin/battery-status ] && /usr/bin/battery-status >>$LOGFILE
  date '+%F %T' >>$LOGFILE
  top -bn1 |head -n$LINECOUNT >>$LOGFILE
done
Actually, if you have battery-status installed, you can run it with -d1 to see the battery status every minute, but that doesn't get you a processes. Also, if you want to prune the header info from the top report, you can use this version:
Code:
#!/bin/sh
LOGFILE=/media/mmc2/powerlog
DELAY=60
PROCCOUNT=3


LINECOUNT=`expr $PROCCOUNT + 3`
date '+***Logging start: %F %T' >>$LOGFILE
while true; do
  [ -x /usr/bin/battery-status ] && /usr/bin/battery-status >>$LOGFILE
  date '+%F %T' >>$LOGFILE
  top -bn1 |head -n$LINECOUNT |tail -n+4 >>$LOGFILE
done