
#!/bin/sh
currfreq=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq`
idlefreq=`awk '{if ($2 > 0) print $1}' /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state | tail -n 1`
tis1=`awk '{sum += $2} END {print sum}' /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state`
tis2=`awk '$1 == 250000 {idle = $2} {sum += $2} END {print sum-idle}' /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state`
echo -e "
SCRIPT FOR ANALYZING TIME_IN_STATE
By rooted (maemo.org)
Revision 6 + some modifications
The script is in active development.
Update your script to current revision from:
wiki.maemo.org/Overclocking
FREQUENCY\tUSED\t\tWHEN BUSY"
result=`awk '{if ($1 >= 1000000) printf ("%.0f MHz\t",$1/1000); else printf (" %.0f MHz\t", $1/1000)}{if ($2 == 0) printf "unused\t"; else printf ("%.1f %\t\t",($2*100)/"'"$tis1"'")}{if ($2 == 0 || $2/"'"$tis2"'" > 1) printf "\n"; else printf ("%.1f %\n",($2*100)/"'"$tis2"'")}' /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state`
echo -e "
$result
Current frequency: $currfreq\t\t\t MHz
Idle frequency: $idlefreq\t\t\t MHz
Kernel: `uname -r`
kernel-maemo: `dpkg -l kernel* | awk '/kernel-maemo/ {print $3}'`
Uptime: `uptime | sed -e 's/.*p *//' -e 's/, l.*//' -e 's/ / /'`
Load: `uptime | sed 's/.*e: //'`
Boot reason: `cat /proc/bootreason`
Temperature: `cat /sys/class/power_supply/bq27200-0/temp` C\n"

without doing anyting to it| The Following User Says Thank You to titan For This Useful Post: | ||
| The Following User Says Thank You to titan For This Useful Post: | ||