| OLD | NEW |
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 Queue | 5 import Queue |
| 6 import datetime | 6 import datetime |
| 7 import logging | 7 import logging |
| 8 import re | 8 import re |
| 9 import threading | 9 import threading |
| 10 | 10 |
| 11 from pylib import perf_tests_helper | |
| 12 | |
| 13 | 11 |
| 14 # Log marker containing SurfaceTexture timestamps. | 12 # Log marker containing SurfaceTexture timestamps. |
| 15 _SURFACE_TEXTURE_TIMESTAMPS_MESSAGE = 'SurfaceTexture update timestamps' | 13 _SURFACE_TEXTURE_TIMESTAMPS_MESSAGE = 'SurfaceTexture update timestamps' |
| 16 _SURFACE_TEXTURE_TIMESTAMP_RE = '\d+' | 14 _SURFACE_TEXTURE_TIMESTAMP_RE = '\d+' |
| 17 | 15 |
| 18 | 16 |
| 19 class SurfaceStatsCollector(object): | 17 class SurfaceStatsCollector(object): |
| 20 """Collects surface stats for a SurfaceView from the output of SurfaceFlinger. | 18 """Collects surface stats for a SurfaceView from the output of SurfaceFlinger. |
| 21 | 19 |
| 22 Args: | 20 Args: |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 try: | 287 try: |
| 290 cur_surface = int(match.group(1), 16) | 288 cur_surface = int(match.group(1), 16) |
| 291 except Exception: | 289 except Exception: |
| 292 logging.error('Failed to parse current surface from ' + match.group(1)) | 290 logging.error('Failed to parse current surface from ' + match.group(1)) |
| 293 else: | 291 else: |
| 294 logging.warning('Failed to call SurfaceFlinger surface ' + results[0]) | 292 logging.warning('Failed to call SurfaceFlinger surface ' + results[0]) |
| 295 return { | 293 return { |
| 296 'page_flip_count': cur_surface, | 294 'page_flip_count': cur_surface, |
| 297 'timestamp': datetime.datetime.now(), | 295 'timestamp': datetime.datetime.now(), |
| 298 } | 296 } |
| OLD | NEW |