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

Side by Side Diff: build/android/tombstones.py

Issue 1088793002: [Android] Remove android_commands uses from build/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: docstrings for device_filter.py Created 5 years, 8 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 | « build/android/screenshot.py ('k') | build/android/update_verification.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 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright 2013 The Chromium Authors. All rights reserved. 3 # Copyright 2013 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 # 6 #
7 # Find the most recent tombstone file(s) on all connected devices 7 # Find the most recent tombstone file(s) on all connected devices
8 # and prints their stacks. 8 # and prints their stacks.
9 # 9 #
10 # Assumes tombstone file was created with current symbols. 10 # Assumes tombstone file was created with current symbols.
11 11
12 import datetime 12 import datetime
13 import itertools 13 import itertools
14 import logging 14 import logging
15 import multiprocessing 15 import multiprocessing
16 import os 16 import os
17 import re 17 import re
18 import subprocess 18 import subprocess
19 import sys 19 import sys
20 import optparse 20 import optparse
21 21
22 from pylib import android_commands 22 from pylib.device import adb_wrapper
23 from pylib.device import device_errors 23 from pylib.device import device_errors
24 from pylib.device import device_filter
24 from pylib.device import device_utils 25 from pylib.device import device_utils
25 from pylib.utils import run_tests_helper 26 from pylib.utils import run_tests_helper
26 27
27 28
28 _TZ_UTC = {'TZ': 'UTC'} 29 _TZ_UTC = {'TZ': 'UTC'}
29 30
30 def _ListTombstones(device): 31 def _ListTombstones(device):
31 """List the tombstone files on the device. 32 """List the tombstone files on the device.
32 33
33 Args: 34 Args:
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 help='Erase all tombstones from device after processing') 229 help='Erase all tombstones from device after processing')
229 parser.add_option('-j', '--jobs', type='int', 230 parser.add_option('-j', '--jobs', type='int',
230 default=4, 231 default=4,
231 help='Number of jobs to use when processing multiple ' 232 help='Number of jobs to use when processing multiple '
232 'crash stacks.') 233 'crash stacks.')
233 options, _ = parser.parse_args() 234 options, _ = parser.parse_args()
234 235
235 if options.device: 236 if options.device:
236 devices = [options.device] 237 devices = [options.device]
237 else: 238 else:
238 devices = android_commands.GetAttachedDevices() 239 devices = adb_wrapper.AdbWrapper.Devices(
240 filters=device_filter.DefaultFilters())
239 241
240 # This must be done serially because strptime can hit a race condition if 242 # This must be done serially because strptime can hit a race condition if
241 # used for the first time in a multithreaded environment. 243 # used for the first time in a multithreaded environment.
242 # http://bugs.python.org/issue7980 244 # http://bugs.python.org/issue7980
243 tombstones = [] 245 tombstones = []
244 for device_serial in devices: 246 for adb in devices:
245 device = device_utils.DeviceUtils(device_serial) 247 device = device_utils.DeviceUtils(adb)
246 tombstones += _GetTombstonesForDevice(device, options) 248 tombstones += _GetTombstonesForDevice(device, options)
247 249
248 _ResolveTombstones(options.jobs, tombstones) 250 _ResolveTombstones(options.jobs, tombstones)
249 251
250 if __name__ == '__main__': 252 if __name__ == '__main__':
251 sys.exit(main()) 253 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/screenshot.py ('k') | build/android/update_verification.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698