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

Side by Side Diff: tools/telemetry/telemetry/internal/platform/android_platform_backend.py

Issue 1366133002: [Telemetry] Test for display tracing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review fix Created 5 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/telemetry/telemetry/internal/platform/tracing_agent/display_tracing_agent_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import os 6 import os
7 import re 7 import re
8 import shutil 8 import shutil
9 import stat 9 import stat
10 import subprocess 10 import subprocess
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 # Clear any leftover data from previous timed out tests 221 # Clear any leftover data from previous timed out tests
222 self._raw_display_frame_rate_measurements = [] 222 self._raw_display_frame_rate_measurements = []
223 self._surface_stats_collector = \ 223 self._surface_stats_collector = \
224 surface_stats_collector.SurfaceStatsCollector(self._device) 224 surface_stats_collector.SurfaceStatsCollector(self._device)
225 self._surface_stats_collector.Start() 225 self._surface_stats_collector.Start()
226 226
227 def StopDisplayTracing(self): 227 def StopDisplayTracing(self):
228 if not self._surface_stats_collector: 228 if not self._surface_stats_collector:
229 return 229 return
230 230
231 refresh_period, timestamps = self._surface_stats_collector.Stop() 231 try:
232 pid = self._surface_stats_collector.GetSurfaceFlingerPid() 232 refresh_period, timestamps = self._surface_stats_collector.Stop()
233 self._surface_stats_collector = None 233 pid = self._surface_stats_collector.GetSurfaceFlingerPid()
234 finally:
235 self._surface_stats_collector = None
234 # TODO(sullivan): should this code be inline, or live elsewhere? 236 # TODO(sullivan): should this code be inline, or live elsewhere?
235 events = [] 237 events = []
236 for ts in timestamps: 238 for ts in timestamps:
237 events.append({ 239 events.append({
238 'cat': 'SurfaceFlinger', 240 'cat': 'SurfaceFlinger',
239 'name': 'vsync_before', 241 'name': 'vsync_before',
240 'ts': ts, 242 'ts': ts,
241 'pid': pid, 243 'pid': pid,
242 'tid': pid, 244 'tid': pid,
243 'args': {'data': { 245 'args': {'data': {
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
850 for process in psutil.process_iter(): 852 for process in psutil.process_iter():
851 try: 853 try:
852 if psutil.version_info >= (2, 0): 854 if psutil.version_info >= (2, 0):
853 if 'adb' in process.name(): 855 if 'adb' in process.name():
854 process.cpu_affinity([0]) 856 process.cpu_affinity([0])
855 else: 857 else:
856 if 'adb' in process.name: 858 if 'adb' in process.name:
857 process.set_cpu_affinity([0]) 859 process.set_cpu_affinity([0])
858 except (psutil.NoSuchProcess, psutil.AccessDenied): 860 except (psutil.NoSuchProcess, psutil.AccessDenied):
859 logging.warn('Failed to set adb process CPU affinity') 861 logging.warn('Failed to set adb process CPU affinity')
OLDNEW
« no previous file with comments | « no previous file | tools/telemetry/telemetry/internal/platform/tracing_agent/display_tracing_agent_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698