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

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

Issue 796013004: Revert of Reland of Migrate DeviceUtils.ReadFile to adb_wrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
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.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 def _GetTombstoneData(device, tombstone_file): 56 def _GetTombstoneData(device, tombstone_file):
57 """Retrieve the tombstone data from the device 57 """Retrieve the tombstone data from the device
58 58
59 Args: 59 Args:
60 device: An instance of DeviceUtils. 60 device: An instance of DeviceUtils.
61 tombstone_file: the tombstone to retrieve 61 tombstone_file: the tombstone to retrieve
62 62
63 Returns: 63 Returns:
64 A list of lines 64 A list of lines
65 """ 65 """
66 return device.ReadFile( 66 return device.ReadFile('/data/tombstones/' + tombstone_file, as_root=True)
67 '/data/tombstones/' + tombstone_file, as_root=True).splitlines()
68 67
69 68
70 def _EraseTombstone(device, tombstone_file): 69 def _EraseTombstone(device, tombstone_file):
71 """Deletes a tombstone from the device. 70 """Deletes a tombstone from the device.
72 71
73 Args: 72 Args:
74 device: An instance of DeviceUtils. 73 device: An instance of DeviceUtils.
75 tombstone_file: the tombstone to delete. 74 tombstone_file: the tombstone to delete.
76 """ 75 """
77 return device.RunShellCommand( 76 return device.RunShellCommand(
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 213
215 tombstones = [] 214 tombstones = []
216 for device_serial in devices: 215 for device_serial in devices:
217 device = device_utils.DeviceUtils(device_serial) 216 device = device_utils.DeviceUtils(device_serial)
218 tombstones += _GetTombstonesForDevice(device, options) 217 tombstones += _GetTombstonesForDevice(device, options)
219 218
220 _ResolveTombstones(options.jobs, tombstones) 219 _ResolveTombstones(options.jobs, tombstones)
221 220
222 if __name__ == '__main__': 221 if __name__ == '__main__':
223 sys.exit(main()) 222 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698