46
Sharp PC-Z1 NetWalker / Small Useful Informations
« on: April 22, 2010, 06:03:17 pm »
Another small utility I made:
#!/bin/bash
while true
do
tmp2=$tmp
fmp2=$fmp
smp2=$smp
tmp=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/total_trans`
fmp=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state|grep 800000|cut -d " " -f 2`
smp=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state|grep 160000|cut -d " " -f 2`
# echo "---$smp-"
((tmp3= $tmp - $tmp2))
((fmp3= $fmp - $fmp2))
((smp3= $smp - $smp2))
echo "$tmp3 $fmp3 $smp3"
sleep 5
done
this script prints how many times cpu was switched between low (160 MHz) to high (800MHz) clock and how long int was working in both modes.
Output looks like this:
34 162 353
26 74 438
20 61 452
0 512 0
10 387 133
9 61 452
First column is number of switches next is time in high clock and last is time in low clock.
It is useful to see which activity uses more power as high clock is more power consuming.
#!/bin/bash
while true
do
tmp2=$tmp
fmp2=$fmp
smp2=$smp
tmp=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/total_trans`
fmp=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state|grep 800000|cut -d " " -f 2`
smp=`cat /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state|grep 160000|cut -d " " -f 2`
# echo "---$smp-"
((tmp3= $tmp - $tmp2))
((fmp3= $fmp - $fmp2))
((smp3= $smp - $smp2))
echo "$tmp3 $fmp3 $smp3"
sleep 5
done
this script prints how many times cpu was switched between low (160 MHz) to high (800MHz) clock and how long int was working in both modes.
Output looks like this:
34 162 353
26 74 438
20 61 452
0 512 0
10 387 133
9 61 452
First column is number of switches next is time in high clock and last is time in low clock.
It is useful to see which activity uses more power as high clock is more power consuming.
