Commit 87f76187 authored by Matthew Cary's avatar Matthew Cary Committed by Commit Bot

Orderfile: dump logcat when command failed during profiling.

If an adb command fails during profiling, dump logcat through
logging.error. This will aid with debugging.

Bug: 898979
Change-Id: I4178579e2e69d5d43eb2b12b8eafad1c8038396f
Reviewed-on: https://chromium-review.googlesource.com/c/1317916Reviewed-by: default avatarEgor Pasko <pasko@chromium.org>
Reviewed-by: default avatarMatthew Cary <mattcary@chromium.org>
Commit-Queue: Matthew Cary <mattcary@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605474}
parent 98151dc3
......@@ -264,6 +264,7 @@ class AndroidProfileTool(object):
logging.info('Using pregenerated profiles instead of running profile')
logging.info('Profile files: %s', '\n'.join(self._pregenerated_profiles))
return self._pregenerated_profiles
self._device.adb.Logcat(clear=True)
self._Install(apk)
try:
changer = self._SetChromeFlags(package_info)
......@@ -274,6 +275,11 @@ class AndroidProfileTool(object):
self._RunProfileCollection(package_info, self._simulate_user)
else:
self._RunProfileCollection(package_info, self._simulate_user)
except device_errors.CommandFailedError as exc:
logging.error('Exception %s; dumping logcat', exc)
for logcat_line in self._device.adb.Logcat(dump=True):
logging.error(logcat_line)
raise
finally:
self._RestoreChromeFlags(changer)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment