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. |
11 | 11 |
12 import datetime | 12 import datetime |
13 import logging | |
14 import multiprocessing | 13 import multiprocessing |
15 import os | 14 import os |
16 import subprocess | 15 import subprocess |
17 import sys | 16 import sys |
18 import optparse | 17 import optparse |
19 | 18 |
20 from pylib import android_commands | 19 from pylib import android_commands |
21 | 20 |
22 | 21 |
23 def _ListTombstones(adb): | 22 def _ListTombstones(adb): |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 help="""Resolve symbols for all tombstones, rather than just | 169 help="""Resolve symbols for all tombstones, rather than just |
171 the most recent""") | 170 the most recent""") |
172 parser.add_option('-s', '--stack', action='store_true', | 171 parser.add_option('-s', '--stack', action='store_true', |
173 help='Also include symbols for stack data') | 172 help='Also include symbols for stack data') |
174 parser.add_option('-w', '--wipe-tombstones', action='store_true', | 173 parser.add_option('-w', '--wipe-tombstones', action='store_true', |
175 help='Erase all tombstones from device after processing') | 174 help='Erase all tombstones from device after processing') |
176 parser.add_option('-j', '--jobs', type='int', | 175 parser.add_option('-j', '--jobs', type='int', |
177 default=4, | 176 default=4, |
178 help='Number of jobs to use when processing multiple ' | 177 help='Number of jobs to use when processing multiple ' |
179 'crash stacks.') | 178 'crash stacks.') |
180 options, args = parser.parse_args() | 179 options, _ = parser.parse_args() |
181 | 180 |
182 if options.device: | 181 if options.device: |
183 devices = [options.device] | 182 devices = [options.device] |
184 else: | 183 else: |
185 devices = android_commands.GetAttachedDevices() | 184 devices = android_commands.GetAttachedDevices() |
186 | 185 |
187 tombstones = [] | 186 tombstones = [] |
188 for device in devices: | 187 for device in devices: |
189 adb = android_commands.AndroidCommands(device) | 188 adb = android_commands.AndroidCommands(device) |
190 tombstones += _GetTombstonesForDevice(adb, options) | 189 tombstones += _GetTombstonesForDevice(adb, options) |
191 | 190 |
192 _ResolveTombstones(options.jobs, tombstones) | 191 _ResolveTombstones(options.jobs, tombstones) |
193 | 192 |
194 if __name__ == '__main__': | 193 if __name__ == '__main__': |
195 sys.exit(main()) | 194 sys.exit(main()) |
OLD | NEW |