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

Unified Diff: build/android/pylib/device/adb_wrapper.py

Issue 724413003: Migrate device_utils.RestartServer to adb_wrapper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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/pylib/device/device_utils.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/device/adb_wrapper.py
diff --git a/build/android/pylib/device/adb_wrapper.py b/build/android/pylib/device/adb_wrapper.py
index 39fe706b0bc734262f5b82cf55cfe881660d14d7..094836a679d80c37acbcd09d5d30f1f744a7bd55 100644
--- a/build/android/pylib/device/adb_wrapper.py
+++ b/build/android/pylib/device/adb_wrapper.py
@@ -58,8 +58,12 @@ class AdbWrapper(object):
@classmethod
@decorators.WithTimeoutAndRetries
def _RunAdbCmd(cls, args, timeout=None, retries=None, device_serial=None,
- check_error=True):
- cmd = [constants.GetAdbPath()]
+ check_error=True, cpu_affinity=None):
jbudorick 2014/12/11 01:43:13 Probably doesn't surprise you to hear that I'm not
perezju 2014/12/11 11:38:00 Yeah, I don't like this too much either. But could
jbudorick 2014/12/11 16:27:17 Agreed.
+ if cpu_affinity is not None:
+ cmd = ['taskset', '-c', str(cpu_affinity)]
jbudorick 2014/12/11 01:43:13 How is this going to interact with _BuildAdbCmd in
perezju 2014/12/11 11:38:00 I think cpu_affinity (or something like that) woul
+ else:
+ cmd = []
+ cmd.append(constants.GetAdbPath())
if device_serial is not None:
cmd.extend(['-s', device_serial])
cmd.extend(args)
@@ -115,6 +119,16 @@ class AdbWrapper(object):
def __repr__(self):
return '%s(\'%s\')' % (self.__class__.__name__, self)
+ @classmethod
+ def KillServer(cls, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
+ cls._RunAdbCmd(['kill-server'], timeout=timeout, retries=retries)
+
+ @classmethod
+ def StartServer(cls, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
+ # CPU affinity is used to reduce adb instability http://crbug.com/268450
+ cls._RunAdbCmd(['start-server'], timeout=timeout, retries=retries,
+ cpu_affinity=0)
+
# TODO(craigdh): Determine the filter criteria that should be supported.
@classmethod
def GetDevices(cls, timeout=_DEFAULT_TIMEOUT, retries=_DEFAULT_RETRIES):
« no previous file with comments | « no previous file | build/android/pylib/device/device_utils.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698