OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Small Useful Informations
ptoki
post Apr 22 2010, 08:28 AM
Post #1





Group: Members
Posts: 90
Joined: 1-April 08
From: Silesia
Member No.: 21,583



Scripts triggered by power/suspend changes are located in /etc/pm
They are triggered twice per change first time with "true" or "false" argument when power change is triggered and second time with "suspend suspend" or "suspend resume" when that change is finishing. That means when you do a full cycle suspend-resume they got triggered four times.
Simply put your script in /etc/pm and link in apropriate directory there and note what is happening.

Its useful to pause and resume mpd or when you dont want to use thick power agent (ie in text mode) to make suspend/resume or backlight change when button is pressed or lid closed/open.
Go to the top of the page
 
+Quote Post
ptoki
post Apr 22 2010, 02:03 PM
Post #2





Group: Members
Posts: 90
Joined: 1-April 08
From: Silesia
Member No.: 21,583



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.
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 26th November 2014 - 09:35 AM