yashsingh1/xdaforums huggingface dataset:
[BetterBatteryStats] Karpfenhai:
That sounds promising to me and would explain why deletion of the files didn't help while a reboot did (in my case).

So you mean the deep-sleep sometimes (not always) persists b/c the timing of unplugging vs. screen on?

During my long run over 34 days w/o reboot it happens unreproducible on my phone, sometime it works sometimes not, i get the feeling unplugging but not touching makes the reference working as expected but first using the phone and unplugging while screen is on causes the problem, will try to confirm this behavior.

Im sure, as usual you will work this out soon! ;)
[BetterBatteryStats] oz_90:
Wake time problem

Hi, my phone shows a lot of awake time. I made a dump of BBS but I don't know how to interpretate it. Can someone help me?

I've attached the dump and an image of the battery graphic one hour before making de dump, where you can see how the phone is awake. It happens with wifi or 3g.

Thanks
[BetterBatteryStats] Karpfenhai:
Damned Jeremy you are driving me nuts! :D .. kidding ..

20 mins out of 6 hours is quite good, those 20 mins are mostly related to your sync and social activities (Facebook)

I think you can live with that, but if you still think its draining to much, here is what you can do:

1. Disable location based services completely.

2. Get yourself another Baseband, newer is not always better, if you spent the most of your time in an urban area, try KI3 or KI4, i know these are GB Modems but they will work.

3. AOSP Rom ? 4.0.4 does imply that, in that case try Abysskernel + init.d script to cap your CPU's max frequency down to 800 Mhz, trust me, its way enough.

Loadh + loadl values, 85 and 40. Screen off frequency max 200 mhz. Govenor Abyssplug * sio

On a Sammy based ROM, use Phenomenal 5.5, extreme if your device can handle (best savings) or medium. Leave it as it is, only voltage control app for upper cap limit.

4. Do your homework's, all of the above is written and repeated over and over again in this thread.

5. Good luck and no offense mate! :cowboy:

---------- Post added at 08:12 PM ---------- Previous post was at 08:06 PM ----------

Wow, thats amazing! ;)

First of all, read the OP how to produce a clean dump!

Yours contain too much mixed usage.

Quick shot, Your Sync activity causes a tremendous overhead, try to disable all what you dont really need and set the rest to manual sync.

Come back after this with a clean dump. .. furthermore.. just read the thread, its worth it...
[BetterBatteryStats] cdmackay:
superuser, for me...
[BetterBatteryStats] Rob2222:
I try to help debugging on RC1 and RC2 but I didn't get useful explanation of what I see. Sometimes I have no information on "since screen off" then I switch trough the data fielde (other, alarms), dont touching "since screen off" and then I see information anywhen. But sometimes I see information on "since screen off" but the time is always "0s"?!

I think to see, that I have more problems with "since screen off" not working when on AC power. But I am not sure.

What I am sure is, that from time to time I get a "BBS not reacting - close it?" message. I also deleted BBS data to regenerate data from scratch. Not changing.

Best Regards

Robert
[BetterBatteryStats] Karpfenhai:
This is happening when you pull up bbs right after unplugging / turning screen on when the message not has appeared right?

(not the dumpsys alarm root message, th other one from my screenshot 2 pages back)
[BetterBatteryStats] chamonix:
I think I was able to consistently get the refs saved now where I had problems before. For the ones interested in the reason:

I use BroadcastHandler s to register to the different events BBS is interested in:

- unplug: save since unplugged and since charged if charge = 100%

- screen off: saves since screen off

- screen on: watchdog processing

Now the lifecycle of broadcast handlers imposes, that the processing happens "fast" (whatever that means, and it can differ between ROMs).

What was wrong: I did all the processing in the BroadcastHandler, leading to a timeout in certain cases (see the ActivityManager log above).

What I did: the BroadcastHandler now sticks to it's time constraint by kicking off a Service running once (this is a common pattern) and the Service has all the time it needs to do the job.

The code is finished and comitted to my local repo. I will update some readme stuff and deliver the next RC even if not all open issues are solved (the eventX-YYYY is still open) because I'd like you guys to do a full round of tests to be sure the fix really works
[BetterBatteryStats] chamonix:
This is I believe also related to the timeout of the boradcast handler and should be solved with #194. Will be up in the next 1/2 hour
[BetterBatteryStats] californicated:
It looks like Google Currents caused the drain activating sync. Hopefully it's gone

Gesendet von meinem GT-I9100 mit Tapatalk 2
[BetterBatteryStats] chamonix:
1.9RC3

