summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjbudorick <jbudorick@chromium.org>2015-03-18 18:14:05 -0700
committerCommit bot <commit-bot@chromium.org>2015-03-19 01:15:03 +0000
commit9711f05cc075e08f8ff1663e31309173f4e6a404 (patch)
tree2de454b09424ddc1c40c68ed63a2a4c5da0de585
parent12d25209ace521edb4840bdb18a618d5d7012fca (diff)
downloadchromium_src-9711f05cc075e08f8ff1663e31309173f4e6a404.zip
chromium_src-9711f05cc075e08f8ff1663e31309173f4e6a404.tar.gz
chromium_src-9711f05cc075e08f8ff1663e31309173f4e6a404.tar.bz2
Revert of [Android] Make failure to find tombstones nonfatal. (patchset #2 id:20001 of https://codereview.chromium.org/1002293004/)
Reason for revert: Looks like this is causing flaky failures on the CQ. Original issue's description: > [Android] Make failure to find tombstones nonfatal. > > BUG=467918 > > Committed: https://crrev.com/724e0baba29a167e97c119335eff476fa4437269 > Cr-Commit-Position: refs/heads/master@{#321219} TBR=klundberg@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=467918 Review URL: https://codereview.chromium.org/1004803008 Cr-Commit-Position: refs/heads/master@{#321259}
-rwxr-xr-xbuild/android/tombstones.py50
1 files changed, 20 insertions, 30 deletions
diff --git a/build/android/tombstones.py b/build/android/tombstones.py
index 5d9176a..9b8a8b2 100755
--- a/build/android/tombstones.py
+++ b/build/android/tombstones.py
@@ -10,8 +10,6 @@
# Assumes tombstone file was created with current symbols.
import datetime
-import itertools
-import logging
import multiprocessing
import os
import re
@@ -22,7 +20,6 @@ import optparse
from pylib import android_commands
from pylib.device import device_errors
from pylib.device import device_utils
-from pylib.utils import run_tests_helper
_TZ_UTC = {'TZ': 'UTC'}
@@ -36,18 +33,15 @@ def _ListTombstones(device):
Yields:
Tuples of (tombstone filename, date time of file on device).
"""
- try:
- lines = device.RunShellCommand(
- ['ls', '-a', '-l', '/data/tombstones'],
- as_root=True, check_return=True, env=_TZ_UTC, timeout=60)
- for line in lines:
- if 'tombstone' in line and not 'No such file or directory' in line:
- details = line.split()
- t = datetime.datetime.strptime(details[-3] + ' ' + details[-2],
- '%Y-%m-%d %H:%M')
- yield details[-1], t
- except device_errors.CommandFailedError:
- logging.exception('Could not retrieve tombstones.')
+ lines = device.RunShellCommand(
+ ['ls', '-a', '-l', '/data/tombstones'],
+ as_root=True, check_return=True, env=_TZ_UTC, timeout=60)
+ for line in lines:
+ if 'tombstone' in line and not 'No such file or directory' in line:
+ details = line.split()
+ t = datetime.datetime.strptime(details[-3] + ' ' + details[-2],
+ '%Y-%m-%d %H:%M')
+ yield details[-1], t
def _GetDeviceDateTime(device):
@@ -139,8 +133,8 @@ def _ResolveTombstone(tombstone):
', about this long ago: ' +
(str(tombstone['device_now'] - tombstone['time']) +
' Device: ' + tombstone['serial'])]
- logging.info('\n'.join(lines))
- logging.info('Resolving...')
+ print '\n'.join(lines)
+ print 'Resolving...'
lines += _ResolveSymbols(tombstone['data'], tombstone['stack'],
tombstone['device_abi'])
return lines
@@ -154,15 +148,15 @@ def _ResolveTombstones(jobs, tombstones):
tombstones: a list of tombstones.
"""
if not tombstones:
- logging.warning('No tombstones to resolve.')
+ print 'No device attached? Or no tombstones?'
return
if len(tombstones) == 1:
data = _ResolveTombstone(tombstones[0])
else:
pool = multiprocessing.Pool(processes=jobs)
data = pool.map(_ResolveTombstone, tombstones)
- for d in data:
- logging.info(d)
+ data = ['\n'.join(d) for d in data]
+ print '\n'.join(data)
def _GetTombstonesForDevice(device, options):
@@ -175,7 +169,7 @@ def _GetTombstonesForDevice(device, options):
ret = []
all_tombstones = list(_ListTombstones(device))
if not all_tombstones:
- logging.warning('No tombstones.')
+ print 'No device attached? Or no tombstones?'
return ret
# Sort the tombstones in date order, descending
@@ -198,7 +192,7 @@ def _GetTombstonesForDevice(device, options):
for line in device.RunShellCommand(
['ls', '-a', '-l', '/data/tombstones'],
as_root=True, check_return=True, env=_TZ_UTC, timeout=60):
- logging.info('%s: %s', str(device), line)
+ print '%s: %s' % (str(device), line)
raise
# Erase all the tombstones if desired.
@@ -210,11 +204,6 @@ def _GetTombstonesForDevice(device, options):
def main():
- custom_handler = logging.StreamHandler(sys.stdout)
- custom_handler.setFormatter(run_tests_helper.CustomFormatter())
- logging.getLogger().addHandler(custom_handler)
- logging.getLogger().setLevel(logging.INFO)
-
parser = optparse.OptionParser()
parser.add_option('--device',
help='The serial number of the device. If not specified '
@@ -237,9 +226,10 @@ def main():
else:
devices = android_commands.GetAttachedDevices()
- parallel_devices = device_utils.DeviceUtils.parallel(devices)
- tombstones = list(itertools.chain(
- *parallel_devices.pMap(_GetTombstonesForDevice, options).pGet(None)))
+ tombstones = []
+ for device_serial in devices:
+ device = device_utils.DeviceUtils(device_serial)
+ tombstones += _GetTombstonesForDevice(device, options)
_ResolveTombstones(options.jobs, tombstones)