[APP] CPUStats - simple cpu statistics (updated 06.03.2011)

Search This thread

amossam

Senior Member
Oct 23, 2009
171
24
If I'm not mistaken, it should be in /system/lib/modules and it should be loaded with insmod in 10overclock file, but after defining frequencies!

Sent from my Milestone
 

amossam

Senior Member
Oct 23, 2009
171
24
You don't have cpufreq_stats.ko in /system/lib/modules ??

What rom are you using?

Sent from my Milestone
 

amossam

Senior Member
Oct 23, 2009
171
24
Sorry guys, but I'm not at home, so I can't check roms content, but can you post result of following commands in terminal?
Code:
# ls -al /system/lib/modules
# cat /etc/init.d/10overclock

Place where I'm now doesn't have 3g, barely I have edge! :/ so probaly it will take some time to respond!

Sent from my Milestone
 

kryer12

Member
Apr 21, 2010
33
1
Beaverton
I dont have the module either and am looking to download it to use your app. Is there a way to have the module included with app so installs together?
Running stock 2.1.1 on Rooted Samsung Vibrant.
 

amossam

Senior Member
Oct 23, 2009
171
24
I dont have the module either and am looking to download it to use your app. Is there a way to have the module included with app so installs together?
Running stock 2.1.1 on Rooted Samsung Vibrant.

Maybe, I'm not shure. But, stats collecting starts from the moment the module is loaded... I'll check what can be done...

Btw, I'm not shure will it be posible to use this app on your devices... do you have all or at least some of files listed in OP)


Sent from my Milestone
 

j00e

Senior Member
Jul 15, 2008
51
0
Moscow
Here my
Code:
# find /sys/devices/system/cpu/

# lsmod

Code:
#find /sys/devices/system/cpu/
/sys/devices/system/cpu/
/sys/devices/system/cpu/online
/sys/devices/system/cpu/possible
/sys/devices/system/cpu/present
/sys/devices/system/cpu/kernel_max
/sys/devices/system/cpu/offline
/sys/devices/system/cpu/cpufreq
/sys/devices/system/cpu/cpu0
/sys/devices/system/cpu/cpu0/cpufreq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/affected_cpus
/sys/devices/system/cpu/cpu0/cpufreq/related_cpus
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
/sys/devices/system/cpu/cpu0/cpufreq/vdd_levels
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/smartass
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/down_rate_us: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/up_min_freq: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_max_freq: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/sample_rate_jiffies: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_up_step: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_ramp_down: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/smartass/min_cpu_load: Permission denied
/sys/devices/system/cpu/cpu0/cpufreq/stats
find: /sys/devices/system/cpu/cpu0/cpufreq/stats/total_trans: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state: Permission denied
find: /sys/devices/system/cpu/cpu0/cpufreq/stats/trans_table: Permission denied
#lsmod
bcm4329 178144 0 - Live 0xbf000000

No module in module folder.

Running 0.4 version on Htc Desire with LeeDroid 2.3b
Very want this app at my device.
 

kalex12

Senior Member
Nov 6, 2010
53
1
Moscow
I cant open app 03 & 04 :"Error! You are missing cpufreq_stats module!". Older ver worked. How I can solve this problem?
Captivate Froyo I897UCJI6.
 

amossam

Senior Member
Oct 23, 2009
171
24
I cant open app 03 & 04 :"Error! You are missing cpufreq_stats module!". Older ver worked. How I can solve this problem?
Captivate Froyo I897UCJI6.

Hmm, strange. You are saying that older versions worked on same system?? Without any change? Did they displayed time in state data? And if you run lsmod in terminal do you see cpufreq_stats module in list?


Sent from my Milestone
 

kalex12

Senior Member
Nov 6, 2010
53
1
Moscow
Yes, any changes. I installed 04ver = error. A few minutes later 03ver=the same results. Then 02ver = it works. Then 01ver = it works. Then 04 = not work.
I ran lsmod in terminal. Cpufreq_stat absent in list. What is it means?
 

