| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 return ret | 143 return ret |
| 144 | 144 |
| 145 # Sort the tombstones in date order, descending | 145 # Sort the tombstones in date order, descending |
| 146 all_tombstones.sort(cmp=lambda a, b: cmp(b[1], a[1])) | 146 all_tombstones.sort(cmp=lambda a, b: cmp(b[1], a[1])) |
| 147 | 147 |
| 148 # Only resolve the most recent unless --all-tombstones given. | 148 # Only resolve the most recent unless --all-tombstones given. |
| 149 tombstones = all_tombstones if options.all_tombstones else [all_tombstones[0]] | 149 tombstones = all_tombstones if options.all_tombstones else [all_tombstones[0]] |
| 150 | 150 |
| 151 device_now = _GetDeviceDateTime(device) | 151 device_now = _GetDeviceDateTime(device) |
| 152 for tombstone_file, tombstone_time in tombstones: | 152 for tombstone_file, tombstone_time in tombstones: |
| 153 ret += [{'serial': device.old_interface.Adb().GetSerialNumber(), | 153 ret += [{'serial': str(device), |
| 154 'device_now': device_now, | 154 'device_now': device_now, |
| 155 'time': tombstone_time, | 155 'time': tombstone_time, |
| 156 'file': tombstone_file, | 156 'file': tombstone_file, |
| 157 'stack': options.stack, | 157 'stack': options.stack, |
| 158 'data': _GetTombstoneData(device, tombstone_file)}] | 158 'data': _GetTombstoneData(device, tombstone_file)}] |
| 159 | 159 |
| 160 # Erase all the tombstones if desired. | 160 # Erase all the tombstones if desired. |
| 161 if options.wipe_tombstones: | 161 if options.wipe_tombstones: |
| 162 for tombstone_file, _ in all_tombstones: | 162 for tombstone_file, _ in all_tombstones: |
| 163 _EraseTombstone(device, tombstone_file) | 163 _EraseTombstone(device, tombstone_file) |
| (...skipping 25 matching lines...) Expand all Loading... |
| 189 | 189 |
| 190 tombstones = [] | 190 tombstones = [] |
| 191 for device_serial in devices: | 191 for device_serial in devices: |
| 192 device = device_utils.DeviceUtils(device_serial) | 192 device = device_utils.DeviceUtils(device_serial) |
| 193 tombstones += _GetTombstonesForDevice(device, options) | 193 tombstones += _GetTombstonesForDevice(device, options) |
| 194 | 194 |
| 195 _ResolveTombstones(options.jobs, tombstones) | 195 _ResolveTombstones(options.jobs, tombstones) |
| 196 | 196 |
| 197 if __name__ == '__main__': | 197 if __name__ == '__main__': |
| 198 sys.exit(main()) | 198 sys.exit(main()) |
| OLD | NEW |