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

Unified Diff: build/android/tombstones.py

Issue 2231693002: Revert of Added tombstones in instrumentation tests results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/android/test_runner.pydeps ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/tombstones.py
diff --git a/build/android/tombstones.py b/build/android/tombstones.py
index 3da7dce353468d11fc055a4f0f3e2f7625669b83..712f90fac81dd3f51d2e6906f684388c1b2bd896 100755
--- a/build/android/tombstones.py
+++ b/build/android/tombstones.py
@@ -165,21 +165,17 @@
else:
pool = multiprocessing.Pool(processes=jobs)
data = pool.map(_ResolveTombstone, tombstones)
- resolved_tombstones = []
for tombstone in data:
- resolved_tombstones.extend(tombstone)
- return resolved_tombstones
-
-def _GetTombstonesForDevice(device, resolve_all_tombstones,
- include_stack_symbols,
- wipe_tombstones):
+ for line in tombstone:
+ logging.info(line)
+
+
+def _GetTombstonesForDevice(device, args):
"""Returns a list of tombstones on a given device.
Args:
device: An instance of DeviceUtils.
- resolve_all_tombstone: Whether to resolve every tombstone.
- include_stack_symbols: Whether to include symbols for stack data.
- wipe_tombstones: Whether to wipe tombstones.
+ args: command line arguments
"""
ret = []
all_tombstones = list(_ListTombstones(device))
@@ -191,7 +187,7 @@
all_tombstones.sort(cmp=lambda a, b: cmp(b[1], a[1]))
# Only resolve the most recent unless --all-tombstones given.
- tombstones = all_tombstones if resolve_all_tombstones else [all_tombstones[0]]
+ tombstones = all_tombstones if args.all_tombstones else [all_tombstones[0]]
device_now = _GetDeviceDateTime(device)
try:
@@ -201,7 +197,7 @@
'device_now': device_now,
'time': tombstone_time,
'file': tombstone_file,
- 'stack': include_stack_symbols,
+ 'stack': args.stack,
'data': _GetTombstoneData(device, tombstone_file)}]
except device_errors.CommandFailedError:
for entry in device.StatDirectory(
@@ -210,41 +206,12 @@
raise
# Erase all the tombstones if desired.
- if wipe_tombstones:
+ if args.wipe_tombstones:
for tombstone_file, _ in all_tombstones:
_EraseTombstone(device, tombstone_file)
return ret
-def ClearAllTombstones(device):
- """Clear all tombstones in the device.
-
- Args:
- device: An instance of DeviceUtils.
- """
- all_tombstones = list(_ListTombstones(device))
- if not all_tombstones:
- logging.warning('No tombstones to clear.')
-
- for tombstone_file, _ in all_tombstones:
- _EraseTombstone(device, tombstone_file)
-
-def ResolveTombstones(device, resolve_all_tombstones, include_stack_symbols,
- wipe_tombstones, jobs=4):
- """Resolve tombstones in the device.
-
- Args:
- device: An instance of DeviceUtils.
- resolve_all_tombstone: Whether to resolve every tombstone.
- include_stack_symbols: Whether to include symbols for stack data.
- wipe_tombstones: Whether to wipe tombstones.
- jobs: Number of jobs to use when processing multiple crash stacks.
- """
- return _ResolveTombstones(jobs,
- _GetTombstonesForDevice(device,
- resolve_all_tombstones,
- include_stack_symbols,
- wipe_tombstones))
def main():
custom_handler = logging.StreamHandler(sys.stdout)
@@ -293,12 +260,12 @@
# This must be done serially because strptime can hit a race condition if
# used for the first time in a multithreaded environment.
# http://bugs.python.org/issue7980
+ tombstones = []
for device in devices:
- resolved_tombstones = ResolveTombstones(
- device, args.all_tombstones,
- args.stack, args.wipe_tombstones, args.jobs)
- for line in resolved_tombstones:
- logging.info(line)
+ tombstones += _GetTombstonesForDevice(device, args)
+
+ _ResolveTombstones(args.jobs, tombstones)
+
if __name__ == '__main__':
sys.exit(main())
« no previous file with comments | « build/android/test_runner.pydeps ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698