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