Enable the Hidden Notification LED on the Google Nexus 6!

LED notification lights have existed on Android devices since the very beginnings … more

MX Player Ready to Rock on Lollipop

A good video player should be reliable and free. One of the XDA Community Apps, MX Player, meets both of … more

How to Disable Data Encryption on Nexus 6

In late September, Google decided to step on NSA’s toes and turn on encryption by default in … more

DJI Phantom 2 Vision+ Review – XDA TV

The holidays will be here in no time, so why not start thinking about gifts now? Youll be ahead … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP amossam

17th December 2010, 12:44 PM   |  #1  
OP Senior Member
Thanks Meter: 26
 
166 posts
Join Date:Joined: Oct 2009
More
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:	4952
Size:	32.7 KB
ID:	468181

v0.02:
Click image for larger version

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

v0.01:
Click image for larger version

Name:	snap20101217_203203.jpg
Views:	915
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, 526 views)
File Type: apk CPUStats-0.1.apk - [Click for QR Code] (35.7 KB, 12115 views)
Last edited by amossam; 6th March 2011 at 01:30 PM.
The Following 11 Users Say Thank You to amossam For This Useful Post: [ View ]
17th December 2010, 01:07 PM   |  #2  
Junior Member
Thanks Meter: 0
 
21 posts
Join Date:Joined: Jul 2010
Nice! Will try it out.
17th December 2010, 04:25 PM   |  #3  
geevee11's Avatar
Senior Member
Flag Antipolo
Thanks Meter: 21
 
134 posts
Join Date:Joined: Oct 2010
More
this is such a nice and simple app. i love it! thank you amossam!
17th December 2010, 06:38 PM   |  #4  
Senior Member
Thanks Meter: 81
 
242 posts
Join Date:Joined: Jul 2008
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, 07:49 PM   |  #5  
bloodhawk's Avatar
Senior Member
Flag San Francisco Bay Area
Thanks Meter: 52
 
690 posts
Join Date:Joined: Mar 2010
More
It isnt working with the Smartass governor on Cronos 1.7.0
17th December 2010, 08:42 PM   |  #6  
OP Senior Member
Thanks Meter: 26
 
166 posts
Join Date:Joined: Oct 2009
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, 01:10 PM   |  #7  
Senior Member
Flag Paderborn
Thanks Meter: 183
 
227 posts
Join Date:Joined: Sep 2006
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, 01:22 PM   |  #8  
OP Senior Member
Thanks Meter: 26
 
166 posts
Join Date:Joined: Oct 2009
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, 04:38 PM   |  #9  
bloodhawk's Avatar
Senior Member
Flag San Francisco Bay Area
Thanks Meter: 52
 
690 posts
Join Date:Joined: Mar 2010
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, 05:01 PM   |  #10  
OP Senior Member
Thanks Meter: 26
 
166 posts
Join Date:Joined: Oct 2009
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

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

Advanced Search
Display Modes