Release 1.9RC3 is up and should fix all conditions of ANR, mssing refs and wrong "deep sleep" value plus a few other things. Changelog as always is in post #2

Happy testing!
[BetterBatteryStats] Wacco001:
Thank you for all the great work :)

Respect !
[BetterBatteryStats] chamonix:
That would be bug #194 (hopefully fixed in RC3)
[BetterBatteryStats] chamonix:
If you can reproduce that you should file a bug to androidsu.

Thank you for your efforts in trying to test BBS. If it gets too much for you (what I can understand as Release Candidates are beta) you should go back to 1.8.1 and wait for the final 1.9 to be released
[BetterBatteryStats] chamonix:
That would be the bookmark sync of chrome (com.android.browser_Account is in the name)
[BetterBatteryStats] Rob2222:
No way, love that new features! Thanks! :)

BR

Rob
[BetterBatteryStats] chamonix:
Since 6 h 27 m 25 s
Deep Sleep (): 5 h 51 m 19 s (21079 s) Ratio: 90,7%
Awake (): 36 m 5 s (2165 s) Ratio: 9,3%
Screen On (): 17 m 51 s (1071 s) Ratio: 4,6%

that would be 20 minutes awake in 6:30, most of those caused by network traffic. Upcoming BBS 1.9 will help you by showing the details of network usage
[BetterBatteryStats] Karpfenhai:
Installed, unplugged and on my way home, lets see what happens ;)

No manual refresh option for widget.. :P
[BetterBatteryStats] chamonix:
No RILJ is still the reason why your phone stays awake: RILJ (Phone): 3 h 44 m 34 s (13474 s) Count:736 23.0%

But in this reading I see lots of location activities and that you have had GPS on so a cause may be AGPS. I suggest that you take another reading where neither Wifi nor GPS are on
[BetterBatteryStats] chamonix:
Since 1 d 31 m 44 s
Deep Sleep (): 1 d 23 m 4 s (87784 s) Ratio: 92.9%
Awake (): 1 h 37 m 35 s (5855 s) Ratio: 6.6%
Phone On (): 14 m 47 s (887 s) Ratio: 1.0%
Screen On (): 14 m 6 s (846 s) Ratio: 1.0%

[/QUOTE]

1 hour 37 - 28 minutes = 1 hour 9 minutes awake in 24 hours 30 minutes, that's not that bad.
[BetterBatteryStats] chamonix:
No, those are new features and I am pretty strict when it comes to code freeze. But if those reference inconsistencies are fixed and while you help me debugging eventY-XXXX I could add that one ;)
[BetterBatteryStats] yhrn:
I'd really like to help out with the eventX-YYYY feature but I don't know what to do. I've now grabbed logcats from my pc with adb logcat as well as from using terminal emulator on the phone - both for RC2 and RC3. Still nothing! I can't find a single debug level record for "BatteryStatsProxy" or anything that looks like the messages you described. Sorry. Any ideas?
[BetterBatteryStats] Rob2222:
You maybe should add a "Awake minus ScreenOn" line there, then we do not need to calculate that always.

BR

Rob

PS: Purchasing BBS on my second Play account now also, to support dev. :)
[BetterBatteryStats] chamonix:
This is more than weird. I just installed RC3 xdaedition, opened the process view and did a 'adb logcat | grep Proxy' fro my PC. The result ist a lot of thoe entries:

D/BatteryStatsProxy( 1022): Process name = *wakelock*
D/BatteryStatsProxy( 1022): UserTime = 0
D/BatteryStatsProxy( 1022): SystemTime = 0
D/BatteryStatsProxy( 1022): Starts = 0
D/BatteryStatsProxy( 1022): Process *wakelock* was discarded (CPU time =0)
D/BatteryStatsProxy( 1022): Process name = com.google.android.apps.plus
D/BatteryStatsProxy( 1022): UserTime = 2
D/BatteryStatsProxy( 1022): SystemTime = 1
D/BatteryStatsProxy( 1022): Starts = 0
D/BatteryStatsProxy( 1022): Process com.google.android.apps.plus was discarded (CPU time =0)

Thank you for your efforts anyway, I will try to fake a process list through the parser and see where the eventX-YYYY are being lost.
[BetterBatteryStats] selectah:
Is it normal that nfc appears as kernel Wakelock even if it's always unticked?

Sent from a mobile device
[BetterBatteryStats] yhrn:
Process view! I was refreshing the KWL view all the time. I think I might have misinterpreted your initial post on this matter :o.

Anyways, here's the logcat.

And just to make sure that the info really isn't visible in BBS and it's just me missing it - exactly where am I supposed to see this extra info
[BetterBatteryStats] chamonix:
Ok with a fake version of the process list (and corresponding pids) this is what I get in my test version:

