Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

Can't parse aggregated battery stats on Android 6.0 #94

Closed
aadithpm opened this issue Nov 14, 2016 · 15 comments
Closed

Can't parse aggregated battery stats on Android 6.0 #94

aadithpm opened this issue Nov 14, 2016 · 15 comments

Comments

@aadithpm
Copy link

I'm running AOKP, a CM-based ROM (Marshmallow).

Generated bug report using ADB on Windows. The report is generated or rather, history stats are generated. System stats and app stats are empty. No visual data is generated as well. Historian V2 is empty and Historian just says 'Please wait.. drawing chart'.

I don't know if it's:

  • A CM issue. The historian can't recognize any system wakelocks and files it under '(unknown)'. The CM version also says '(unknown)'.

  • ADB/Windows issue. Will try on Linux and get back on this.

  • Android 6.0 issue.

Any suggestions?

@fanis
Copy link

fanis commented Nov 15, 2016

I'm seeing the same with pure CM13 (recent 2 nightlies, ) for Xiaomi Mi5.

CM Version: 13.0-20161112-NIGHTLY-gemini
Build: cm_gemini-userdebug 6.0.1 MOB31K e28d59dc5b test-keys
Kernel: Linux version 3.18.31-cyanogenmod-g6e9f01c (inky@cyanogenmod) (gcc version 4.9.x-google 20140827 (prerelease) (GCC) ) #1 SMP PREEMPT Sat Nov 12 03:53:56 PST 2016

I tried generating a bug report via adb through Windows 8.1, via console on the phone, and via the Developer Options menu.

I always get a few errors, including:

** Error in 9,h,7300,-Wm,+Pr,Esw=8 with Esw=8 : encountered multiple Esw events between a single pair of +S/-S events 
"device capacity is 0"

I tried checking out an older revision as well (pre I/O 2016), without success in parsing it.

I'd be willing to try if anyone has suggestions on workarounds.

@aadithpm
Copy link
Author

I'll generate the report from my phone and give it a shot. Will get back on it.

@adamhassel
Copy link

Same on Android 6.0.1 (CM13). Both with a report generated from the Dev. options and thru ADB.

Errors:
multiple vers lines encountered
system battery field already exists
could not parse aggregated battery stats
device capacity is 0

If you want, I can provide the bugreport file itself.

@kwadkore
Copy link
Contributor

kwadkore commented Jan 4, 2017

Based on the last set of errors, it looks like the report you're uploading contains multiple batterystats logs (there are multiple "vers" lines and at least two "bt" lines). Battery Historian is complaining because it only expects one log per file.

@matejdro
Copy link

Here is another report that is failing:

bugreport-NMF26V-2017-01-27-08-21-16.zip

@simowce
Copy link

simowce commented Feb 3, 2017

I met this problem when using Android 7.1.1, too.

@matejdro
Copy link

matejdro commented Feb 5, 2017

Everyone here, I have found workaround to make bugreport files from LineageOS work:

  1. Extract bugreport txt from the zip file
  2. Find every occurence of syn, (comma at the end is important) in the text file and delete whole line that contains it.
  3. Open modified text file with the historian.

@clover-es
Copy link

Same problem happening to me with CM13 in OPO.

I tried the solution proposed by @matejdro but I couldn't find any line that contained that characters, so I guess it just works for LineageOS.

@kwadkore
Copy link
Contributor

@matejdro, your report has a different issue. Some of the csv lines are printed in a way that is invalid and not expected. In your case, you have lines such as "9,0,l,pr,irq/420-HWK,syn,0,100,0,0,0,0" where irq/420-HWK,syn are interpreted as two separate entries, when they should be one. In those cases, they need to be surrounded by quotes: "9,0,l,pr,"irq/420-HWK,syn",0,100,0,0,0,0" to be treated as one entry.

@tehdef
Copy link

tehdef commented Aug 11, 2017

@kwadkore All you did was invalidate a bad solution, but did not resolve the original comment and then closed the thread immediately after.

I shouldn't have to do this type of black magic fuckery to get proper life out of my batteries, but here I am. Never had to do this on iPhone, so I expect better treatment.

Ever since I bought this Galaxy S8 I've been trying to use Historian, but I can't get it to parse the data. I'm not a developer, but I have as much right as anyone else to try to find a solution that isn't just immediately closed by a Googler who is unwilling to put any semblance of support into their solutions.

@kwadkore
Copy link
Contributor

@tehdef I don't know what problem your reports are experiencing. The last issue I commented is actually a problem with the Android reporting system. I have fixed it in the upcoming Android O release, but unfortunately it won't be fixed for previous versions. I don't think there's a good way to account in Battery Historian for all the possible invalid output that could be printed due to the underlying (now fixed) issue. That is why I closed this thread.

@tehdef
Copy link

tehdef commented Aug 12, 2017

Okay, Thank you. It would be nice if you would say these things though so that we are aware of what is or is not being fixed. I ended up just wiping my device because I could not get the graphing to populate on my S8. There are a few other existing comments on Samsung devices here in the Issues.

@kwadkore
Copy link
Contributor

My apologies for not stating that earlier.

@brucelinhf
Copy link

@kwadkore
I have met the same issue on Android 7.0. Could you have a look what's the format issue of my bugreport-2018-05-23-12-45-35 and how to workaround? Thank you so much.
bugreport.zip

@kwadkore
Copy link
Contributor

I don't see anything wrong in your report.

alexxxdev pushed a commit to syberia-project/platform_frameworks_base that referenced this issue Aug 16, 2018
…tions.

Some names can include commas, and if they're not surrounded by quotes,
then CSV parsing breaks, as was the case in
google/battery-historian#94 (comment)
and several other circumstances.

Test: flashed local device and ran batterystats output through Historian

Change-Id: I070c5d873d9f79996a581bf0a5f664136c0af454
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants