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

Side by Side Diff: tools/telemetry/telemetry/core/backends/adb_commands.py

Issue 52833002: Purge unpinned ashmem before parsing /proc/$pid/smaps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update documentation Created 7 years, 1 month 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
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 """Brings in Chrome Android's android_commands module, which itself is a 4 """Brings in Chrome Android's android_commands module, which itself is a
5 thin(ish) wrapper around adb.""" 5 thin(ish) wrapper around adb."""
6 6
7 import logging 7 import logging
8 import os 8 import os
9 import shutil 9 import shutil
10 import stat 10 import stat
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 has_prebuilt = abi and abi[0].startswith('armeabi') 181 has_prebuilt = abi and abi[0].startswith('armeabi')
182 if not has_prebuilt: 182 if not has_prebuilt:
183 logging.error('Prebuilt tools only available for ARM.') 183 logging.error('Prebuilt tools only available for ARM.')
184 return False 184 return False
185 185
186 prebuilt_tools = [ 186 prebuilt_tools = [
187 'forwarder_dist/device_forwarder', 187 'forwarder_dist/device_forwarder',
188 'host_forwarder', 188 'host_forwarder',
189 'md5sum_dist/md5sum_bin', 189 'md5sum_dist/md5sum_bin',
190 'md5sum_bin_host', 190 'md5sum_bin_host',
191 'purge_ashmem',
191 ] 192 ]
192 for t in prebuilt_tools: 193 for t in prebuilt_tools:
193 src = os.path.basename(t) 194 src = os.path.basename(t)
194 android_prebuilt_profiler_helper.GetIfChanged(src) 195 android_prebuilt_profiler_helper.GetIfChanged(src)
195 dest = os.path.join(constants.GetOutDirectory(), t) 196 dest = os.path.join(constants.GetOutDirectory(), t)
196 if not os.path.exists(dest): 197 if not os.path.exists(dest):
197 logging.warning('Setting up prebuilt %s', dest) 198 logging.warning('Setting up prebuilt %s', dest)
198 if not os.path.exists(os.path.dirname(dest)): 199 if not os.path.exists(os.path.dirname(dest)):
199 os.makedirs(os.path.dirname(dest)) 200 os.makedirs(os.path.dirname(dest))
200 shutil.copyfile(android_prebuilt_profiler_helper.GetHostPath(src), dest) 201 shutil.copyfile(android_prebuilt_profiler_helper.GetHostPath(src), dest)
(...skipping 29 matching lines...) Expand all
230 raise Exception('Build forwarder2') 231 raise Exception('Build forwarder2')
231 forwarder.Forwarder.Map(new_port_pairs, self._adb) 232 forwarder.Forwarder.Map(new_port_pairs, self._adb)
232 233
233 @property 234 @property
234 def url(self): 235 def url(self):
235 return 'http://127.0.0.1:%i' % self._host_port 236 return 'http://127.0.0.1:%i' % self._host_port
236 237
237 def Close(self): 238 def Close(self):
238 for (device_port, _) in self._port_pairs: 239 for (device_port, _) in self._port_pairs:
239 forwarder.Forwarder.UnmapDevicePort(device_port, self._adb) 240 forwarder.Forwarder.UnmapDevicePort(device_port, self._adb)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698