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

Search This thread

amossam

Senior Member
Oct 23, 2009
171
24
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!!
 

Attachments

  • CPUStats-0.02.apk
    27.2 KB · Views: 141
  • CPUStats-0.03.apk
    27 KB · Views: 92
  • CPUStats-0.04.apk
    26.9 KB · Views: 241
  • CPUStats-0.05.apk
    28.6 KB · Views: 547
  • CPUStats-0.1.apk
    35.7 KB · Views: 12,441
Last edited:

zencooler

Senior Member
Jul 9, 2008
787
247
Xiaomi Mi 11 Ultra
This is simple app that I created to show some info about CPU frequencies and governor.

It's still in very early state, but it has what I need to monitor CPU governor! It refreshes every 1 second.

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 doesn't need root permission!

(...)

Any comments and suggestions are welcome!!

I hope you'll find it usefull! :D

Screenshot:

View attachment 466611

P.S. Mods; if I posted this in wrong section, please move it to the right one! Thx!

Hi Amossam again :)
And once again: it's great app! Congrats!
One more sugestion: please add the version numbering (or date of app update) as I know you are working on some changes and will be nice to know am I using the current one ;-)

Hope you are working to add vsel setting to stats.

Regards and thanks again!
 

Skkip

Senior Member
Sep 4, 2006
228
183
Paderborn
@amossam:

Would it be possible for you to show the percentage of time in state?
Like:
1000Mhz 20%
500Mhz 20%
250Mhz 60%

Then there are just to things left I miss :) A shortcut to the app which shows you the time in sleepmode (don't know its name) and a shortcut to battery-consumption overview :)

Thx in advance
 

amossam

Senior Member
Oct 23, 2009
171
24
@amossam:

Would it be possible for you to show the percentage of time in state?
Like:
1000Mhz 20%
500Mhz 20%
250Mhz 60%

Then there are just to things left I miss :) A shortcut to the app which shows you the time in sleepmode (don't know its name) and a shortcut to battery-consumption overview :)

Thx in advance

Hey! thx for suggestions...

Time in sleep mode? That is diference between "Total system uptime" and "Uptime". If that, I can add it to display. Or do you mean on SpareParts?

And battery-consumption overview from SpareParts? Well, i can only do shortcut to SpareParts because it has only MainActivity exposed...

Will do, probably this afternoon...
 

bloodhawk

Senior Member
Mar 12, 2010
841
57
San Francisco Bay Area
OK ...im on the 12-17 build.

Also the app is FC'ing when using the Smartass governor. For other governors it is working just fine.

Shell output :

tiwlan_drv 859446 0 - Live 0xbf04f000
cpufreq_conservative 4635 0 - Live 0xbf048000
cpufreq_smartass 5055 0 - Live 0xbf041000
cpufreq_interactive 2081 1 - Live 0xbf03b000
cpufreq_stats 1945 0 - Live 0xbf035000
overclock 3819 0 - Live 0xbf02f000
symsearch 673 3 cpufreq_smartass,cpufreq_interactive,overclock,[permanent], Live 0xbf029000
sec 3712 0 - Live 0xbf023000
modem_pm_driver 1764 2 - Live 0xbf01d000
netmux_linkdriver 8302 0 [permanent], Live 0xbf015000
netmux 52159 19 netmux_linkdriver, Live 0xbf000000
 
Last edited:

amossam

Senior Member
Oct 23, 2009
171
24
OK ...im on the 12-17 build.

Also the app is FC'ing when using the Smartass governor. For other governors it is working just fine.

hmm, strange. did u installed v0.02?
i just uploaded it and changed few things related to data fetch.
on my cm i changed to smartass, rebooted and it's working without problem...

Sent from my Milestone
 
Apr 3, 2010
25
0
i just tried the latest version and it force closes after asking for super user perm. i tried 3 times and it FC'd each time. im running cronos 1.6.1 on a milestone.
 

S7oneCu77er

Member
Oct 12, 2010
5
0
Running CM6.1 12.12.10 Motorola Milestone.
Overclocked @ 1000MHz, 56Vsel with consercative governor.

Getting FC after starting the app, tried 3 times, same result.
 

S7oneCu77er

Member
Oct 12, 2010
5
0
can you please send me relevant part of logcat?!??

thx

Sent from my Milestone

there ya go:

Code:
cpufreq_interactive 2081 0 - Live 0xbf038000
cpufreq_conservative 4635 1 - Live 0xbf031000
overclock 3819 0 - Live 0xbf02b000
symsearch 673 2 cpufreq_interactive,overclock,[permanent], Live 0xbf025000
sec 3169 0 - Live 0xbf01f000
modem_pm_driver 1524 2 - Live 0xbf019000
netmux_linkdriver 7724 0 [permanent], Live 0xbf025000
netmux 48208 19 netmux_linkdriver, Live 0xbf000000
 

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