5,604,122 Members 48,188 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
amossam
Old
(Last edited by amossam; 6th March 2011 at 12:30 PM.)
#1  
Senior Member - OP
Thanks Meter 26
Posts: 166
Join Date: Oct 2009
Lightbulb [APP] CPUStats - simple cpu statistics (updated 06.03.2011)

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!

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!!
- 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!
- 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 , 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
- 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
Click image for larger version

Name:	snap20101219_144256.jpg
Views:	4826
Size:	32.7 KB
ID:	468181

v0.02:
Click image for larger version

Name:	snap20101218_172050.jpg
Views:	851
Size:	30.8 KB
ID:	467519

v0.01:
Click image for larger version

Name:	snap20101217_203203.jpg
Views:	900
Size:	26.9 KB
ID:	466862

P.S.: file without version name is old one, 0.01!!
Attached Files
File Type: apk CPUStats-0.02.apk - [Click for QR Code] (27.2 KB, 134 views)
File Type: apk CPUStats-0.03.apk - [Click for QR Code] (27.0 KB, 91 views)
File Type: apk CPUStats-0.04.apk - [Click for QR Code] (26.9 KB, 240 views)
File Type: apk CPUStats-0.05.apk - [Click for QR Code] (28.6 KB, 523 views)
File Type: apk CPUStats-0.1.apk - [Click for QR Code] (35.7 KB, 12032 views)
The Following 11 Users Say Thank You to amossam For This Useful Post: [ Click to Expand ]
 
p0les
Old
#2  
Junior Member
Thanks Meter 0
Posts: 21
Join Date: Jul 2010
Nice! Will try it out.
 
geevee11
Old
#3  
geevee11's Avatar
Senior Member
Thanks Meter 21
Posts: 134
Join Date: Oct 2010
Location: Antipolo
this is such a nice and simple app. i love it! thank you amossam!
 
zencooler
Old
#4  
Senior Member
Thanks Meter 81
Posts: 242
Join Date: Jul 2008
Quote:
Originally Posted by amossam View Post
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!

Screenshot:

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!
 
bloodhawk
Old
#5  
bloodhawk's Avatar
Senior Member
Thanks Meter 41
Posts: 619
Join Date: Mar 2010
Location: San Francisco Bay Area
It isnt working with the Smartass governor on Cronos 1.7.0
 
amossam
Old
#6  
Senior Member - OP
Thanks Meter 26
Posts: 166
Join Date: Oct 2009
Quote:
Originally Posted by bloodhawk View Post
It isnt working with the Smartass governor on Cronos 1.7.0
it doesn't matter what governor is active, just checked!

can you post result of shell commands in OP ?

thx
 
Skkip
Old
#7  
Senior Member
Thanks Meter 183
Posts: 227
Join Date: Sep 2006
Location: 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
Old
#8  
Senior Member - OP
Thanks Meter 26
Posts: 166
Join Date: Oct 2009
Quote:
Originally Posted by Skkip View Post
@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
Old
#9  
bloodhawk's Avatar
Senior Member
Thanks Meter 41
Posts: 619
Join Date: Mar 2010
Location: San Francisco Bay Area
Quote:
Originally Posted by amossam View Post
it doesn't matter what governor is active, just checked!

can you post result of shell commands in OP ?

thx
My bad. something was wrong with my ROM.

Now it is working. After i installed the latest version of MIUI
 
amossam
Old
#10  
Senior Member - OP
Thanks Meter 26
Posts: 166
Join Date: Oct 2009
Quote:
Originally Posted by bloodhawk View Post
My bad. something was wrong with my ROM.

Now it is working. After i installed the latest version of MIUI
Great!
can you please tell what version od MIUI you have, so I can put it in OP?

thx

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...