OLD | NEW |
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. |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 parser.add_option('-s', '--stack', action='store_true', | 232 parser.add_option('-s', '--stack', action='store_true', |
233 help='Also include symbols for stack data') | 233 help='Also include symbols for stack data') |
234 parser.add_option('-w', '--wipe-tombstones', action='store_true', | 234 parser.add_option('-w', '--wipe-tombstones', action='store_true', |
235 help='Erase all tombstones from device after processing') | 235 help='Erase all tombstones from device after processing') |
236 parser.add_option('-j', '--jobs', type='int', | 236 parser.add_option('-j', '--jobs', type='int', |
237 default=4, | 237 default=4, |
238 help='Number of jobs to use when processing multiple ' | 238 help='Number of jobs to use when processing multiple ' |
239 'crash stacks.') | 239 'crash stacks.') |
240 options, _ = parser.parse_args() | 240 options, _ = parser.parse_args() |
241 | 241 |
| 242 devil_chromium.Initialize() |
| 243 |
242 blacklist = (device_blacklist.Blacklist(options.blacklist_file) | 244 blacklist = (device_blacklist.Blacklist(options.blacklist_file) |
243 if options.blacklist_file | 245 if options.blacklist_file |
244 else None) | 246 else None) |
245 | 247 |
246 devil_chromium.Initialize() | |
247 | |
248 if options.device: | 248 if options.device: |
249 devices = [device_utils.DeviceUtils(options.device)] | 249 devices = [device_utils.DeviceUtils(options.device)] |
250 else: | 250 else: |
251 devices = device_utils.DeviceUtils.HealthyDevices(blacklist) | 251 devices = device_utils.DeviceUtils.HealthyDevices(blacklist) |
252 | 252 |
253 # This must be done serially because strptime can hit a race condition if | 253 # This must be done serially because strptime can hit a race condition if |
254 # used for the first time in a multithreaded environment. | 254 # used for the first time in a multithreaded environment. |
255 # http://bugs.python.org/issue7980 | 255 # http://bugs.python.org/issue7980 |
256 tombstones = [] | 256 tombstones = [] |
257 for device in devices: | 257 for device in devices: |
258 tombstones += _GetTombstonesForDevice(device, options) | 258 tombstones += _GetTombstonesForDevice(device, options) |
259 | 259 |
260 _ResolveTombstones(options.jobs, tombstones) | 260 _ResolveTombstones(options.jobs, tombstones) |
261 | 261 |
262 | 262 |
263 if __name__ == '__main__': | 263 if __name__ == '__main__': |
264 sys.exit(main()) | 264 sys.exit(main()) |
OLD | NEW |