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

Unified Diff: build/android/pylib/local/device/local_device_environment.py

Issue 2163833003: Logdog for logcats (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | build/android/test_runner.py » ('j') | tools/mb/mb.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/local/device/local_device_environment.py
diff --git a/build/android/pylib/local/device/local_device_environment.py b/build/android/pylib/local/device/local_device_environment.py
index 178e2f18a3e0337fd35eebfda4f8af02ed009c28..53e9566fed3dd6fd8cb051fc6f96785b3e327564 100644
--- a/build/android/pylib/local/device/local_device_environment.py
+++ b/build/android/pylib/local/device/local_device_environment.py
@@ -14,6 +14,7 @@ from devil.android import device_errors
from devil.android import device_list
from devil.android import device_utils
from devil.android import logcat_monitor
+from devil.utils import cmd_helper
from devil.utils import file_utils
from devil.utils import parallelizer
from pylib import constants
@@ -44,6 +45,8 @@ class LocalDeviceEnvironment(environment.Environment):
self._skip_clear_data = args.skip_clear_data
self._target_devices_file = args.target_devices_file
self._tool_name = args.tool
+ self._logdog_command = args.logdog_command.split()
+ self._logdog_stream = args.logdog_stream.split()
#override
def SetUp(self):
@@ -125,14 +128,31 @@ class LocalDeviceEnvironment(environment.Environment):
with open(cache_path, 'w') as f:
f.write(d.DumpCacheData())
logging.info('Wrote device cache: %s', cache_path)
+ logging.info('Adding device serials to logcats')
for m in self._logcat_monitors:
m.Stop()
m.Close()
+ add_device_args = ['sed', '-i', '-e',
+ 's/^/device({0}) /'.
+ format(m._adb.GetDeviceSerial()),
nicholaslin 2016/07/20 03:04:13 I'll change this to m.get_device_serial or somethi
+ m.output_file]
+ cmd_helper.RunCmd(add_device_args)
if self._logcat_output_file:
file_utils.MergeFiles(
self._logcat_output_file,
[m.output_file for m in self._logcat_monitors])
shutil.rmtree(self._logcat_output_dir)
+ if self._logdog_command and self._logdog_stream:
nicholaslin 2016/07/20 03:04:13 As of right now I don't have a good way to make lo
+ logging.info('NOTE: outputs below are specific to logdog.')
+ task = str(os.environ['SWARMING_TASK_ID'])
+ prefix = ['-prefix', 'swarming/{0}/logcats'.format(task)]
+ cmd = self._logdog_command + prefix + self._logdog_stream
+ cmd_helper.RunCmd(cmd)
+ url_prefix = prefix[1].replace('/', '%2F')
+ suffix = self._logdog_stream[-1]
+ url_suffix = 'file:{0}'.format(suffix.replace('/', '_'))
+ url = 'https://luci-logdog.appspot.com/v/?s=chromium%2F{0}%2F%2B%2F{1}'.format(url_prefix, url_suffix)
+ logging.info('Logcats are at %s', url)
def BlacklistDevice(self, device, reason='local_device_failure'):
device_serial = device.adb.GetDeviceSerial()
« no previous file with comments | « no previous file | build/android/test_runner.py » ('j') | tools/mb/mb.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698