| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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('/data/tombstones/' + tombstone_file, as_root=True) | 66 return device.ReadFile( |
| 67 '/data/tombstones/' + tombstone_file, as_root=True).splitlines() |
| 67 | 68 |
| 68 | 69 |
| 69 def _EraseTombstone(device, tombstone_file): | 70 def _EraseTombstone(device, tombstone_file): |
| 70 """Deletes a tombstone from the device. | 71 """Deletes a tombstone from the device. |
| 71 | 72 |
| 72 Args: | 73 Args: |
| 73 device: An instance of DeviceUtils. | 74 device: An instance of DeviceUtils. |
| 74 tombstone_file: the tombstone to delete. | 75 tombstone_file: the tombstone to delete. |
| 75 """ | 76 """ |
| 76 return device.RunShellCommand( | 77 return device.RunShellCommand( |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 214 |
| 214 tombstones = [] | 215 tombstones = [] |
| 215 for device_serial in devices: | 216 for device_serial in devices: |
| 216 device = device_utils.DeviceUtils(device_serial) | 217 device = device_utils.DeviceUtils(device_serial) |
| 217 tombstones += _GetTombstonesForDevice(device, options) | 218 tombstones += _GetTombstonesForDevice(device, options) |
| 218 | 219 |
| 219 _ResolveTombstones(options.jobs, tombstones) | 220 _ResolveTombstones(options.jobs, tombstones) |
| 220 | 221 |
| 221 if __name__ == '__main__': | 222 if __name__ == '__main__': |
| 222 sys.exit(main()) | 223 sys.exit(main()) |
| OLD | NEW |