maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Nokia N900 (https://talk.maemo.org/forumdisplay.php?f=44)
-   -   Time in CPU States (https://talk.maemo.org/showthread.php?t=55096)

christye 2010-06-03 23:01

Time in CPU States
 
Hi guys,


Has anyone managed to get the: Time in CPU state scripts working from here:
http://wiki.maemo.org/Overclocking#A...ArbitRabbit.29

I find that they just give me syntax errors.

Any help would be very welcome =]

Been tinkering around with some power saving things, one of which were dbus scripts to underclock CPU whilst phone is locked, but I like to check that things are working, so the Time in CPU state would be useful. Unless anyone can think of another way I can check this?

Thanks all,
Chris

SpeedEvil 2010-06-04 02:34

Re: Time in CPU States
 
Quote:

Originally Posted by christye (Post 698616)
Hi guys,
<snip>

Been tinkering around with some power saving things, one of which were dbus scripts to underclock CPU whilst phone is locked, but I like to check that things are working, so the Time in CPU state would be useful. Unless anyone can think of another way I can check this?

Thanks all,
Chris

Powertop is good for this.
http://talk.maemo.org/showthread.php?p=491333

I can't be bothered reading other peoples scripts at this time of night.

while true ;do sleep 10;cat /sys/devices/system/cpu/cpu0/cpuidle/state*/time;done|awk 'BEGIN{print "C1\tC2\tC3\tC4"}NR%4==1&&NR>8{print l[0]-o[0]"\t"l[1]-o[1]"\t"l[2]-o[2]"\t"l[3]-o[3]}{k=(NR-1)%4;o[k]=l[k];l[k]=int($0/1000)}'

is a simple script to print states every 10s.
It outputs milliseconds in each state.
It stalls for twice the update period at the beginning, for the obvious reason.

christye 2010-06-06 16:09

Re: Time in CPU States
 
Quote:

Originally Posted by SpeedEvil (Post 698844)
Powertop is good for this.
http://talk.maemo.org/showthread.php?p=491333

I can't be bothered reading other peoples scripts at this time of night.

while true ;do sleep 10;cat /sys/devices/system/cpu/cpu0/cpuidle/state*/time;done|awk 'BEGIN{print "C1\tC2\tC3\tC4"}NR%4==1&&NR>8{print l[0]-o[0]"\t"l[1]-o[1]"\t"l[2]-o[2]"\t"l[3]-o[3]}{k=(NR-1)%4;o[k]=l[k];l[k]=int($0/1000)}'

is a simple script to print states every 10s.
It outputs milliseconds in each state.
It stalls for twice the update period at the beginning, for the obvious reason.


Of course powertop does this... I'm an idiot for not thinking of myself =p

Thanks for the reminder!

snap 2010-07-17 17:46

Re: Time in CPU States
 
Hi this is my first post, I've recently got myself a N900 and been playing around with it since then

I thought this would be the best thread to ask this...
What are the times in cpu states do people get with their phones idle?
Idle: I mean when it is not being used, an in lying there with screen off.

Here is mine using powertop

Code:

Sample interval was 30m 30s 21057us

C#      | Ratio  | Avg/dura | Frequency | Ratio
--------+--------+----------+-----------+--------+
    C0 |  98.4% |          |  600 MHz |  2.7% |
    C1 |  0.0% |    0.2ms |  550 MHz |  0.0% |
    C2 |  0.0% |    4.6ms |  500 MHz |  0.0% |
    C3 |  0.0% |  160.5ms |  250 MHz |  97.3% |
    C4 |  1.6% | 1150.0ms |

No matter what radios I turn off and what services I stop from event.d, i always get no more that 2% in C4 and always 0% in C1-C3. I still manage 1 and half days battery with moderate use of wifi
and no 3g used ever.

shadowjk 2010-07-18 17:34

Re: Time in CPU States
 
xchat (30+ channels) over wifi, a periodid (5s) script running, foreca weather widget. openvpn.

C0: 3.4%
600 MHz 23.9%
550 MHz 00.0%
500 MHz 03.8%
250 MHz 72.3%
C1: 0.1% 0.4ms
C2: 3.4% 7.4ms
C3: 18.3% 124.9ms
C4: 74.8% 1020.8ms


usbhost 100% OFF
sgx 100% OFF
per 91% OFF
dss 100% OFF
cam 100% OFF
core 74% OFF
neon: 74% OFF
mpu: 74% OFF
iva2: 100% OFF

AlMehdi 2010-07-18 20:42

Re: Time in CPU States
 
I guess my freqs are not showing cause my oc-kernel.

Code:

C#      | Ratio  | Avg/dura | Frequency | Ratio
--------+--------+----------+-----------+--------+
    C0 |  0.8% |          |  1150 MHz |  nan% |
    C1 |  0.0% |    0.2ms |
    C2 |  0.7% |    3.8ms |
    C3 |  7.8% |  213.2ms |
    C4 |  90.6% | 1943.3ms |

Code:

Total wakeups  452,  15.1/s | IRQ  328,  10.9/s | Timers  124,  4.1/s
HW wakeups      78,  2.6/s |    Real gp_timers expired  84,  2.8/s


snap 2010-07-19 07:55

Re: Time in CPU States
 
thanks guys for responding...

any suggestions on how i can get better than 2 % on C4?

looking at your posts, mine definetely looks Wrong!! :confused:

please help, do you think I need to reflash? i,d still like to find out the root cause.

snap 2010-07-19 15:24

Re: Time in CPU States
 
Ok i did a few more runs over SSH
And i just don't get it, whats up with C0 at 98.4% !!! :eek:

I am really curious now...


Top says 0.3% cpu

Code:

Mem: 240128K used, 5412K free, 0K shrd, 37892K buff, 57716K cached
CPU:  0.3% usr  2.3% sys  0.0% nice 97.0% idle  0.0% io  0.0% irq  0.1% softirq
Load average: 0.06 0.04 0.24
  PID  PPID USER    STAT  RSS %MEM %CPU COMMAND
 1704  1644 root    R      744  0.3  1.1 top
 1640  673 root    S    1984  0.8  0.9 sshd: root@pts/0   
  10    2 root    SW      0  0.0  0.7 [omap2_mcspi]
 1682  980 user    S    18996  7.7  0.0 /usr/bin/modest                                                           
 1539  1217 user    S    17404  7.0  0.0 /usr/sbin/browserd -s 1539 -n RTComMessagingServer
 1091  980 user    S    13804  5.6  0.0 /usr/bin/hildon-status-menu                                               
 1567  980 user    S    13356  5.4  0.0 /usr/bin/image-viewer                                                     
 1582  1217 user    S    11608  4.7  0.0 /usr/sbin/browserd -s 1582 -n browserui
 1101  980 user    S    11360  4.6  0.0 /usr/bin/hildon-desktop                                                   
 1573  980 user    S    11212  4.5  0.0 /usr/bin/Calendar                                                         
 1563  980 user    S    11176  4.5  0.0 /usr/bin/browser                                                         
  829  668 root    S <  10420  4.2  0.0 /usr/bin/Xorg -logfile /tmp/Xorg.0.log -logverbose 1 -nolisten tcp -noreset -s 0 -core
 1099  980 user    S    9676  3.9  0.0 /usr/bin/hildon-home                                                     
  668    1 root    S <  9552  3.8  0.0 /sbin/dsme -p /usr/lib/dsme/libstartup.so
  990  668 user    S    9464  3.8  0.0 /usr/bin/systemui
 1533  980 user    S    9308  3.7  0.0 /usr/bin/rtcom-messaging-ui                                               
 1524  980 user    S    8364  3.3  0.0 /usr/bin/osso-addressbook                                                 
 1528  980 user    S    8260  3.3  0.0 /usr/bin/rtcom-call-ui                                                   
 1094  980 user    S    7948  3.2  0.0 /usr/bin/camera-ui                                                       
 1601    1 user    S    7596  3.0  0.0 /usr/sbin/as-daemon -D
  752    1 root    S    6904  2.8  0.0 /usr/sbin/ohmd --no-daemon
 1174    1 user    S    6680  2.7  0.0 /usr/bin/intellisyncd -u 29999
 1120    1 user    S    5584  2.2  0.0 /usr/lib/evolution-data-server/e-addressbook-factory
 1134    1 user    S    5384  2.1  0.0 /usr/lib/tracker/trackerd
 1172  1148 user    S    5340  2.1  0.0 /opt/BatteryGraph/bin/BatteryGraphd
 1139  980 user    S    4780  1.9  0.0 /usr/bin/osso-connectivity-ui-conndlgs                                   
 1138  668 user    S    4612  1.8  0.0 /usr/bin/hildon-input-method
 1217  668 user    S    4528  1.8  0.0 /usr/sbin/browserd -d
  760    1 pulse    S <  4036  1.6  0.0 /usr/bin/pulseaudio --system --high-priority

Code:

C#      | Ratio  | Avg/dura | Frequency | Ratio
--------+--------+----------+-----------+--------+
    C0 |  98.4% |          |  600 MHz |  1.1% |
    C1 |  0.0% |    1.0ms |  550 MHz |  0.0% |
    C2 |  0.2% |  16.6ms |  500 MHz |  7.8% |
    C3 |  0.4% |  146.5ms |  250 MHz |  91.0% |
    C4 |  1.0% |  763.3ms |

Code:

IRQ#    | Activity  | Type          | Name
--------+------------+----------------+---------------------------
    12 |        262 |          INTC | DMA
    56 |        125 |          INTC | i2c_omap
    37 |        82 |          INTC | gp
    11 |        67 |          INTC | prcm
    57 |        23 |          INTC | i2c_omap
    202 |        15 |          GPIO | wl1251
    67 |          6 |          INTC | ssi_p1_mpu_irq0
    311 |          4 |          GPIO | ssi_p1_cawake_gpio
    71 |          2 |          INTC | ssi_gdd

Code:

Power domain activity breakdown
Domain  | % of time spent in states
--------+---------+---------+---------+---------+----------
usbhost |OFF: 100%|RET:  0%|INA:  0%| ON:  0%| now:(OFF)
    sgx |OFF: 100%|RET:  0%|INA:  0%| ON:  0%| now:(OFF)
    per |OFF:  98%|RET:  0%|INA:  0%| ON:  0%| now:(ON)
    dss |OFF: 100%|RET:  0%|INA:  0%| ON:  0%| now:(OFF)
    cam |OFF: 100%|RET:  0%|INA:  0%| ON:  0%| now:(OFF)
  core |OFF:  91%|RET:  7%|INA:  0%| ON:  0%| now:(ON)
  neon |OFF:  91%|RET:  7%|INA:  0%| ON:  0%| now:(ON)
    mpu |OFF:  91%|RET:  7%|INA:  0%| ON:  0%| now:(ON)
  iva2 |OFF: 100%|RET:  0%|INA:  0%| ON:  0%| now:(OFF)

Code:

Total wakeups  729,  24.3/s | IRQ  586,  19.5/s | Timers  143,  4.8/s
HW wakeups      67,  2.2/s |    Real gp_timers expired  82,  2.7/s


shadowjk 2010-07-20 13:00

Re: Time in CPU States
 
Well that seems odd. 1% C4, but 91% OFF?

snap 2010-07-20 16:30

Re: Time in CPU States
 
yeah, and there is nothing there in 'top' as well, either something prevents the cpu from sleeping or my powertop binary is broken! My limited knowledge cannot give me another reason :(


All times are GMT. The time now is 08:51.

vBulletin® Version 3.8.8