| OLD | NEW |
| 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 Queue | 5 import Queue |
| 6 import datetime | |
| 7 import logging | |
| 8 import re | |
| 9 import threading | 6 import threading |
| 10 | 7 |
| 11 from devil.android import device_utils | |
| 12 | |
| 13 | 8 |
| 14 # Log marker containing SurfaceTexture timestamps. | 9 # Log marker containing SurfaceTexture timestamps. |
| 15 _SURFACE_TEXTURE_TIMESTAMPS_MESSAGE = 'SurfaceTexture update timestamps' | 10 _SURFACE_TEXTURE_TIMESTAMPS_MESSAGE = 'SurfaceTexture update timestamps' |
| 16 _SURFACE_TEXTURE_TIMESTAMP_RE = r'\d+' | 11 _SURFACE_TEXTURE_TIMESTAMP_RE = r'\d+' |
| 17 | 12 |
| 18 | 13 |
| 19 class SurfaceStatsCollector(object): | 14 class SurfaceStatsCollector(object): |
| 20 """Collects surface stats for a SurfaceView from the output of SurfaceFlinger. | 15 """Collects surface stats for a SurfaceView from the output of SurfaceFlinger. |
| 21 | 16 |
| 22 Args: | 17 Args: |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 fields = line.split() | 174 fields = line.split() |
| 180 if len(fields) != 3: | 175 if len(fields) != 3: |
| 181 continue | 176 continue |
| 182 timestamp = long(fields[1]) | 177 timestamp = long(fields[1]) |
| 183 if timestamp == pending_fence_timestamp: | 178 if timestamp == pending_fence_timestamp: |
| 184 continue | 179 continue |
| 185 timestamp /= nanoseconds_per_millisecond | 180 timestamp /= nanoseconds_per_millisecond |
| 186 timestamps.append(timestamp) | 181 timestamps.append(timestamp) |
| 187 | 182 |
| 188 return (refresh_period, timestamps) | 183 return (refresh_period, timestamps) |
| OLD | NEW |