FORUMS

Sunday Debate: How Can We Get a No-Compromise Phone?

Join us in a fun Sunday Debate on Compromises. Come with your opinions and … more

PSA: You Can Optimize Your Note 4’s Recents Menu & RAM

The Note 4 never had the fastest Recents Menu, and despite its 3GB of RAM, … more

XDA Picks: Best Apps of the Week (July 25 – Aug 1)

Apps are at the front and center of any smartphone experience, and with over a … more

Voices Of XDA: Orbiting The Earth With Android

Editor’s note: This week’s feature has been written by forum … more

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

166 posts
Thanks Meter: 26
 
By amossam, Senior Member on 17th December 2010, 11:44 AM
Post Reply Subscribe to Thread Email Thread
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:	5220
Size:	32.7 KB
ID:	468181

v0.02:
Click image for larger version

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

v0.01:
Click image for larger version

Name:	snap20101217_203203.jpg
Views:	945
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, 135 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, 528 views)
File Type: apk CPUStats-0.1.apk - [Click for QR Code] (35.7 KB, 12189 views)
Last edited by amossam; 6th March 2011 at 12:30 PM.
The Following 11 Users Say Thank You to amossam For This Useful Post: [ View ]
 
 
17th December 2010, 12:07 PM |#2  
Junior Member
Thanks Meter: 0
 
More
Nice! Will try it out.
17th December 2010, 03:25 PM |#3  
geevee11's Avatar
Senior Member
Flag Antipolo
Thanks Meter: 21
 
More
this is such a nice and simple app. i love it! thank you amossam!
17th December 2010, 05:38 PM |#4  
Senior Member
Thanks Meter: 83
 
More
Quote:
Originally Posted by amossam

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!
17th December 2010, 06:49 PM |#5  
bloodhawk's Avatar
Senior Member
Flag San Francisco Bay Area
Thanks Meter: 53
 
More
It isnt working with the Smartass governor on Cronos 1.7.0
17th December 2010, 07:42 PM |#6  
OP Senior Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by bloodhawk

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
18th December 2010, 12:10 PM |#7  
Senior Member
Flag Paderborn
Thanks Meter: 183
 
More
@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
18th December 2010, 12:22 PM |#8  
OP Senior Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by Skkip

@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...
18th December 2010, 03:38 PM |#9  
bloodhawk's Avatar
Senior Member
Flag San Francisco Bay Area
Thanks Meter: 53
 
More
Quote:
Originally Posted by amossam

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
18th December 2010, 04:01 PM |#10  
OP Senior Member
Thanks Meter: 26
 
More
Quote:
Originally Posted by bloodhawk

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
18th December 2010, 04:45 PM |#11  
bloodhawk's Avatar
Senior Member
Flag San Francisco Bay Area
Thanks Meter: 53
 
More
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 :

Quote:

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 by bloodhawk; 18th December 2010 at 04:49 PM.

Read More
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes