yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] CMDeWalt:
Works wonderfully, and is pretty accurate according to other apps. Thanks a lot!

(5/5 on the market (; )
[Android Apps and Games] twerg:
This is great to check if phone is entering Deep Sleep, would be great if it could also show battery usage, time since recharge etc. Battery drain and CPU time/speed are fairly related I feel for such an app.

Nice.
[Android Apps and Games] $omator:
very good question, author? i do not see deep sleep here time_in_state
[Android Apps and Games] brandall:
About to download, will find this very useful thank you!

Suggestions for future releases (if possible):

1) The same information for the voltage scaling.

2) How long the device spends using which governor.

The above would tell me all I needed to know when switching between governors and frequencies in different phone 'states'.
[Android Apps and Games] Darcia:
Hi! =)

A good app' for check CPU behaviour!

- Maybe a litle widget that show the actual CPU frequency could be good if it don't drain the battery too much?

- Maybe could add the posibility to save an historique for compare CPU behaviour with battery draining, etc. ?

- And finally, add a graphique, show CPU frequence on time could be good?

Three litle ideas for improve this app'. ^^

Keep the good works and thanks for it =D
[Android Apps and Games] paracutin:
Any chance of getting a version that runs on the Viewsonic Gtab?
[Android Apps and Games] hasei:
It freezes on my Motorola Backflip (MB300). I don't know if it helps but a logcat is attached.

I have other devices and it works fine on them. Thank you very much for the useful app!
[Android Apps and Games] brentil:
Still black screens now that I rooted my LG G2x. :(
[Android Apps and Games] KAsp3rd:
Noticed that on the LG G2x it doesn't have the specified file in which CPUSpy reads from "time_in_state" OP anything we can submit to allow this for better use on dualcore phones?
[Android Apps and Games] comnam90:
App works flawlessly on my SGS2! :D

Would be cool if it said 0 days 6 hours 23 mins instead of 0:06:23 for time in state statistics
[Android Apps and Games] mermis:
Good app, thanx
[Android Apps and Games] storm717:
Hey guys, going out of town tomorrow for the week, but will re-visiting this app when I get back to patch up some of the bugs and maybe implement some of the low-hanging fruit features people have mentioned,

PLEASE

post issues here:

https://github.com/storm717/cpuspy/issues

So I can quickly and easily address them. Thanks!
[Android Apps and Games] sherpa25:
Thanks for this. One issue I have (using Talon 0.4.4.22 and Simplicity 0.33), the green bars sometimes don't show up, just plain black/grey bars. At times they appear though... intermittent.
[Android Apps and Games] DirkStorck:
Hi...I am using MIUI 1.9.23. With the new version they have replaced the kernel "Atroy Kernel 2.6.35.13" with "Atroy Kernel 2.6.37.6". Now I dont get any CPU states at all...:(
[Android Apps and Games] burnout:
Hi,

doesn't work on optimus 2x...

any fix or update possible ??
[Android Apps and Games] tboooe:
Deep Sleep - Unused CPU state?

I am using this on my AT&T Samsung Galazy s2, rooted. It shows that Deep Sleep is an unused CPU state. Does that mean my phone never enters Deep Sleep? The graphs show that my phone spends 80% of its time at 200mhz which I thought was Deep Sleep?

Thank you in advance for the help.
[Android Apps and Games] gembo:
Works good thx
[Android Apps and Games] akkord64:
I love it.
[Android Apps and Games] dcvt16:
im running an epic, srf 1.2 rom and genocide 2.0 kernal. oc set to 1200mhz, the graph only shows up to 1000mhz, even after several bench mark tests and game played. is my phone just not getting to 1200mhz, or is it something to do wit the app?

edit: changed setting in "voltage control" to interactive, now im seein the higher values being used.
[Android Apps and Games] window7:
Very useful! Thanks :D
[Android Apps and Games] carrige:
Hey, I was wondering if you could make CPUSpy available on the Malta (EU) market? I can't find it on the Android marketplace on my Transformer (unrooted), and when I click through to your Marketplace listing I'm told it's not available in my country!

Thanks :)
[Android Apps and Games] trsix:
shift

just what i was looking for but no state found on my shift :(

using cm7
[Android Apps and Games] Mateusz Baclawski:
This is incredibly useful, thanks!
[Android Apps and Games] @LI™:
I cant dl it from market plz attach it here !!!!!
[Android Apps and Games] audenprim:
Love it! Does exactly as described, and give me the features i was looking for. Keep up the good work :)
[Android Apps and Games] a4e5h:
doesnt work on HTC Sesation Revolution HD 3.6.2 with Kernel 2.6.35.14

i also tried with root :-(
[Android Apps and Games] android_888:
What is the meaning of - in this app? For example I have in 100 MHz -125% value. What does that mean?
[Android Apps and Games] brentil:
Newest version still fails to load on G2x.
[Android Apps and Games] rkuijpers:
Loads fine on my Desire, 0.3.1.
[Android Apps and Games] hawkerpaul:
Extremely useful app. Its good to know what frequencies are being most used for possible tweaking. Deep sleep is especially reassuring.

Any chance of getting this app to report on both CPU's in dual core devices?
[Android Apps and Games] h0und:
This directory doesnt exist on a Sensation with revolution HD rom.

The app only shows a black screen with white text: CPU SPY
[Android Apps and Games] ghiki:
Same here with Hypersensation CM7
[Android Apps and Games] duki1010:
Very useful thanks...
[Android Apps and Games] hermanchb:
will try this app ~
[Android Apps and Games] walda:
Would it be possible to reset after unplug automatically?
[Android Apps and Games] TheCreat:
Definitely +1 to that, at least as an option :-)

Sent from my GT-I5800
[Android Apps and Games] storm717:
Version 0.3.2 beta should be on the Market soon. Thanks to a patch from Rainerd the negative CPU percentages should be fixed.

I'll look into adding some of the features you guys suggested as well.
[Android Apps and Games] Dougfresh:
Thanks Storm!Its been a must have on Cm7 and ics.Been using this app for months and its one of the 1st apps I reload after each new flash.;)
[Android Apps and Games] Karpfenhai:
Hey there, very helpful app!

since i installed the latest version, the app complains about "No offset found" on start, is this a bug or an upcoming feature?

its like "not perfect" that disturbs me a bit :)

anyone else got this message too?
[Android Apps and Games] Rita Muster:
Hello.

Thx a lot for this extremly usefull app. I really need it to controll the deepsleep with my Pyramid.

But now I have a problem. I use CM 7.1 Alpha 10 with a sensation.

With faux Pyramid-Kernel-0.1.4-OnDemand-N-1.56GHz everythink was OK. Now I use Pyramid-Kernel-024r-N-CM7-1.73GHz and i have FC´s with Cpuspy. Wiping and reinstall dont work.

Can you please help?
[Android Apps and Games] storm717:
Version 0.4.0 has been uploaded, it'll be visible on the market soon.

I did a large code-cleanup, there should be no more negative percentages, let me know if anybody is still running into them.

I also removed the attempted read-as-root on the states file, as it was really poorly written and just causes freezes on peoples systems. I will re-investigate this in a future version.

For those who see the red bar saying that the time in state file wasn't found, send the following commands and post the output:

adb shell
find /sys -name "time_in_state"

to try and find the file. When it's found, do this (substitute the directory if it's different from the first step):

ls -l /sys/devices/system/cpu/cpu0/cpufreq/stats

And again paste the output here. This will help me see why your device can't access / see the file.

It's still best to talk to your ROM / kernel dev about this file if you're running custom firmware!
[Android Apps and Games] brentil:
It now loads but I get the red bar as mentioned. I am running CM 7.1 now and not the stock OS any longer with the stock CM 7.1 kernel on a LG G2x (dual core Tegra2).

Doing find /sys -name "time_in_state" does not return any results so I navigated down to "/sys/devices/system/cpu/cpu0/cpufreq" but there is no stats file or folder. I also have a "/sys/devices/system/cpu/cpufreq" folder but is empty.

$ cd /sys/devices/system/cpu/cpu0/cpufreq
$ ls -l
-r--r--r-- 1 root root 4096 Dec 7 20:06 affected_cpus
-r-------- 1 root root 4096 Dec 7 20:06 cpuinfo_cur_freq
-r--r--r-- 1 root root 4096 Dec 7 20:06 cpuinfo_max_freq
-r--r--r-- 1 root root 4096 Dec 7 20:06 cpuinfo_min_freq
-r--r--r-- 1 root root 4096 Dec 7 20:06 cpuinfo_transition_latency
-r--r--r-- 1 root root 4096 Dec 7 20:06 related_cpus
-r--r--r-- 1 root root 4096 Dec 7 20:06 scaling_available_governors
-r--r--r-- 1 root root 4096 Dec 7 20:06 scaling_driver
-rw-rw-r-- 1 root system 4096 Dec 6 18:08 scaling_governor
-rw-rw-r-- 1 root system 4096 Dec 6 18:08 scaling_max_freq
-rw-rw-r-- 1 root system 4096 Dec 6 18:08 scaling_min_freq
-rw-r--r-- 1 root root 4096 Dec 7 20:06 scaling_setspeed
$
[Android Apps and Games] storm717:
Thanks for the info, unfortunately as I mentioned in the github issue, I don't know of any other method other than querying the sysfs for getting the histogram for states, so talk to the guys over at CM that are responsible for the kernel code and see if they can patch the kernel to expose this file. Point them towards this thread/github repo and tell them to get in touch if they have any ideas on getting this working with your device.