amossam

Senior Member
Oct 23, 2009
171
24
Yes, any changes. I installed 04ver = error. A few minutes later 03ver=the same results. Then 02ver = it works. Then 01ver = it works. Then 04 = not work.
I ran lsmod in terminal. Cpufreq_stat absent in list. What is it means?

That means that it shouldn display correct statistics!! That module counts freq transitions and time in states...

Sent from my Milestone
 

bonanza123

Senior Member
Nov 11, 2007
206
35
'schland
Hey,

im getting FC's on my Milestone with current CM6 beta with smartass running...

here my files:
Code:
$find /sys/devices/system/cpu/
/sys/devices/system/cpu/
/sys/devices/system/cpu/online
/sys/devices/system/cpu/possible
/sys/devices/system/cpu/present
/sys/devices/system/cpu/kernel_max
/sys/devices/system/cpu/offline
/sys/devices/system/cpu/cpufreq
/sys/devices/system/cpu/cpuidle
/sys/devices/system/cpu/cpuidle/current_driver
/sys/devices/system/cpu/cpuidle/current_governor_ro
/sys/devices/system/cpu/cpu0
/sys/devices/system/cpu/cpu0/cpuidle
/sys/devices/system/cpu/cpu0/cpuidle/state0
/sys/devices/system/cpu/cpu0/cpuidle/state0/name
/sys/devices/system/cpu/cpu0/cpuidle/state0/desc
/sys/devices/system/cpu/cpu0/cpuidle/state0/latency
/sys/devices/system/cpu/cpu0/cpuidle/state0/power
/sys/devices/system/cpu/cpu0/cpuidle/state0/usage
/sys/devices/system/cpu/cpu0/cpuidle/state0/time
/sys/devices/system/cpu/cpu0/cpuidle/state1
/sys/devices/system/cpu/cpu0/cpuidle/state1/name
/sys/devices/system/cpu/cpu0/cpuidle/state1/desc
/sys/devices/system/cpu/cpu0/cpuidle/state1/latency
/sys/devices/system/cpu/cpu0/cpuidle/state1/power
/sys/devices/system/cpu/cpu0/cpuidle/state1/usage
/sys/devices/system/cpu/cpu0/cpuidle/state1/time
/sys/devices/system/cpu/cpu0/cpuidle/state2
/sys/devices/system/cpu/cpu0/cpuidle/state2/name
/sys/devices/system/cpu/cpu0/cpuidle/state2/desc
/sys/devices/system/cpu/cpu0/cpuidle/state2/latency
/sys/devices/system/cpu/cpu0/cpuidle/state2/power
/sys/devices/system/cpu/cpu0/cpuidle/state2/usage
/sys/devices/system/cpu/cpu0/cpuidle/state2/time
/sys/devices/system/cpu/cpu0/cpuidle/state3
/sys/devices/system/cpu/cpu0/cpuidle/state3/name
/sys/devices/system/cpu/cpu0/cpuidle/state3/desc
/sys/devices/system/cpu/cpu0/cpuidle/state3/latency
/sys/devices/system/cpu/cpu0/cpuidle/state3/power
/sys/devices/system/cpu/cpu0/cpuidle/state3/usage
/sys/devices/system/cpu/cpu0/cpuidle/state3/time
/sys/devices/system/cpu/cpu0/cpufreq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_transition_latency
/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/affected_cpus
/sys/devices/system/cpu/cpu0/cpufreq/related_cpus
/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
/sys/devices/system/cpu/cpu0/cpufreq/scaling_driver
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed
/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
/sys/devices/system/cpu/cpu0/cpufreq/smartass
/sys/devices/system/cpu/cpu0/cpufreq/smartass/down_rate_us
/sys/devices/system/cpu/cpu0/cpufreq/smartass/up_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_max_freq
/sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_wakeup_freq
/sys/devices/system/cpu/cpu0/cpufreq/smartass/awake_min_freq
/sys/devices/system/cpu/cpu0/cpufreq/smartass/sample_rate_jiffies
/sys/devices/system/cpu/cpu0/cpufreq/smartass/ramp_up_step
/sys/devices/system/cpu/cpu0/cpufreq/smartass/max_ramp_down
/sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load
/sys/devices/system/cpu/cpu0/cpufreq/smartass/min_cpu_load
/sys/devices/system/cpu/cpu0/cpufreq/stats
/sys/devices/system/cpu/cpu0/cpufreq/stats/total_trans
/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
$ lsmod
tiwlan_drv 859446 0 - Live 0xbf04b000
cpufreq_conservative 4635 0 - Live 0xbf044000
cpufreq_smartass 5055 1 - Live 0xbf03d000
cpufreq_interactive 2081 0 - Live 0xbf037000
cpufreq_stats 1945 0 - Live 0xbf031000
overclock 3819 0 - Live 0xbf02b000
symsearch 673 3 cpufreq_smartass,cpufreq_interactive,overclock,[permanent], Live 0xbf025000
sec 3169 0 - Live 0xbf01f000
modem_pm_driver 1524 2 - Live 0xbf019000
netmux_linkdriver 7724 0 [permanent], Live 0xbf012000
netmux 48208 19 netmux_linkdriver, Live 0xbf000000

