Revert "Enable logcat logging for adb_host."
This reverts commit f21ef531bc634830a043d6b09e2976b571b56a71.
The reason is in the comment of patchset 9
Change-Id: If0b463e6d2d4b3d48b0454195a1c6eabde9b1b59
Reviewed-on: https://chromium-review.googlesource.com/348030
Reviewed-by: Dan Shi <dshi@google.com>
Commit-Queue: Dan Shi <dshi@google.com>
Tested-by: Dan Shi <dshi@google.com>
diff --git a/server/hosts/adb_host.py b/server/hosts/adb_host.py
index b4ea0ca..282d3d4 100644
--- a/server/hosts/adb_host.py
+++ b/server/hosts/adb_host.py
@@ -1,7 +1,6 @@
# Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-import datetime
import functools
import logging
import os
@@ -56,8 +55,6 @@
CMD_OUTPUT_PREFIX)
RELEASE_FILE = 'ro.build.version.release'
BOARD_FILE = 'ro.product.device'
-SDK_FILE = 'ro.build.version.sdk'
-LOGCAT_FILE = 'logcat.log'
TMP_DIR = '/data/local/tmp'
# Regex to pull out file type, perms and symlink. Example:
# lrwxrwx--- 1 6 root system 2015-09-12 19:21 blah_link -> ./blah
@@ -401,14 +398,11 @@
def job_start(self):
- """Overload of parent which intentionally doesn't log certain files.
-
- The parent implementation attempts to log certain Linux files, such as
- /var/log, which do not exist on Android, thus there is no call to the
- parent's job_start(). The sync call is made so that logcat logs can be
- approximately matched to server logs.
"""
- self._sync_time()
+ Disable log collection on adb_hosts.
+
+ TODO(sbasi): crbug.com/305427
+ """
def run(self, command, timeout=3600, ignore_status=False,
@@ -682,18 +676,6 @@
return bool(devices and (not serial or serial in devices))
- def stop_loggers(self):
- """Inherited stop_loggers function.
-
- Calls parent function and captures logcat, since the end of the run
- is logically the end/stop of the logcat log.
- """
- super(ADBHost, self).stop_loggers()
- # Record the logcat file.
- logcat_logfilename = os.path.join(self.job.resultdir, LOGCAT_FILE)
- self.adb_run('logcat -v time -d > "%s"' % (logcat_logfilename))
-
-
def close(self):
"""Close the ADBHost object.
@@ -1589,22 +1571,3 @@
'build_id': build_id})
return '%s/static/%s/%s' % (ds.url(), image,
autotest_server_package_name)
-
-
- def _sync_time(self):
- """Approximate synchronization of time between host and ADB device.
-
- This sets the ADB/Android device's clock to approximately the same
- time as the Autotest host for the purposes of comparing Android system
- logs such as logcat to logs from the Autotest host system.
- """
- command = 'date '
- sdk_version = int(self.run('getprop %s' % SDK_FILE).stdout)
- if sdk_version < 23:
- # Android L and earlier use this format: date -s (format).
- command += ('-s %s' %
- datetime.datetime.now().strftime('%Y%m%d.%H%M%S'))
- else:
- # Android M and later use this format: date (format).
- command += datetime.datetime.now().strftime('%m%d%H%M%Y.%S')
- self.run(command)