not the best news, but thanks for the help :)
[Android Apps and Games] brentil:
I'll do that and hopefully we can get some traction.
[Android Apps and Games] storm717:
If somebody with a dual-core device (that has CPU spy working on it) wants to help test the multi-cpu readout then shoot me an email at bvalosek@gmail.com with "CPU Spy" in the subject
[Android Apps and Games] ryomakun:
emmm newbie question..how read that status?? i dont understand the meaning of that T_T
[Android Apps and Games] mark.m.moran:
Also, does total state time have anything to do with the total time of the battery since the last charge??

Cheers,

M
[Android Apps and Games] Karpfenhai:
its the time since last reboot...

the percentage shows you how much time your phone spent in each cpu speed the lower the better for battery life..

Swyped from my GT-I9100 using XDA App.
[Android Apps and Games] mark.m.moran:
Cheers, I assume the higher in deep sleep though the better??
[Android Apps and Games] storm717:
Deep sleep is when the phone is completely off (screen black, CPU asleep waiting for some sort of wake-up signal). If this isn't roughly equal to the time your phone is just sitting in your pocket, then you can tell that something/some app is keeping your phone from properly entering this (massively power saving) state, and you will thus have much worse battery life.

It can also show you how your phone is scaling UP the frequencies on demand, so you can tell how aggressive your CPU governor is as well (important for performance and power balancing).
[Android Apps and Games] tarikg:
sensation

I have an unrooted sensation. and I am getting the same state error. does this software require rooted phone?
[Android Apps and Games] TheCreat:
No, root is not required. But some kernels either don't report the frequencies, out the file has wrong permissions. In that case you might need root to change them.
[Android Apps and Games] minalove:
ok thank so much...!?!?!
[Android Apps and Games] trsix:
free?

delete......
[Android Apps and Games] Tommmii:
@brentil

@storm717

are you guys making any headway re the CM7 issue?

Can I help in some way? I'm running an LG O2x with Miui rom (CM7 derivative) and have same issue as Brentil.

cheers,

T
[Android Apps and Games] brentil:
You can go bump my thread with some additional information or requests to try to help get traction from them.

http://forum.cyanogenmod.com/topic/38203-time-in-state-file-exposure/page__fromsearch__1
[Android Apps and Games] dirtyreturn:
Is there a way to add app ability to have stats saved even after reboot?

Edit - nevermind, that would be kind of silly.
[Android Apps and Games] elTorres:
CPU Spy v0.4.0, Motorola Defy+, CM7.2 270112 (Nighty) I get the red bar. The ouput for the commands you said are:

[B]# find /sys -name "time_in_state"[/B]
find /sys -name "time_in_state"
/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
[B]# ls -l /sys/devices/system/cpu/cpu0/cpufreq/stats[/B]
ls -l /sys/devices/system/cpu/cpu0/cpufreq/stats
-r--r--r-- 1 root root 4096 Jan 31 14:29 time_in_state
-r--r--r-- 1 root root 4096 Jan 31 14:29 total_trans
[Android Apps and Games] hawkerpaul:
Hi Storm

If you are still developing this great app, can I make a couple of suggestions please:

1. Automatically reset timers when on 100% battery and charger disconnects

2. When a reset occurs, record the battery %age

3. Show battery %age drop since last reset

Many thanks again.
[Android Apps and Games] mahtew:
Hello,

I have to say that your app is great.

But.. :D

Is there any possibility to change the way that app shows times spent in state for dual core processors? It could be shown in two separate columns or in two different tabs. This gives a lot more information and can help with adjusting CPU thresholds.

another thing ... adding GPU?? :)