and my 10overclock file:
Code:
#!/system/bin/sh
insmod /system/lib/modules/symsearch.ko
insmod /system/lib/modules/overclock.ko

echo 56 > /proc/overclock/max_vsel
echo 900000 > /proc/overclock/max_rate

#echo "5 900000000 60" > /proc/overclock/mpu_opps
 echo "4 700000000 49" > /proc/overclock/mpu_opps
 echo "3 500000000 44" > /proc/overclock/mpu_opps
 echo "2 250000000 33" > /proc/overclock/mpu_opps
#echo "1 125000000 32" > /proc/overclock/mpu_opps

#echo "0 900000" > /proc/overclock/freq_table
 echo "1 700000" > /proc/overclock/freq_table
 echo "2 500000" > /proc/overclock/freq_table
 echo "3 250000" > /proc/overclock/freq_table

insmod /system/lib/modules/cpufreq_stats.ko

insmod /system/lib/modules/cpufreq_interactive.ko
insmod /system/lib/modules/cpufreq_smartass.ko
insmod /system/lib/modules/cpufreq_conservative.ko

echo smartass > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor

#echo conservative > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#echo 125000 > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate
#echo 25 > /sys/devices/system/cpu/cpu0/cpufreq/conservative/freq_step

when I was using SetCPU and switched to interactive it worked fine...

thanks for your help in advance!
 

amossam

