google / battery-historian

Battery Historian is a tool to analyze battery consumers using Android "bugreport" files.
Other
5.31k stars 957 forks source link

Android Q cannot parse battery stats #182

Open mitchross opened 5 years ago

mitchross commented 5 years ago

Android Q does not work with Battery Historian. Here is the error - Note: Could not parse aggregated battery stats.

fengguoqing commented 5 years ago

I meet same program, have any solutions?

RoyIronGrey commented 5 years ago

I meet the same problem, too. Anyone know why?

wangjun7121 commented 5 years ago

I meet same program, have any solutions?

Yjnscorpio commented 5 years ago

I meet same program,have any solutions?

antgustech commented 4 years ago

Same here.

ashlylau commented 4 years ago

same problem

tnthbs commented 4 years ago

U could replace the ,0.0, to ,0, in the bugreport.txt and try again.

antgustech commented 4 years ago

U could replace the ,0.0, to ,0, in the bugreport.txt and try again.

What do you mean? For what value(s)?

kevinisbest commented 4 years ago

Thanks @tnthbs , it works for me!

kevinisbest commented 4 years ago

Hi all, the error comes from the mismatch of "0.0" and "0". My solution is adding an if statement before line

https://github.com/google/battery-historian/blob/d2356ba4fd5f69a631fdf766b2f23494b50f6744/checkinparse/checkin_parse.go#L1996

if t == "0.0" {
    t = "0"
}

Hope this will help you guys!

tnthbs commented 4 years ago

Hi @kevinisbest ,do u mean the new code should be as below? Have tried but still meet errors for i, t := range rem { if t == "0.0" { t = "0" } tm, err := strconv.Atoi(t)

weijunxq commented 4 years ago

same issue, in my test never plug out usb can parse 1.adb shell dumpsys batterystats --reset 2.adb bugreport > bugreport.txt

plug out usb cannot parse 1.adb shell dumpsys batterystats --reset 2.plug out usb 3.plug in usb 4.adb bugreport > bugreport.txt

JosielManzonni commented 4 years ago

U could replace the ,0.0, to ,0, in the bugreport.txt and try again.

@tnthbs How did u find out it ?!

Riven0108 commented 4 years ago

Android Q does not work with Battery Historian. Here is the error - Note: Could not parse aggregated battery stats.

I meet same program, have any solutions?

You can pull the battery info ( including Coulomb Charge) directly from the bugreport logs with a simple search. Battery Historian not required to read battery log info.

How to do it, see: https://www.reddit.com/r/GooglePixel/comments/ehmuwc/this_is_how_you_can_check_a_rma_refurb_to_see_if/

sanjiv2001 commented 4 years ago

I just followed the steps on that Reddit post. The problem is that the bug report generated by the Android Q phone doesn't even have the battery info in it. I read the entire bug .txt file beginning to end and there's not a single mention of battery capacity anywhere.

Riven0108 commented 4 years ago

I just followed the steps on that Reddit post. The problem is that the bug report generated by the Android Q phone doesn't even have the battery info in it. I read the entire bug .txt file beginning to end and there's not a single mention of battery capacity anywhere.

Then you used the wrong file. I doubt you read it all as mine exceeds 600 pages in Android 10/Q.

You have to use the bugreport.txt file that is inside the bugreport zip archive.

The bugreport.txt file that is not inside the zip archive is empty. Do not use that one.

For example: https://imgur.com/a/QIdFcN7

sanjiv2001 commented 4 years ago

I am 100% sure I am using the right file. I've also done this process multiple times before on previous Android versions and on other Pixel Android Q phones. This is the first time I am getting data on literally all aspects of the phone EXCEPT battery.

Riven0108 commented 4 years ago

I'm

I am 100% sure I am using the right file. I've also done this process multiple times before on previous Android versions and on other Pixel Android Q phones. This is the first time I am getting data on literally all aspects of the phone EXCEPT battery.

Then you are doing something wrong. As I am on Android 10/Q, Dec security update, and I can clearly get battery info.

Screenshot: https://imgur.com/a/QIdFcN7

sanjiv2001 commented 4 years ago

Yea, I checked my process multiple times now and I still don't understand why that chunk of battery information is just missing from the txt file. It might be some sort of bug with the phone. If I figure this out, I'll post my workaround here.

Riven0108 commented 4 years ago

Yea, I checked my process multiple times now and I still don't understand why that chunk of battery information is just missing from the txt file. It might be some sort of bug with the phone. If I figure this out, I'll post my workaround here.

What Q security patch is the device on?

sanjiv2001 commented 4 years ago

December 5th, 2019

sanjiv2001 commented 4 years ago

Also, the bugreport.txt I am getting is much smaller than the usual report I get on most phones. Like you said, it should be in the ballpark of 600 pages, but mine is not this time. (hence why I was able to skim through it all)

Riven0108 commented 4 years ago

December 5th, 2019

That is strange. There are two bugreport.txt files in the bug report output. One is outside the bugreport zip archive, and one is inside the archive.

The one outside is empty and everything is..."cannot be fetched from service manager (null) Warning: Skipping"

In my case the bugreport.txt file inside the archive is like 600 pages long, and is the only one with all the data in it.

I also have a Pixel.

sanjiv2001 commented 4 years ago

I will reset my phone (was planning on it anyways) and retry the same process. I have a feeling there is some sort of error with the software. Regardless, I appreciate the help.

Riven0108 commented 4 years ago

I will reset my phone (was planning on it anyways) and retry the same process. I have a feeling there is some sort of error with the software. Regardless, I appreciate the help.

Do both of the bugreport.txt files contain the same info on your device?

weijunxq commented 4 years ago

docker run -p 9999:9999 gcr.io/android-battery-historian/stable:3.1 --port 9999 this version is working

nickoe commented 4 years ago

Yeah, using the 3.1 tag instead of 3.0 do seem to make the bugreport loadable and no critical errors as such in the terminal output, but I see errors in the webui when loading and I can't see any graphs. Using android Q bugreport.

The underlying format for bt has 1 additional field(s) that are not captured.
dct has 5 additional field(s) that are not captured.
dcc has 5 additional field(s) that are not captured.
unknown data category wmct
The underlying format for dc has 4 additional field(s) that are not captured.
unknown data category awl
wl has 6 new fields
wl has 6 new fields
wl has 6 new fields
...
guliash commented 4 years ago

3.1 working for me too. Thank you @weijunxq!

Wibblyw commented 4 years ago

Anyone know if 3.1 is running on a public server anywhere? I don't think this one is 3.1 https://bathist.ef.lc

Kol3sar commented 4 years ago

any plans to fix https://bathist.ef.lc `?

bjosey commented 4 years ago

@Kol3sar @Wibblyw I emailed the owner of https://bathist.ef.lc and they've update the image.

in509 commented 4 years ago

docker run -p 9999:9999 gcr.io/android-battery-historian/stable:3.1 --port 9999 this version is working

Thank you, 3.1 works for me. @weijunxq