thanks!
[Android Apps and Games] atb001:
I'd like to use CPU Spy, but it doesn't work with my kernel (SebastianFM OC/UV). Are there any kernels that will allow it to work? I have a Sensation XE and I'm running InsertCoin ROM (ICS 4.0.3, Sense 3.6) and FW 3.25. Thanks.
[Android Apps and Games] tarikg:
I have rooted the phone and installed ICS leedroid rom & 3.25 Sebastian's kernel (nearly same configuration with the post above) Still getting red warning instead of states :) How can I solve? going recovery and pushing fix permissions help? or talk to Sebastian?
[Android Apps and Games] TheCreat:
Yes, talk to the author of your kernel I'd say. This program basically just displays the content of a file called time_in_states (see first post for details like location). If the kernel doesn't supply it, it won't work. Also could it be that ICS uses a changed format? Maybe the author of this can take a look, but I suspect three kennels just have to support it...

Swyped on my Galaxy 3
[Android Apps and Games] Spo0f:
Hi all, i seems to have a problem with the CPU Spy on my Galaxy Note since the last update.

It was working awesome and after the update it seems to get stuck. It whether does not show anything tho the phone has been working for hours or it shows only that deep sleep state has been used.

I've tried to reinstall few times, with and without restart, but it still seems not to work. Something strange is that after uninstall, restart, install it shows the last measurement.

Any ideas?

Thanks in advance.
[Android Apps and Games] rashidi_zin:
I received very weird figures. This is happening for the first time.
[Android Apps and Games] confusedmuse:
Very useful app, thank you. With your (clever) "reset" feature, there is nothing left to improve or add imo. :)
[Android Apps and Games] kwokshsee:
Percentage of battery power consumed by CPU?

Dear storm717,

I'm trying to use ur CPU Spy to compare the battery efficiency of two different kernels with respect to CPU battery consumption. In order to do this, I need to know the proportion of battery power that has been used by the CPU, and I wonder if ur CPU Spy is reporting this particular datum.

If I may elaborate: e.g. when the battery level is 74%, CPU Spy is run and the following data are obtained:

Deep Sleep: 84% 9:39:16

200MHz: 9% 1:02:40

etc.

Correct me if I am wrong: do the above figures indicate that of all the current (in mA) the CPU consumed (let say X mA), 84% was spent when the CPU ran at Deep Sleep status, 9% when CPU ran at 200MHz, is it correct? So, CPU Spy reports not X, but how much of X (in percentages) was spent by the CPU at its respective frequencies, right?

If that's correct, is there any way to find out X? In Settings --> Applications --> Battery usage, we can find out the proportion of power consumed by, e.g., Display. But there is no single entry for CPU --- there are Android OS, Android System, but no CPU, so we can't tell what proportion of the power was consumed by the CPU.

Do u happen to know how one can find out X?

Any input or wisdom from u, or anyone here, will be greatly appreciated! :)

Thx in advance.
[Android Apps and Games] TheCreat:
CPU spy simply reads a data file that the kernel (hopefully) provides. This file contains one line per frequency available, stating the frequency and the usage. There is no information available how this relates to actual power used, the kernel simply doesn't know this (at least not generally). Detailed and specific knowledge about the power profile of the processor world be required. Additionally the power consumption depends on more than just the clock speed, it varies with what exactly the CPU does.

The system is just too simple to give you concrete mA values, or rather getting them is to complex :)

Swyped on my Galaxy 3
[Android Apps and Games] jcsy:
how about dual core, or rather the secondary core

hows does the app translate the secondary core usage, or times

the app works PERFECTLY FINE on my HTC EVO 3D :)

well done
[Android Apps and Games] kwokshsee:
That's exactly what I've suspected. Thank you so much for the reply! :)
[Android Apps and Games] garment69:
Great app. thank you.

I would like to second the suggestion above. For me, its more suggestion #1. Since my GS2 is at 200 for 9 hours a day while its on the charger I always have to remember to reset the timers in the moring. This would be a great add.
[Android Apps and Games] Karpfenhai:
I third that, but i would more like to have an "Exclude from stats" feature which does not count the charge cycle instead of ruining the stats by cleaning them completely.

Thx in advance!

Tapatalked from my Samsung GT9100
[Android Apps and Games] hceylan:
How about wake_locks

Hey dude,

Great app... Keep up the good work.

There seems to no app that reports the wake_lock stats.

How about adding this to the app?
[Android Apps and Games] cdmackay:
What about Better Battery Stats?

Apols if I'm missing the point...
[Android Apps and Games] hceylan:
Sorry not to be clear.

There seems to be no app that combine the two functionality...
[Android Apps and Games] realgpp:
mod version

Hi everyone, I've download the app source and made a little modification.

