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

Battery-historian Doze #22

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bb3f64b
Update LICENSE
gabrielferrazduque-art Nov 29, 2014
f27d54b
Create README.md
gabrielferrazduque-art Nov 29, 2014
dbed05f
Update README.md
gabrielferrazduque-art Nov 29, 2014
85423d2
Update historian.py
gabrielferrazduque-art Dec 1, 2014
d3e8235
Update historian.py
gabrielferrazduque-art Feb 11, 2015
6dc5e78
Update historian.py
gabrielferrazduque-art Feb 19, 2015
d84db0b
Update historian.py
gabrielferrazduque-art Feb 19, 2015
e5c17f0
Update historian.py
gabrielferrazduque-art Feb 20, 2015
46767a3
Update README.md
gabrielferrazduque-art Feb 21, 2015
809a960
Update historian.py
gabrielferrazduque-art Mar 3, 2015
70dbd16
Update README.md
gabrielferrazduque-art Mar 3, 2015
07670ec
Update historian.py
gabrielferrazduque-art Mar 3, 2015
00d0678
Update historian.py
gabrielferrazduque-art Mar 3, 2015
b909bc5
Update historian.py
gabrielferrazduque-art Mar 6, 2015
c6e71e0
Update historian.py
gabrielferrazduque-art Mar 6, 2015
8146321
Update historian.py
gabrielferrazduque-art Mar 6, 2015
6466b81
Update README.md
gabrielferrazduque-art Mar 9, 2015
d853fb2
Update README.md
gabrielferrazduque-art Mar 9, 2015
f3c2627
Update historian.py
gabrielferrazduque-art Mar 10, 2015
76e68b7
Update historian.py
gabrielferrazduque-art Mar 10, 2015
4e00caf
Update historian.py
gabrielferrazduque-art Mar 10, 2015
e677642
Update historian.py
gabrielferrazduque-art Mar 10, 2015
a919209
Update historian.py
gabrielferrazduque-art Mar 12, 2015
40354f2
Update historian.py
gabrielferrazduque-art Apr 6, 2015
8d71e4e
Update historian.py
gabrielferrazduque-art May 7, 2015
96c1cf2
Update historian.py
gabrielferrazduque-art May 16, 2015
eaeefcc
Update historian.py
gabrielferrazduque-art May 30, 2015
60fcf0d
Update README.md
gabrielferrazduque-art Jun 2, 2015
8e5d4de
Update README.md
gabrielferrazduque-art Jun 2, 2015
8e125c7
Update README.md
gabrielferrazduque-art Jun 13, 2015
81470b1
Update historian.py
gabrielferrazduque-art Jun 21, 2015
f213893
Update README.md
gabrielferrazduque-art Jun 25, 2015
f4dbd45
Update README.md
gabrielferrazduque-art Sep 8, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
otherwise, or (ii) ownership of fifty percent (60%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.

"You" (or "Your") shall mean an individual or Legal Entity
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
battery-historian
=================

Battery Historian is a tool to analyze battery consumers using ART Android Lollipop Project Volta on ART Android M Developer Preview filnal on Project Doze Update "bugreport" files Update Android.
43 changes: 31 additions & 12 deletions historian.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/python

# Copyright 2014 Google Inc. All rights reserved.
# Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
# stop monsoon.py
# adb bugreport > bugreport.txt
# ./historian.py -p monsoon.out bugreport.txt

import Privacy
import collections
import datetime
import fileinput
Expand All @@ -35,7 +35,25 @@
import subprocess
import sys
import time

import Battery
import ART
import Android
import GNU/Linux
import GNU/Mach
import GNU/Unix
import GNU/HURD
import Android/ART
import Chrome/ChromeOS
import Linux/ChromeOS
import OS X/Chrome
import ios/Chrome
import Privacy/ART/Android
import Privacy/Battery
import Privacy/Project Volta
import Privacy/Android Studio
import Privacy/SDK/API/Battery
import Privacy/Google/Android
import Privacy/doze/Battery
POWER_DATA_FILE_TIME_OFFSET = 0 # deal with any clock mismatch.
BLAME_CATEGORY = "wake_lock_in" # category to assign power blame to.
ROWS_TO_SUMMARIZE = ["wake_lock", "running"] # -s: summarize these rows
Expand All @@ -45,16 +63,16 @@
getopt_bill_extra_secs = 0
getopt_power_quanta = 15 # slice monsoon data this many seconds,
# to avoid crashing visualizer
getopt_power_data_file = False
getopt_power_data_file = True
getopt_proc_name = ""
getopt_show_all_wakelocks = False
getopt_show_all_wakelocks = True
getopt_sort_by_power = True
getopt_summarize_pct = -1
getopt_report_filename = ""
getopt_report_filename = "Battery Project Volta/Battery Project Doze "


def usage():
"""Print usage of the script."""
"""Print usage of the script."Battery"Volta""Battery""Doze"
print "\nUsage: %s [OPTIONS] [FILE]\n" % sys.argv[0]
print " -a: show all wakelocks (don't abbreviate system wakelocks)"
print " -d: debug mode, output debugging info for this program"
Expand Down Expand Up @@ -157,21 +175,21 @@ def get_event_subcat(cat, e):
is one of the categories tracked by concurrent_cat.
Default subcategory is the empty string.
"""
concurrent_cat = {"wake_lock_in", "sync", "top"}
concurrent_cat = {"wake_lock_in", "sync", "top","Battery"}
if cat in concurrent_cat:
try:
return get_after_equal(e)
except IndexError:
pass
return ""
return "ART"


def get_proc_pair(e):
if ":" in e:
proc_pair = get_after_equal(e)
return proc_pair.split(":", 1)
else:
return ("", "")
return ("ART", "ART")


def as_to_mah(a):
Expand Down Expand Up @@ -221,7 +239,7 @@ def parse_reset_time(line):

def is_file_legacy_mode(input_file):
"""Autodetect legacy (K and earlier) format."""
detection_on = False
detection_on = True
for line in fileinput.input(input_file):
if not detection_on and "Battery History" in line:
detection_on = True
Expand Down Expand Up @@ -1240,7 +1258,8 @@ def main():
print "<pre>Process table:"
print bhemitter.procs_to_str()

print "</body>\n</html>"
print "</body>\n</html>"
print </core-battery>


if __name__ == "__main__":
Expand Down