| 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 | 166 |
| 167 # Sort the tombstones in date order, descending | 167 # Sort the tombstones in date order, descending |
| 168 all_tombstones.sort(cmp=lambda a, b: cmp(b[1], a[1])) | 168 all_tombstones.sort(cmp=lambda a, b: cmp(b[1], a[1])) |
| 169 | 169 |
| 170 # Only resolve the most recent unless --all-tombstones given. | 170 # Only resolve the most recent unless --all-tombstones given. |
| 171 tombstones = all_tombstones if options.all_tombstones else [all_tombstones[0]] | 171 tombstones = all_tombstones if options.all_tombstones else [all_tombstones[0]] |
| 172 | 172 |
| 173 device_now = _GetDeviceDateTime(device) | 173 device_now = _GetDeviceDateTime(device) |
| 174 for tombstone_file, tombstone_time in tombstones: | 174 for tombstone_file, tombstone_time in tombstones: |
| 175 ret += [{'serial': str(device), | 175 ret += [{'serial': str(device), |
| 176 'device_abi': device.GetProp('ro.product.cpu.abi'), | 176 'device_abi': device.product_cpu_abi, |
| 177 'device_now': device_now, | 177 'device_now': device_now, |
| 178 'time': tombstone_time, | 178 'time': tombstone_time, |
| 179 'file': tombstone_file, | 179 'file': tombstone_file, |
| 180 'stack': options.stack, | 180 'stack': options.stack, |
| 181 'data': _GetTombstoneData(device, tombstone_file)}] | 181 'data': _GetTombstoneData(device, tombstone_file)}] |
| 182 | 182 |
| 183 # Erase all the tombstones if desired. | 183 # Erase all the tombstones if desired. |
| 184 if options.wipe_tombstones: | 184 if options.wipe_tombstones: |
| 185 for tombstone_file, _ in all_tombstones: | 185 for tombstone_file, _ in all_tombstones: |
| 186 _EraseTombstone(device, tombstone_file) | 186 _EraseTombstone(device, tombstone_file) |
| (...skipping 26 matching lines...) Expand all Loading... |
| 213 | 213 |
| 214 tombstones = [] | 214 tombstones = [] |
| 215 for device_serial in devices: | 215 for device_serial in devices: |
| 216 device = device_utils.DeviceUtils(device_serial) | 216 device = device_utils.DeviceUtils(device_serial) |
| 217 tombstones += _GetTombstonesForDevice(device, options) | 217 tombstones += _GetTombstonesForDevice(device, options) |
| 218 | 218 |
| 219 _ResolveTombstones(options.jobs, tombstones) | 219 _ResolveTombstones(options.jobs, tombstones) |
| 220 | 220 |
| 221 if __name__ == '__main__': | 221 if __name__ == '__main__': |
| 222 sys.exit(main()) | 222 sys.exit(main()) |
| OLD | NEW |