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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 | 68 |
69 def _EraseTombstone(device, tombstone_file): | 69 def _EraseTombstone(device, tombstone_file): |
70 """Deletes a tombstone from the device. | 70 """Deletes a tombstone from the device. |
71 | 71 |
72 Args: | 72 Args: |
73 device: An instance of DeviceUtils. | 73 device: An instance of DeviceUtils. |
74 tombstone_file: the tombstone to delete. | 74 tombstone_file: the tombstone to delete. |
75 """ | 75 """ |
76 return device.RunShellCommand( | 76 return device.RunShellCommand( |
77 'rm /data/tombstones/' + tombstone_file, root=True) | 77 'rm /data/tombstones/' + tombstone_file, as_root=True) |
78 | 78 |
79 | 79 |
80 def _ResolveSymbols(tombstone_data, include_stack): | 80 def _ResolveSymbols(tombstone_data, include_stack): |
81 """Run the stack tool for given tombstone input. | 81 """Run the stack tool for given tombstone input. |
82 | 82 |
83 Args: | 83 Args: |
84 tombstone_data: a list of strings of tombstone data. | 84 tombstone_data: a list of strings of tombstone data. |
85 include_stack: boolean whether to include stack data in output. | 85 include_stack: boolean whether to include stack data in output. |
86 | 86 |
87 Yields: | 87 Yields: |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 190 |
191 tombstones = [] | 191 tombstones = [] |
192 for device_serial in devices: | 192 for device_serial in devices: |
193 device = device_utils.DeviceUtils(device_serial) | 193 device = device_utils.DeviceUtils(device_serial) |
194 tombstones += _GetTombstonesForDevice(device, options) | 194 tombstones += _GetTombstonesForDevice(device, options) |
195 | 195 |
196 _ResolveTombstones(options.jobs, tombstones) | 196 _ResolveTombstones(options.jobs, tombstones) |
197 | 197 |
198 if __name__ == '__main__': | 198 if __name__ == '__main__': |
199 sys.exit(main()) | 199 sys.exit(main()) |
OLD | NEW |