aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-11-05 07:33:41 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-11-05 07:33:41 +0000
commit667ca4d3bca5cd3ca7276333cb12e1585f3d2b99 (patch)
treea0d270e887be2f0d12f1a0fd552501230e69c169
parentf8d0e6306d3f7d60c17db4edf09cfe4465cccea0 (diff)
parentfb7e9e88e213df3593327fae0652ca98e68ea7c8 (diff)
downloadlisa-667ca4d3bca5cd3ca7276333cb12e1585f3d2b99.tar.gz
Snap for 4434599 from fb7e9e88e213df3593327fae0652ca98e68ea7c8 to pi-release
Change-Id: I5c2e3ac54d2e1d27ad849cb9ae98e1366cf54252
-rw-r--r--libs/utils/android/workloads/jankbench.py38
1 files changed, 34 insertions, 4 deletions
diff --git a/libs/utils/android/workloads/jankbench.py b/libs/utils/android/workloads/jankbench.py
index 96eedd0..a1d959d 100644
--- a/libs/utils/android/workloads/jankbench.py
+++ b/libs/utils/android/workloads/jankbench.py
@@ -34,6 +34,7 @@ _jankbench = {
'low_hitrate_text' : 3,
'high_hitrate_text' : 4,
'edit_text' : 5,
+ 'overdraw' : 6,
}
# Regexps for benchmark synchronization
@@ -44,10 +45,22 @@ JANKBENCH_BENCHMARK_START_RE = re.compile(
JANKBENCH_ITERATION_COUNT_RE = re.compile(
r'System.out: iteration: (?P<iteration>[0-9]+)'
)
+
+# Meaning of different jankbench metrics output in the logs:
+#
+# BAD FRAME STATS:
+# mean: Mean frame duration time of all frames that are > 12ms completion time
+# std_dev: Standard deviation of all frame times > 12ms completion time
+# count_bad: Total number of frames
+#
+# JANK FRAME STATS:
+# JankP: Percent of all total frames that missed their deadline (2*16ms for
+# tripple buffering, 16ms for double buffering).
+# count_jank: Total frames that missed their deadline (as described above).
JANKBENCH_ITERATION_METRICS_RE = re.compile(
- r'System.out: Mean: (?P<mean>[0-9\.]+)\s+JankP: (?P<junk_p>[0-9\.]+)\s+'
+ r'System.out: Mean: (?P<mean>[0-9\.]+)\s+JankP: (?P<jank_p>[0-9\.]+)\s+'
'StdDev: (?P<std_dev>[0-9\.]+)\s+Count Bad: (?P<count_bad>[0-9]+)\s+'
- 'Count Jank: (?P<count_junk>[0-9]+)'
+ 'Count Jank: (?P<count_jank>[0-9]+)'
)
JANKBENCH_BENCHMARK_DONE_RE = re.compile(
r'I BENCH\s+:\s+BenchmarkDone!'
@@ -76,6 +89,15 @@ class Jankbench(Workload):
# Package required by this workload
package = 'com.android.benchmark'
+ test_list = \
+ ['list_view',
+ 'image_list_view',
+ 'shadow_grid',
+ 'low_hitrate_text',
+ 'high_hitrate_text',
+ 'edit_text',
+ 'overdraw']
+
def __init__(self, test_env):
super(Jankbench, self).__init__(test_env)
self._log = logging.getLogger('Jankbench')
@@ -84,6 +106,9 @@ class Jankbench(Workload):
# Set of output data reported by Jankbench
self.db_file = None
+ def get_test_list(self):
+ return Jankbench.test_list
+
def run(self, out_dir, test_name, iterations, collect):
"""
Run Jankbench workload for a number of iterations.
@@ -117,6 +142,11 @@ class Jankbench(Workload):
except KeyError:
raise ValueError('Jankbench test [%s] not supported', test_name)
+ # Restart ADB in root mode - adb needs to run as root inorder to
+ # grab the db output file
+ self._log.info('Restarting ADB in root mode...')
+ self._target.adb_root(force=True)
+
# Unlock device screen (assume no password required)
Screen.unlock(self._target)
@@ -195,10 +225,10 @@ class Jankbench(Workload):
if match:
self._log.info(' Mean: %7.3f JankP: %7.3f StdDev: %7.3f Count Bad: %4d Count Jank: %4d',
float(match.group('mean')),
- float(match.group('junk_p')),
+ float(match.group('jank_p')),
float(match.group('std_dev')),
int(match.group('count_bad')),
- int(match.group('count_junk')))
+ int(match.group('count_jank')))
# Wait until the database file is available
db_adb = JANKBENCH_DB_PATH + JANKBENCH_DB_NAME