Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(100)

Side by Side Diff: build/android/tombstones.py

Issue 806843002: Reland of Migrate DeviceUtils.ReadFile to adb_wrapper (try 3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: enable command line test only for android Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 def _GetTombstoneData(device, tombstone_file): 56 def _GetTombstoneData(device, tombstone_file):
57 """Retrieve the tombstone data from the device 57 """Retrieve the tombstone data from the device
58 58
59 Args: 59 Args:
60 device: An instance of DeviceUtils. 60 device: An instance of DeviceUtils.
61 tombstone_file: the tombstone to retrieve 61 tombstone_file: the tombstone to retrieve
62 62
63 Returns: 63 Returns:
64 A list of lines 64 A list of lines
65 """ 65 """
66 return device.ReadFile('/data/tombstones/' + tombstone_file, as_root=True) 66 return device.ReadFile(
67 '/data/tombstones/' + tombstone_file, as_root=True).splitlines()
67 68
68 69
69 def _EraseTombstone(device, tombstone_file): 70 def _EraseTombstone(device, tombstone_file):
70 """Deletes a tombstone from the device. 71 """Deletes a tombstone from the device.
71 72
72 Args: 73 Args:
73 device: An instance of DeviceUtils. 74 device: An instance of DeviceUtils.
74 tombstone_file: the tombstone to delete. 75 tombstone_file: the tombstone to delete.
75 """ 76 """
76 return device.RunShellCommand( 77 return device.RunShellCommand(
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 214
214 tombstones = [] 215 tombstones = []
215 for device_serial in devices: 216 for device_serial in devices:
216 device = device_utils.DeviceUtils(device_serial) 217 device = device_utils.DeviceUtils(device_serial)
217 tombstones += _GetTombstonesForDevice(device, options) 218 tombstones += _GetTombstonesForDevice(device, options)
218 219
219 _ResolveTombstones(options.jobs, tombstones) 220 _ResolveTombstones(options.jobs, tombstones)
220 221
221 if __name__ == '__main__': 222 if __name__ == '__main__':
222 sys.exit(main()) 223 sys.exit(main())
OLDNEW
« no previous file with comments | « build/android/pylib/perf/thermal_throttle.py ('k') | tools/telemetry/telemetry/core/backends/android_command_line_backend.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698