Senior Member
Oct 23, 2009
171
24
Good morning everyone!
I'll check all the issues today, cause I'm not at home and my internet access is verry limited, only edge!! :(

And I think i'll have to create diagnostic app!! :D

Sent from my Milestone
 

Top Liked Posts

  • There are no posts matching your filters.
  • 10
    This is simple app that I created to show some info about CPU frequencies and governor.

    It's still in development state, but it has what I need to show how CPU governor is doing it's work! It refreshes every 2 seconds.

    I tested it on CM 6.1, but it should work on others.
    You need to have cpufreq_stats module loaded to get some statistics, and it needs root permission.

    Also please note, that cpufreq_stats should be loaded after defining frequencies and setting active governor, otherwise it may collect not so correct data!!

    In 0.1 version I added cpufreq_stats.ko binary, so if your ROM doesn't have it, you can TRY to install it. But before you try it, NANDROID YOUR SYSTEM! This modifies 10overclock file, and if something goes wrong, you may end up in boot loop!!!!

    If something is missing, or FC, please post output of this commands:
    Code:
    # find /sys/devices/system/cpu/
    
    # lsmod
    and what ROM/device are you using.


    Any comments and suggestions are welcome!!

    I hope you'll find it usefull! :D

    Compatibility list:
    - CyanogenMod 6.1
    - MIUI 12-17
    - HO!NO!
    - Cronos 1.7
    - TheFroyoMOD 2.1.2

    Module tested on:
    - CyanogenMOD 7 RC0
    - The FroyoMOD 2.5
    - Leaked APAC rom

    This should work on any rooted rom and any device; please report back your findings, with exact version or rom and device. If you have any other device with rooted ROM, try it if you like it and report back your findings...

    Change log:
    06.03.2011, 13:25, v0.1
    - Changed startup screen, and now you can even disable it!! :D
    - Changed logic that interacts with system, so it should have faster startup and less CPU usage. Because of this, it will ask root permission again!
    - Included cpufreq_stats.ko module, for witch I hope is generic, and it should work on any 2.2 and newer rom. I didn't tested it on 2.1!!!!!

    02.01.2011, 09:13, v0.05
    - changed reading logic, too small change for new version. If previous 0.05 is working for you, you don't need to redownload!

    01.01.2011, 17:15, v0.05
    - Additional error checking, hopefully all FC's are prevented
    - If module cpufreq_stats is not loaded, it will display warning but it will continue to work. So if you have custom build kernel with compiled in cpufreq_stats, it should work!
    - Added welcome dialog
    - Added system report generator. This will collect data about your phone that I think is needed to detect where the problem is, or to support new devices. This file will be saved to "/sdcard/CPUStats_sysprofile.txt". Please check file content and if you don't like some data inside remove it, and please report what have you removed. And if you agree, send me that file in PM or attach to this thread (I would prefer PM!).
    - If some data cannot be read, it will display values -1 or 0. Usually that means that you don't have cpufreq_stats module, or you are running other device than Motorola Milestone!.
    - Happy New year!!!!

    22.12.2010, 19:40, v0.04
    - OK, thanks to great hint from coolbho3000, finally current frequency works as it should!!! and app starts much faster! :cool: :eek: :D
    - Refresh time reduced to 1 sec!
    - On startup, app will change permission of files that needs to be read to "read to all" (a+r). I don't see that as security issue (in fact only one file doesn't have right permissions, but i decided to check all files), but if you do this that this is security issue, then DON'T INSTALL OR RUN 0.04 version!!!!!
    - These files are checked and their permissions are modified as needed:
    Code:
        /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq
        /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
        /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq
        /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
        /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq
        /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
        /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
        /sys/devices/system/cpu/cpu0/cpufreq/stats/total_trans
        /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
        /proc/overclock/mpu_opps


    19.12.2010, 15:00, v0.03
    - All frequencies are listed, no matter did they been used or not.
    - Checks is cpufreq_stats module is loaded, and exists app if not
    - removed few loops from code, only one left, lower CPU usage :cool:, and possibly prevented some of FC if files are missing...

    18.12.2010, 17:30, v0.02
    - Added percentages to display
    - Calculating deepsleep time
    - NEEDS ROOT, because only root can get current cpu frequency, it will ask you 2 or 3 times, and you will probably want to check remember because of loop...
    (although it doesn't work too effectively, so you will probably get max speed)

    17.12.2010, 20:35, ver 0.01
    - Added vsel values to display
    - Small adjustments to UI
    - Added version :cool:
    - Not working: current cpu freq!? (if someone is willing to help PM me)
    - Changed refresh rate to 2 sec


    TODO:
    - check are required modules loaded
    - ability to change refresh rate (not needed??)
    - better use of superuser (anyone willing to help??!) (maybe done...)


    Screenshot:
    v0.03 & v0.04
    snap20101219_144256.jpg

    v0.02:
    snap20101218_172050.jpg

    v0.01:
    snap20101217_203203.jpg

    P.S.: file without version name is old one, 0.01!!
    1

    Now I'm confused! Ill check what can be problem this afternoon, cause I left my home....

    Sent from my Milestone