D/BatteryStatsProxy( 3655): Pattern 'event' found in event3-30240
D/BatteryStatsProxy( 3655): Resolving proc name for 'event' 30240
D/BatteryStatsProxy( 3655): Pattern 'event' resolved to (mikado.bizcalpromikado.bizcalpro )

In that case (mikado.bizcalpromikado.bizcalpro) would be displayed next to event3-30240 in the list (of course all that is fake data but the log is true (from upcoming RC4)
[BetterBatteryStats] ThierryXN:
I'm not a BBS wizard, and a cursory glance through my log shows the usual wlan wakelock, but only at 15% or so, and lot of other low-percentage activities. 47% drain over 10 hours with not much screen time seems kinda weird.

This is on an AT&T Galaxy SII running task/ktoonsez AOKP with Fluxi kernel. Though, I think this dump has all the info, like phone/ROM, KWL, PWL, Alarms, Processes, Other, and even Network.

Is there stuff I'm missing, or does it look like I need to replace my battery altogether?

Thanks in advance for any help, and this is a great utility.
[BetterBatteryStats] chamonix:
That IS the log I was expecting. Now it just seems that you dont have any "eventX-YYYY" in that occurence. Could you repost one if you happen to see a process in the format "eventX-YYYY"?

And sorry if my instructions were misleading or unclear!
[BetterBatteryStats] chamonix:
if it appears then it was there. I see it from time to time also btw
[BetterBatteryStats] chamonix:
For processes in the format "eventX-YYYY" BBS is supposed to take XXXX, hold it against the 'ps' list and search for XXXX as pid, add whatever process name found there and add it between () right to eventX-YYYY
[BetterBatteryStats] drapper:
Any leads on where I should start? Google didnt produce much
[BetterBatteryStats] yhrn:
Hehe, I think we're on to something here. I don't see eventX-YYYY in the process view, I see them in the KWL view (and I did see them there when I grabbed the logcat). So either I'm not experiencing the events you are looking for or you are looking in the wrong place :)
[BetterBatteryStats] bradwdx:
It's not too much at all, i'm actually enjoying this. I'm happy to help where i can. Looks like i need to learn/research more about submitting bug reports via proper channels.

The multiple root questions were due to androidsu/superuser and the 3.2rc2 seems to have resolved it.

Just installed your 1.9 rc3 and it resolved the issue where deep sleep and kwl showed a longer time than since unplugged.
[BetterBatteryStats] Karpfenhai:
finally..

View attachment logcat_grep_proxy.tar.gz

Okay mein Bester, here we go:

I fully re-enabled my logging..

Here is my logcat (this time a useful one).

Tapatalked from my Samsung GT9100
[BetterBatteryStats] vkumar2695:
I seem to be getting vbus_present even though my device wasn't even plugged in. With my screen on for only a total of 14 min, its draining my battery and not letting me go into deep sleep. Any suggestions?
[BetterBatteryStats] #illidan:
Well it's just weird & my phone is just getting on my nerves & its acting like purposely trying to do it:mad:. There is no consistency with the wakelock, no damn trigger for it & therefor no way to resolve it. Last night the wakelock suddenly disappeared & the only thing I did different was that I flashed a different kernel but I'm pretty sure that it will return again tonight. Sometime if I reboot the phone it won't appear on the first run after charging but on the second run it appears again after I finish charging & it only appears after charging. If I use my phone for a while after I charge it & then let it to sleep I don't get that wakelock. It only seems to happen if I let the phone sleep immediately after charging. Anyway thanks for all your time & effort. I'm just gonna have to figure this one out on my own.
[BetterBatteryStats] chamonix:
Omg, you are right! and I am so sorry... Looking at kwl after reading your mail just hit me and I even have test data! Now I got hide some place for a while :-D
[BetterBatteryStats] chamonix:
Next time please post a dumpfile as a Screenshot is missing relevant info.

It might be something stuck in your usb plug, or a kernel bug. Try cleaning the plug and see if it persists after a reboot. If yes take that to your kernel thread, you shouldn't be the only one with that problem
[BetterBatteryStats] chamonix:
Don't give up. It may take some time and more testing. Btw you mentioned you switched Roms. Did you wipe and how / what did you restore?
[BetterBatteryStats] chamonix:
Could you reboot your phone, let it do the dance a while and post a logcat and a dmesg?
[BetterBatteryStats] chamonix:
You are right about the wakeups due to wifi. Don't underestimate that, the 15% do not include the overhead of waking up your phone a large number of times. Besides this if you look at the partial wakelocks you will see a lot of wakelocks with a hight count as well as Alarms showing wakeups due to maps. Those are mostly due to wifi being on as well. In your case I strongly suggest turning wifi off when screen is off.
[BetterBatteryStats] oz_90:
Thanks for the response. I'll read how to make it and post it in some hours. :)

Edit: Are these the steps for making a clean dump?

Before posting a dump please make sure that the references for kernel wakelocks and alarms were processed correctly. Reading a dump takes a few minutes and it would be great if you could not waste the time of whowver studies in, aiming at helping you.

Generally a dump "since unplugged" is better than "since charged". When you start your analysis make sure to follow following procedure:

- plug/unplug the charger

- leave the phone alone 1-4 hours

- save a dump and check that the chapters "Kernel wakelocks" and "alarms" (if you have root) are populated

- Post the dump as attachement
[BetterBatteryStats] ThierryXN:
Ah, thanks for pointing out how I shouldn't have shrugged off that 15% number. Will try simply turning wifi off when I go to bed and somesuch.
[BetterBatteryStats] yhrn:
I've seen that behavior directly after upgrading BBS to RC3 and I think it's because BBS keeps it's own custom since unplugged reference for kernel wakelocks (as opposed to the since unplugged reference for partial wakelocks, which, I believe, is provided by the system) and this reference was lost on upgrade.

So if you also upgraded BBS just before the screenshot what you see might actually be your KWL since boot. In that case you will get normal stats after you've plugged in and then unplugged the phone again.
[BetterBatteryStats] samgcw:
I got no idea what is written in the BBS log dump file, anyone can help? Or is there any list to show wakelock vs process/application?

Also, does it mean a healthy phone should not have any wakelock? Please enlighten me.

Thanks in advance.
[BetterBatteryStats] chamonix:
RC4 is coming later today as unfortunately I have a full day at the office: eventX-YYYY fixed and more.
[BetterBatteryStats] Kurre:
In RC3 I noticed that when using a custom reference point, bbs doesn't show partial wakelocks correctly. What I mean that when "since custom ref." is selected from dropdownmenu, time is shown correctly but wakelock infos are exactly same as when "since unplugged" is selected. All other sections work as intended. In 1.8.1 all worked just fine.

Otherwise, new features are just fabulous :D:thumbup:

I'll grab logcat if needed after work.
[BetterBatteryStats] Karpfenhai:
Maybe you should ask the developer of this app how to read the correct

Values?

:cool::):D

