diff options
author | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 22:33:29 +0000 |
---|---|---|
committer | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-07 22:33:29 +0000 |
commit | cf7ae1da85019386a02d9cab9f90703e754dfdec (patch) | |
tree | 38ae6d5fa7854b5812f977b933e90d016105ed79 /build | |
parent | eb1671d53bf67c22cb6d5c8e37d113d8ba96721e (diff) | |
download | chromium_src-cf7ae1da85019386a02d9cab9f90703e754dfdec.zip chromium_src-cf7ae1da85019386a02d9cab9f90703e754dfdec.tar.gz chromium_src-cf7ae1da85019386a02d9cab9f90703e754dfdec.tar.bz2 |
[telemetry] Fix Android surface statistics collector
On Android we ask SurfaceFlinger about frame presentation times to
estimate metrics such as frame rate and jitter. This data is recorded on
a per-window basis. For applications that use SurfaceView, the
statistics are reported separately for the main application window and
the contained SurfaceView. Since we mainly care about the rendering
performance of web content, we should track the statistics for the
SurfaceView instead of the main Chrome window.
BUG=http://b/8254709
Review URL: https://chromiumcodereview.appspot.com/12432006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186801 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/android/pylib/surface_stats_collector.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/build/android/pylib/surface_stats_collector.py b/build/android/pylib/surface_stats_collector.py index cf5a280..8d8c992 100644 --- a/build/android/pylib/surface_stats_collector.py +++ b/build/android/pylib/surface_stats_collector.py @@ -17,17 +17,13 @@ _SURFACE_TEXTURE_TIMESTAMP_RE = '\d+' class SurfaceStatsCollector(object): - """Collects surface stats for a window from the output of SurfaceFlinger. + """Collects surface stats for a SurfaceView from the output of SurfaceFlinger. Args: - adb: the adb coonection to use. - window_package: Package name of the window. - window_activity: Activity name of the window. + adb: the adb connection to use. """ - def __init__(self, adb, window_package, window_activity, trace_tag): + def __init__(self, adb, trace_tag): self._adb = adb - self._window_package = window_package - self._window_activity = window_activity self._trace_tag = trace_tag self._collector_thread = None self._use_legacy_method = False @@ -151,8 +147,7 @@ class SurfaceStatsCollector(object): # The command returns nothing if it is supported, otherwise returns many # lines of result just like 'dumpsys SurfaceFlinger'. results = self._adb.RunShellCommand( - 'dumpsys SurfaceFlinger --latency-clear %s/%s' % - (self._window_package, self._window_activity)) + 'dumpsys SurfaceFlinger --latency-clear SurfaceView') return not len(results) def _GetSurfaceFlingerLatencyData(self, previous_timestamp, latencies): @@ -196,9 +191,12 @@ class SurfaceStatsCollector(object): # (each time the number above changes, we have a "jank"). # If this happens a lot during an animation, the animation appears # janky, even if it runs at 60 fps in average. + # + # We use the special "SurfaceView" window name because the statistics for + # the activity's main window are not updated when the main web content is + # composited into a SurfaceView. results = self._adb.RunShellCommand( - 'dumpsys SurfaceFlinger --latency %s/%s' % - (self._window_package, self._window_activity), log_result=True) + 'dumpsys SurfaceFlinger --latency SurfaceView', log_result=True) if not len(results): return (None, None) |