ADB dumpsys batterystats - How does one read it? Why on earth does the adb shell dumpsys batterystats command not print regular timestamps? (Like usagestats does for example, or literally anything else on the planet.)

Instead, it gives you a "RESET TIME" within the file, and the lines after that show how much time has passed since that time. "RESET" times mostly appear just once at the beginning, sometimes however they appear multiple times within the log, sometimes even skipping hours, seemingly at random.

And as if that isn't bad enough.. Let me just show a real-life example:

adb shell dumpsys batterystats


Gives me (among other things of course) this:

                0 (9) RESET:TIME: 2020-01-29-01-37-39


Good. So the time starts at 2020-01-29-01-37-39. Alright. Only reset time in the output.

I just turned the screen on. Here is the entry in the log for that:

      +21h44m19s484ms (4) 057 +wake_lock=1000:"PhoneWindowManager.mPowerKeyWakeLock" +screen screenwake=1000:"android.policy:POWER"


Great. +21h44m19s. It is now (well, it was when this happened) 2020-01-30-00-16-00.

"RESET" time of 2020-01-29-01-37-39 + 21h44m19s = 2020-01-29-23-21-58.  ?????



Okay, down to my actual questions:


Why does dumpsys batterystats not use normal timestamps?
How does one read those timestamps? They seem beyond broken.
Is there a way to change it to "normal" timestamps?




(My goal is to track when exactly the screen (and optionally WiFi) was on and when it was off. If there is any other way to do that besides batterystats, please leave a comment.)
This is a partial answer that needs more details through the full dump to understand whats the and read the output of what the system is trying to convey.

The data unit is a number taken from the following list:
 1: Number of objects
 2: Number of bytes
 3: Number of milliseconds
 4: Number of allocations
 5: Id
 6: Percent
 s: Number of seconds (monotonic time)
 Default value for data of type int/long is 2 (bytes).

Breaks down to what I think is:

The data unit is a number taken from the following list:

1: Number of objects = (4)

2: Number of bytes {057}

3: Number of milliseconds. +21h44m19s484ms wake_lock=1000 screen screenwake=1000

4: Number of allocations wake_lock=1000, screen screenwake=1000

5: Id. android.policy:POWER

6: Percent
 s: Number of seconds (monotonic time)
 Default value for data of type int/long is 2 (bytes).

https://android.googlesource.com/platform/system/core/+/master/logcat/event.logtags

The time value starts at boot to current breaking the time down to.

+21h44m19s484ms
First the time since thw device was bopted and reads like:

21h is 21 hours.

44m is 44 minutes

19s is 19 seconds

484ms is 484 milliseconds.

However there is more going on since it reads line by line meaning one line is not the complete story. In order to understand whats going on the full log or dump is crucially needed.