Index: tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py |
diff --git a/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py b/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py |
index bbdd9f5fdcb3634788b2a9e9fda3324ebb5ca7d0..e06ab32e1b9fc793433337a7ba5c9cb189e0722d 100644 |
--- a/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py |
+++ b/tools/telemetry/telemetry/core/platform/profiler/android_profiling_helper.py |
@@ -204,8 +204,15 @@ def CreateSymFs(device, symfs_dir, libraries, use_symlinks=True): |
# the profiler can at least use the public symbols of that library. To |
# speed things up, only pull files that don't match copies we already |
# have in the symfs. |
- if (md5sum.CalculateHostMd5Sums([output_lib])[0] != |
- md5sum.CalculateDeviceMd5Sums([lib])[0]): |
+ if not os.path.exists(output_lib): |
+ pull = True |
+ else: |
+ host_md5sums = md5sum.CalculateHostMd5Sums([output_lib]) |
+ device_md5sums = md5sum.CalculateDeviceMd5Sums([lib], device) |
+ pull = (not host_md5sums or not device_md5sums |
Sami
2015/05/20 14:57:21
Aren't we guaranteed to have host_md5sums at this
jbudorick
2015/05/20 15:08:13
barring unrelated failures, yes
Sami
2015/05/20 15:14:25
ok, let's leave the check in then :)
|
+ or host_md5sums[0] != device_md5sums[0]) |
+ |
+ if pull: |
logging.info('Pulling %s to %s', lib, output_lib) |
device.PullFile(lib, output_lib) |
@@ -260,10 +267,22 @@ def GetToolchainBinaryPath(library_file, binary_name): |
return None |
toolchain_version = toolchain_version.group(1) |
- path = os.path.join(util.GetChromiumSrcDir(), 'third_party', 'android_tools', |
- 'ndk', 'toolchains', |
- '%s-%s' % (toolchain_config, toolchain_version), |
- 'prebuilt', '%s-%s' % (host_os, host_machine), 'bin', |
- '%s-%s' % (toolchain_config, binary_name)) |
- path = os.path.abspath(path) |
- return path if os.path.exists(path) else None |
+ toolchain_path = os.path.abspath(os.path.join( |
+ util.GetChromiumSrcDir(), 'third_party', 'android_tools', 'ndk', |
+ 'toolchains', '%s-%s' % (toolchain_config, toolchain_version))) |
+ if not os.path.exists(toolchain_path): |
+ logging.warning( |
+ 'Unable to find toolchain binary %s: toolchain not found at %s', |
+ binary_name, toolchain_path) |
+ return None |
+ |
+ path = os.path.join( |
+ toolchain_path, 'prebuilt', '%s-%s' % (host_os, host_machine), 'bin', |
+ '%s-%s' % (toolchain_config, binary_name)) |
+ if not os.path.exists(path): |
+ logging.warning( |
+ 'Unable to find toolchain binary %s: binary not found at %s', |
+ binary_name, path) |
+ return None |
+ |
+ return path |