OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 | 4 |
5 import glob | 5 import glob |
6 import hashlib | 6 import hashlib |
7 import logging | 7 import logging |
8 import os | 8 import os |
9 import platform | 9 import platform |
10 import re | 10 import re |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
218 | 218 |
219 def PrepareDeviceForPerf(device): | 219 def PrepareDeviceForPerf(device): |
220 """Set up a device for running perf. | 220 """Set up a device for running perf. |
221 | 221 |
222 Args: | 222 Args: |
223 device: DeviceUtils instance identifying the target device. | 223 device: DeviceUtils instance identifying the target device. |
224 | 224 |
225 Returns: | 225 Returns: |
226 The path to the installed perf binary on the device. | 226 The path to the installed perf binary on the device. |
227 """ | 227 """ |
228 android_prebuilt_profiler_helper.InstallOnDevice(device, 'perf') | 228 perf_binary = 'perf_' + device.GetProp('ro.product.cpu.abi') |
tonyg
2014/10/10 16:51:14
This is a general problem, not specific to the per
pasko
2014/10/10 17:04:07
Oops, I also recently added perfhost_precise and p
| |
229 android_prebuilt_profiler_helper.InstallOnDevice(device, perf_binary) | |
229 # Make sure kernel pointers are not hidden. | 230 # Make sure kernel pointers are not hidden. |
230 device.WriteFile('/proc/sys/kernel/kptr_restrict', '0', as_root=True) | 231 device.WriteFile('/proc/sys/kernel/kptr_restrict', '0', as_root=True) |
231 return android_prebuilt_profiler_helper.GetDevicePath('perf') | 232 return android_prebuilt_profiler_helper.GetDevicePath(perf_binary) |
232 | 233 |
233 | 234 |
234 def GetToolchainBinaryPath(library_file, binary_name): | 235 def GetToolchainBinaryPath(library_file, binary_name): |
235 """Return the path to an Android toolchain binary on the host. | 236 """Return the path to an Android toolchain binary on the host. |
236 | 237 |
237 Args: | 238 Args: |
238 library_file: ELF library which is used to identify the used ABI, | 239 library_file: ELF library which is used to identify the used ABI, |
239 architecture and toolchain. | 240 architecture and toolchain. |
240 binary_name: Binary to search for, e.g., 'objdump' | 241 binary_name: Binary to search for, e.g., 'objdump' |
241 Returns: | 242 Returns: |
(...skipping 18 matching lines...) Expand all Loading... | |
260 return None | 261 return None |
261 toolchain_version = toolchain_version.group(1) | 262 toolchain_version = toolchain_version.group(1) |
262 | 263 |
263 path = os.path.join(util.GetChromiumSrcDir(), 'third_party', 'android_tools', | 264 path = os.path.join(util.GetChromiumSrcDir(), 'third_party', 'android_tools', |
264 'ndk', 'toolchains', | 265 'ndk', 'toolchains', |
265 '%s-%s' % (toolchain_config, toolchain_version), | 266 '%s-%s' % (toolchain_config, toolchain_version), |
266 'prebuilt', '%s-%s' % (host_os, host_machine), 'bin', | 267 'prebuilt', '%s-%s' % (host_os, host_machine), 'bin', |
267 '%s-%s' % (toolchain_config, binary_name)) | 268 '%s-%s' % (toolchain_config, binary_name)) |
268 path = os.path.abspath(path) | 269 path = os.path.abspath(path) |
269 return path if os.path.exists(path) else None | 270 return path if os.path.exists(path) else None |
OLD | NEW |