That its correct, good luck matey!

Tapatalked from my Samsung GT9100
[BetterBatteryStats] Rob2222:
Yes, there are still some issues in RC3.

I just switched off the phone for 60 secs, switched on and entered BBS.

-Default is OTHER+SinceScreenOff. It says "since 0s" and has no informaton shows.

-Now I switch to SinceCustomRef. It still says "since 0s" but shows correct information (8h deepsleep, yes, its when I set the last CustomRef)

-Now I switch back to SinceScreenOff. Now it says since 4m:37 but only information is DeepSleep 0s.

-Now I switch to Kernel Wakelocks and see information that make sense

-Now I switch back to Other and now I see here information that make sense, too.

Short: Sometime I have to click trough the stats until I see meaningfull information. But I have no idea why.

Note: I have not plugged/unplugged power since installing BBS 1.9RC3 clean (deleting data). Buit there are since_charged_ref and since_unplugged_ref files, each around 400 Bytes. Is this normal?

Best Regards

Rob
[BetterBatteryStats] jeffreii:
Hi and thanks for the great app. I paid for it in the Play Store to support you - and hope to get some help figuring this out! I've tried reading through the logs and screens but as an Android noob (just switched from BB 2 weeks ago) I can't quite understand it.

Please help me understand not only what's draining my battery but how to read this myself for future reference!

Anyways, this has happened a few times. I've noticed my phone draining about 10-12% battery an hour with screen off and very little activity. Last time I did a reboot and it went away - no problem. It started happening again last night so I added a custom ref and left the phone alone for about 90 minutes. The battery drained more than 20% during that period with screen off. I dumped the log and here it is.

I know the wifi is on the whole time and I am ok with whatever battery drain that presents under normal conditions. I have always left my wifi on and never had a problem with battery life though I am aware it obviously makes some difference.

Thanks in advance!