I've removed the cpu frequency that has been used less than 1% of the total time from the "Time in State" list. But I've added a compacted list of those freqs, without the usage time and percentage, before the "Kernel Info" text view.

I've uploaded a screenshot, the apk and the source code.

Maybe someone would like it :)
[Android Apps and Games] 2g11:
I recently started using this app since I run into huge battery drain after flashing lots of ROMS. Even after returning to my old stock ROM the drain is the same. Cpuspy says my 122Mhz state(lowest) is unused. Can you please explain what this means? It appears it could explain my problems because from deep sleep it skips 122Mhz to 245mhz and I notice most of my usage when the phone is awake is in the 245mhz state. I used CM9 for a while and the was switching between governors there a lot looking for for better battery life, could that have affected my cpu? How can I get the 122Mhz state working? Thanks for the help.

Sent from my Wonder
[Android Apps and Games] bsoplinger:
I have the Virgin Mobile clone of this phone, the HTC Evo V 4G.It runs ICS instead of honeycomb. I don't have the stats file :(

app_221@android:/ $ export PATH=/data/local/bin:$PATH

app_221@android:/ $ ls /sys/devices/system/cpu/cpu0

cpufreq

cpuidle

online

rq-stats

topology

app_221@android:/ $ ls /sys/devices/system/cpu/cpu0/cpufreq

affected_cpus

cpuinfo_max_freq

cpuinfo_min_freq

cpuinfo_transition_latency

related_cpus

scaling_available_frequencies

scaling_available_governors

scaling_cur_freq

scaling_driver

scaling_governor

scaling_max_freq

scaling_min_freq

scaling_setspeed

app_221@android:/ $
[Android Apps and Games] realgpp:
little improvement

I don't know if Storm is still developing this app but in the meanwhile I've enjoyed adding the above funcions and one more: to reduce the list of the stats it's possibile to choose from the menu the "item" to hide the frequencies under 1% usage.
[Android Apps and Games] bsoplinger:
It's nice of you to update the app...

A question. I posted about how my brand new phone with ICS doesn't have the necessary stats file. I'm guessing the info is there but in a different file. Would it be possible to show or attach a valid file so I can hunt through the various files there and see if one matches?

Sent from my HTCEVOV4G using Xparent Purple Tapatalk 2
[Android Apps and Games] TheCreat:
First of all, thanks for continuing development on this (I very much enjoy the previous version hiding the <1% lines from the last page). But it seems you broke something in this version, as it no longer displays anything. Instead I get an error displayed telling me the stats file can't be accessed. I should note though, that below that the "unused" states and the "<1% states" are still displayed correctly (and realistically), so the file can clearly be read.

Also, could you continue the version numbering in some way? Currently your versions have either "dev" or "realgpp" as the version string. Why not use 0.4.1 or 0.5 or something? The version in Post 169 from my link above acts as an update to the 'original' CpuSpy 0.4.0, while the latest version installed itself seperately. As a side note, what do you need the SD-Card access permission for?

Sure, I have attached mine as a code section. It is entirely possible that your kernel doesn't support this though. There may be custom kernels implementing this. Still, good luck in finding it anyway, though it's unlikely to be in the "wrong place", you never know...

1200000 0
1100000 0
1000000 577360
900000 123692
800000 93521
700000 67705
600000 58401
500000 381807
400000 258135
300000 648534
200000 472330
83000 8593887

---------- Post added at 11:13 AM ---------- Previous post was at 10:57 AM ----------

Don't worry, this is most likely intentional. Especially if you run a custom rom, but even with a stock rom/kernel this isn't that unusual. The reason for this is simple: The lower the lowest 'active' frequency (meaning: not deep sleep) the slower any reaction to input will be. Even with a good governor that reacts as quickly as it can this can be noticeable. The power usage of the cpu isn't that much higher for this single step (if it's even higher at all), the reaction to input will be noticeably different though (again, depending on the used governor).

Most people will recommend a similar setting for SetCPU (or any other means of setting frequencies for various states) akin to that. For example for my phone (going from 83 MHz to 800 with slight overclocking) most people will recommend 300-800 for the 'screen on' profile and 83-300 for the 'screen off' profile. This still allows for some (limited) operations while the screen is off, like background activity, but will react quite snappy as soon as the screen is on.

Excluding just the lowest frequency is a viable alternative if there aren't multiple profiles like that available.

True power saving requires deep sleep anyway (which basically turns the cpu off completely), and that should still be the dominant percentage (given you don't read any books on the phone or play games for hours on end).