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

Side by Side Diff: build/android/bb_run_sharded_steps.py

Issue 22680002: Android: uses settask to enable CPU affinity for ADB. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # 2 #
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Helper script to shard build bot steps and save results to disk. 7 """Helper script to shard build bot steps and save results to disk.
8 8
9 Our buildbot infrastructure requires each slave to run steps serially. 9 Our buildbot infrastructure requires each slave to run steps serially.
10 This is sub-optimal for android, where these steps can run independently on 10 This is sub-optimal for android, where these steps can run independently on
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 for retry in range(5): 168 for retry in range(5):
169 for server in ['lighttpd', 'web-page-replay']: 169 for server in ['lighttpd', 'web-page-replay']:
170 pids = cmd_helper.GetCmdOutput(['pgrep', '-f', server]) 170 pids = cmd_helper.GetCmdOutput(['pgrep', '-f', server])
171 pids = [pid.strip() for pid in pids.split('\n') if pid.strip()] 171 pids = [pid.strip() for pid in pids.split('\n') if pid.strip()]
172 for pid in pids: 172 for pid in pids:
173 try: 173 try:
174 logging.warning('Killing %s %s', server, pid) 174 logging.warning('Killing %s %s', server, pid)
175 os.kill(int(pid), signal.SIGQUIT) 175 os.kill(int(pid), signal.SIGQUIT)
176 except Exception as e: 176 except Exception as e:
177 logging.warning('Failed killing %s %s %s', server, pid, e) 177 logging.warning('Failed killing %s %s %s', server, pid, e)
178 # Restart the adb server with full trace, and redirect stderr to stdout 178 # Restart the adb server with taskset to set a single CPU affinity.
179 # so the extra tracing won't confuse higher up layers.
180 os.environ['ADB_TRACE'] = 'all'
181 cmd_helper.RunCmd(['adb', 'kill-server']) 179 cmd_helper.RunCmd(['adb', 'kill-server'])
182 cmd_helper.RunCmd(['adb', 'start-server']) 180 cmd_helper.RunCmd(['taskset', '-c', '1', 'adb', 'start-server'])
frankf 2013/08/08 21:38:09 why not -c 0?
bulach 2013/08/09 09:15:47 my bad, I was confused by "man taskset": it says f
183 cmd_helper.RunCmd(['adb', 'root']) 181 cmd_helper.RunCmd(['adb', 'root'])
184 i = 1 182 i = 1
185 while not android_commands.GetAttachedDevices(): 183 while not android_commands.GetAttachedDevices():
186 time.sleep(i) 184 time.sleep(i)
187 i *= 2 185 i *= 2
188 if i > 10: 186 if i > 10:
189 break 187 break
190 188
191 189
192 def main(argv): 190 def main(argv):
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 steps = json.load(f) 228 steps = json.load(f)
231 flaky_steps = [] 229 flaky_steps = []
232 if options.flaky_steps: 230 if options.flaky_steps:
233 with file(options.flaky_steps, 'r') as f: 231 with file(options.flaky_steps, 'r') as f:
234 flaky_steps = json.load(f) 232 flaky_steps = json.load(f)
235 return _RunShardedSteps(steps, flaky_steps, devices) 233 return _RunShardedSteps(steps, flaky_steps, devices)
236 234
237 235
238 if __name__ == '__main__': 236 if __name__ == '__main__':
239 sys.exit(main(sys.argv)) 237 sys.exit(main(sys.argv))
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698