UPDATE: Just in case it helps I'm adding a second log file. I did not restart last night and so this morning when I took the phone off the charger I set another custom ref point. I left it alone for another ~90 minutes. It drained from 100% to 79% battery without any use and screen off. See 7/10 log file.
[BetterBatteryStats] oz_90:
Hi, I think I've done it right this time. I've only activated twitter sync, dropbox instant upload (over wifi only), whatsapp and google services (Calendar, chrome, contacts and gmail). It seems that has worked :) the only thing I'm seeing, is that the maps are waking many times, but I don't know how to moderate the sync of maps.

I've attached the dump 4 hours later, but I forgot to take a screenshot of the battery graphic (I was sleepy jaja). And the dump 6.5 hours later with the screenshot.

Cheers.
[BetterBatteryStats] Tungstwenty:
Quick suggestion

chamonix,

Since you're finishing a new version here's a suggestion you can easily fit in, in case it's useful for stats analysis.

The current dump files don't include the kernel being used and that might be relevant for discussing certain wakelock names or knowing kernel-specific tendencies.

Getting the kernel string is pretty easy and according to the AOSP sources on grepcode, the method of reading /proc/version seems to be the "standard". It even goes all the way back till version 1.5.x.

Cheers!
[BetterBatteryStats] chamonix:
Based on the few last posts I will hold back RC4 some more and re-add some logging code so that we can trace what is happening when substracting the references. Whether I find a fix for that or just add the code to bring more light into the issue will be specified in the release post
[BetterBatteryStats] d3l1:
Can somebody explain this one to me?

================

Kernel Wakelocks

================

"main" (): 13 m 51 s (831 s) Cnt: (c/wc/ec)10/0/0 13,3%

Sent from here using Tapatalk
[BetterBatteryStats] chamonix:
Without context (I'd like to see a dumpfile) no
[BetterBatteryStats] chamonix:
#196
[BetterBatteryStats] Karpfenhai:
Now it should be twice in the change list, i mentioned this already 2 month ago ;)
[BetterBatteryStats] d3l1:
http://pastebin.com/XzAr8xG1

Sent from here using Tapatalk
[BetterBatteryStats] yhrn:
It happens to the best of us. I think even I might have made some mistakes in the past, even though I can't remember any :silly:

But talking about the process view made me remember that I always see something similar to the eventX-YYYY there (maybe even related?) and its kworker/[0/u]:X (e.g. kworker/0:1 or kworker/u:18). These are always very prominent in my process list. I understand that these are kernel worker processes that handle a lot of different things but is it possible get some more information on what they are doing and on behalf of which application/function?

Furthermore, I can report that the changes to how BBS invokes su in RC3 seems to be working really nicely. I got a lot of fairly long freezes when opening RC2 after unlock and that's all gone in RC3.
[BetterBatteryStats] camspy:
Hi there, as chamonix suggested me in other thead, I'm posting my battery stats dump file on here. Seems that my phone doesn't go to deep sleep, it is having wakes all the time so battery drains fast, android system seems to drain 60-70% of battery :(

Kaiten mail is now set to receive IMAP emails every hour, i have 7 mailboxes to check, 5 of them have just inbox syncing, other ones have 4-6 folders to sync. Idle check times set to 60 min
[BetterBatteryStats] Tungstwenty:
Looking at the "deleted: wlan_rx_wake" it looks like your using the latest Siyah that already includes the functionality I mentioned here.

The details on the last 2 deleted KWLs are an inoffensive bonus, but with regards to the overlapping vs regular KWL stats, I can see the confusion this is bound to generate :(

For a proper analysis on that kernel one now has to know whether you had the "exclusive stats report" turned on, or off as normal... - and this assuming that the "exclusive" view can indeed be useful, which I haven't seem a lot of feedback on yet. Hope this personal crusade for fun doesn't end up introducing needless entropy.

EDIT: This seems to be reporting the regular stats, as when looking at exclusive stats at least on my phone, the 4 entries related with "eventX-8000" would all be redunant except one of them. Since we're looking at ~40s each, and with considerable counts, these don't look like "exclusive stats".

As for the "main" wakelock, I also wondered what it represents. From the sources I can tell its associated with entering and leaving the suspend state, but that's hardly an explanation at all.

For me, sometimes it's continuously increasing while the screen is on and I keep refreshing the BBS listing, while other times it doesn't (???).

My initial thought was that it was associated with the screen being on, but I wouldn't bet on that.
[BetterBatteryStats] Geo2160:
Thanks for the response, but GPS wasn't turned on at all. I haven't used it in quite a while. Seems that the event is triggered when I use the phone a little (e.g. today i listened to some music and then i tried calling someone). Before that the device was sleeping fine. Nevertheless, I unticked all the options in the "location and services" menu. Gonna reboot and I will come back tomorrow with a new dump if the issue is still present.