Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(174)

Unified Diff: tools/telemetry/telemetry/core/platform/android_platform_backend.py

Issue 814813003: Added test that SurfaceFlinger metrics are calculated on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: PLEASE IGNORE: accidentally uploaded to wrong issue Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/core/platform/android_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/android_platform_backend.py b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
index 93e0cc0a14f3e5761b3bd258c883b4fac55bb725..f3f68361e01254b7f3d3a93993911efea099c40b 100644
--- a/tools/telemetry/telemetry/core/platform/android_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/android_platform_backend.py
@@ -24,7 +24,7 @@ from telemetry.core.platform.power_monitor import android_temperature_monitor
from telemetry.core.platform.power_monitor import monsoon_power_monitor
from telemetry.core.platform.power_monitor import power_monitor_controller
from telemetry.core.platform.profiler import android_prebuilt_profiler_helper
-from telemetry.timeline import surface_flinger_timeline_data
+from telemetry.timeline import trace_data as trace_data_module
from telemetry.util import exception_formatter
util.AddDirToPythonPath(util.GetChromiumSrcDir(),
@@ -119,8 +119,22 @@ class AndroidPlatformBackend(
refresh_period, timestamps = self._surface_stats_collector.Stop()
pid = self._surface_stats_collector.GetSurfaceFlingerPid()
self._surface_stats_collector = None
- return surface_flinger_timeline_data.SurfaceFlingerTimelineData(
- pid, refresh_period, timestamps)
+ # TODO(sullivan): should this code be inline, or live elsewhere?
+ events = []
+ for ts in timestamps:
+ events.append({
+ 'cat': 'SurfaceFlinger',
+ 'name': 'vsync_before',
+ 'ts': ts,
+ 'pid': pid,
+ 'tid': pid,
+ 'args': {'data': {
+ 'frame_count': 1,
+ 'refresh_period': refresh_period,
+ }}
+ })
+ return trace_data_module.TraceData({
+ trace_data_module.SURFACE_FLINGER_PART.raw_field_name: events})
def SetFullPerformanceModeEnabled(self, enabled):
if not self._enable_performance_mode:

Powered by Google App Engine
This is Rietveld 408576698