google / battery-historian

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

Note: Could not parse aggregated battery stats. #188

Open a1exus opened 5 years ago

a1exus commented 5 years ago

Hello

I'm trying to follow Getting Started and while analyzing new bug report from my Google Pixel 2 XL w/ Android Q, I run into following message:

Note: Could not parse aggregated battery stats.

docker container (logs):

2019/07/25 16:05:27 Trace starting analysisServer processing for: POST
2019/07/25 16:05:27 Trace starting reading uploaded file. 13146743 bytes
2019/07/25 16:05:28 failed to extract time information from bugreport dumpstate: open /usr/lib/go-1.6/lib/time/zoneinfo.zip: no such file or directory
2019/07/25 16:05:28 Trace started analyzing "bugreport-taimen-QPP5.190530.014-2019-07-25-11-55-07.zip~bugreport-taimen-QPP5.190530.014-2019-07-25-11-55-07.txt" file.
2019/07/25 16:05:29 Trace finished processing checkin.
2019/07/25 16:05:29 Trace finished generating Historian plot.
Unknown history key: Mrc / 0
Unknown history key: Wrc / 0
Unknown history key: +Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Chtp / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: SubsystemPowerState / 
Unknown history key: -Chtp / 
Unknown history key: +Chtp / 
Unknown history key: SubsystemPowerState / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: -Chtp / 
Unknown history key: +Chtp / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: -Chtp / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: Mrc / 0
Unknown history key: Wrc / 0
Unknown history key: +Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Chtp / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: SubsystemPowerState / 
Unknown history key: -Chtp / 
Unknown history key: +Chtp / 
Unknown history key: SubsystemPowerState / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: -Chtp / 
Unknown history key: +Chtp / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: -Chtp / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: SubsystemPowerState / 
Unknown history key: +Sd / 
Unknown history key: -Sd / 
Unknown history key: +Sd / 
2019/07/25 16:05:29 Trace finished processing summary data.
2019/07/25 16:05:29 Trace finished analyzing "bugreport-taimen-QPP5.190530.014-2019-07-25-11-55-07.zip~bugreport-taimen-QPP5.190530.014-2019-07-25-11-55-07.txt" file.
2019/07/25 16:05:29 Trace ended analyzing file.
2019/07/25 16:05:29 Trace finished analysisServer processing for: POST

report seems empty on my screen although Device and Android ID made it, rest is pretty empty

Please advise.

MichaelJokAr commented 5 years ago

same error

alsedi commented 5 years ago

the same error

gagneetsachdeva commented 5 years ago

Same error

ashlylau commented 5 years ago

+1

flawnn commented 5 years ago

+1

Redwid commented 5 years ago

The same error on Pixel 2 on Android 10

In additional error section from web: error.txt

And warning:

The underlying format for bt has 1 additional field(s) that are not captured.

wenjie-zhou commented 5 years ago

It's working now.

gagneetsachdeva commented 5 years ago

@wenjie-zhou: Any update to parse Android Q battery stats?

wenjie-zhou commented 5 years ago

gagneetsachdeva@: the provided docker binary now works with Q bugreports correctly for me: docker run -p :9999 gcr.io/android-battery-historian/stable:3.0 --port 9999

gagneetsachdeva commented 5 years ago

@wenjie-zhou :I run battery historian through command line instead of docker. Any idea what changes will required in building from source code to parse Q bugreports?

antgustech commented 5 years ago

@wenjie-zhou :I run battery historian through command line instead of docker. Any idea what changes will required in building from source code to parse Q bugreports?

Yeah wondering that as well, I need to know what changed in the source.

Redwid commented 5 years ago

@wenjie-zhou how that supposed to be working now for you, as there are no changes for 2 years in this repo?

wenjie-zhou commented 5 years ago

I just used the docker version. Not sure about the source code part.

Redwid commented 5 years ago

What device are you using? Pixel? On Android 10? Could you please share batterystat file?

kevinisbest commented 4 years ago

Hi all, I think "Sd" means screenDoze and it only appears in the version after Android M. So add this condition to this line might solve this kind of error. https://github.com/google/battery-historian/blob/d2356ba4fd5f69a631fdf766b2f23494b50f6744/parseutils/parseutils.go#L2023

kevinisbest commented 4 years ago

Sorry, I am wrong, the condition of screenDoze needs more processing to distinguish from screen.

kevinisbest commented 4 years ago

Hi all, according to the reply, 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!

Redwid commented 4 years ago

@kevinisbest do you know if we need to modify current code from master to make it work? Looks like for me nothing happened after selecting bugreport for upload.

kevinisbest commented 4 years ago

@Redwid if the version of the android devices are lower than Q, you don't need to change anything. As far as I know, the error only happens in version Q and need to modify the source code.

Redwid commented 4 years ago

@kevinisbest, understood. I've android Q. With or without modification that you provided not able to make battery-historian works from the source code. Looks like it's running fine, no exception in console, web page is up, I'm able to select my bug-report , but nothing happened after.

Redwid commented 4 years ago

OK, I've sorted not uploading issue. Solution is here: https://github.com/google/battery-historian/issues/183

go run setup.go (this fails)
cd third_party/closure-library/
git reset --hard v20170409
cd -
go run setup.go (this passes)

@kevinisbest, but your fix with t = "0" didn't work for me. The same can't parse error. And with that error log in console: TypeError: a is null[Learn More] historian-optimized.js:200:65 historian.appstats.initialize http://localhost:9999/compiled/historian-optimized.js:200:65 historian.initialize http://localhost:9999/compiled/historian-optimized.js:662:44 historian.requests.uploadComplete http://localhost:9999/compiled/historian-optimized.js:665:304 e.fn.ajaxSubmit/t.complete http://www.gstatic.com/external_hosted/jquery_form/jquery.form.min.js:13:10175 j http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js:2:27290 fireWith http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js:2:28108 x http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js:4:22187 b http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js:4:25980

JosielManzonni commented 4 years ago

@Redwid if the version of the android devices are lower than Q, you don't need to change anything. As far as I know, the error only happens in version Q and need to modify the source code.

I´ve tried and does not work. if t == "0.0" { t = "0" }

ShineMeng commented 4 years ago

+1 the same error

Riven0108 commented 4 years ago

You can pull the battery logs from bugreport In Android 10/Q without using battery historian which is no longer working in 10.

See: https://www.reddit.com/r/GooglePixel/comments/ehmuwc/comment/fcn0uvp

ShineMeng commented 4 years ago

This issues in Linux fixed,executed the latest image: $ docker run -p 9999:9999 gcr.io/android-battery-historian/stable:3.0 --port 9999

JosielManzonni commented 4 years ago

sure, as you can looking in the issues.. the docker image work properly but if you want customize your own battery-historian and build the source-code inside of docker image it won't work. only if u use docker image

parkerlreed commented 4 years ago

+1 for please fix upstream. docker is not an ideal solution for many people.

BlackZheng commented 4 years ago

+1 for please fix upstream. docker is not an ideal solution for many people.

Maybe you can try my solution

lilydjwg commented 4 years ago

I fixed the code myself: https://github.com/lilydjwg/battery-historian/commit/a912fa0ee57a9dba00d8fd37a9516c0bc11751ed