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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 def _GetTombstoneData(device, tombstone_file): | 55 def _GetTombstoneData(device, tombstone_file): |
56 """Retrieve the tombstone data from the device | 56 """Retrieve the tombstone data from the device |
57 | 57 |
58 Args: | 58 Args: |
59 device: An instance of DeviceUtils. | 59 device: An instance of DeviceUtils. |
60 tombstone_file: the tombstone to retrieve | 60 tombstone_file: the tombstone to retrieve |
61 | 61 |
62 Returns: | 62 Returns: |
63 A list of lines | 63 A list of lines |
64 """ | 64 """ |
65 return device.old_interface.GetProtectedFileContents( | 65 return device.ReadFile('/data/tombstones/' + tombstone_file, as_root=True) |
66 '/data/tombstones/' + tombstone_file) | |
67 | 66 |
68 | 67 |
69 def _EraseTombstone(device, tombstone_file): | 68 def _EraseTombstone(device, tombstone_file): |
70 """Deletes a tombstone from the device. | 69 """Deletes a tombstone from the device. |
71 | 70 |
72 Args: | 71 Args: |
73 device: An instance of DeviceUtils. | 72 device: An instance of DeviceUtils. |
74 tombstone_file: the tombstone to delete. | 73 tombstone_file: the tombstone to delete. |
75 """ | 74 """ |
76 return device.RunShellCommand( | 75 return device.RunShellCommand( |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 189 |
191 tombstones = [] | 190 tombstones = [] |
192 for device_serial in devices: | 191 for device_serial in devices: |
193 device = device_utils.DeviceUtils(device_serial) | 192 device = device_utils.DeviceUtils(device_serial) |
194 tombstones += _GetTombstonesForDevice(device, options) | 193 tombstones += _GetTombstonesForDevice(device, options) |
195 | 194 |
196 _ResolveTombstones(options.jobs, tombstones) | 195 _ResolveTombstones(options.jobs, tombstones) |
197 | 196 |
198 if __name__ == '__main__': | 197 if __name__ == '__main__': |
199 sys.exit(main()) | 198 sys.exit(main()) |
OLD | NEW |