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

Unified Diff: tools/telemetry/telemetry/util/support_binaries.py

Issue 643973002: Add multi-architecture support in telemetry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybot failure Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: tools/telemetry/telemetry/util/support_binaries.py
diff --git a/tools/telemetry/telemetry/util/support_binaries.py b/tools/telemetry/telemetry/util/support_binaries.py
index 3e8c2bca3833845a3b58167924248b31d1047029..edccb0f6b3239005cd2f7078935b98ebb5883a70 100644
--- a/tools/telemetry/telemetry/util/support_binaries.py
+++ b/tools/telemetry/telemetry/util/support_binaries.py
@@ -10,13 +10,14 @@ from telemetry.util import cloud_storage
from telemetry.util import path
-def _GetBinPath(binary_name, platform_name):
- # TODO(tonyg): Add another nesting level for architecture_name.
- return os.path.join(path.GetTelemetryDir(), 'bin', platform_name, binary_name)
+def _GetBinPath(binary_name, arch_name, platform_name):
+ return os.path.join(
+ path.GetTelemetryDir(), 'bin', platform_name, arch_name, binary_name)
-def _IsInCloudStorage(binary_name, platform_name):
- return os.path.exists(_GetBinPath(binary_name, platform_name) + '.sha1')
+def _IsInCloudStorage(binary_name, arch_name, platform_name):
+ return os.path.exists(
+ _GetBinPath(binary_name, arch_name, platform_name) + '.sha1')
@decorators.Cache
@@ -39,15 +40,16 @@ def FindLocallyBuiltPath(binary_name):
@decorators.Cache
-def FindPath(binary_name, platform_name):
+def FindPath(binary_name, arch_name, platform_name):
"""Returns the path to the given binary name, pulling from the cloud if
necessary."""
if platform_name == 'win':
binary_name += '.exe'
command = FindLocallyBuiltPath(binary_name)
- if not command and _IsInCloudStorage(binary_name, platform_name):
- cloud_storage.GetIfChanged(_GetBinPath(binary_name, platform_name))
- command = _GetBinPath(binary_name, platform_name)
+ if not command and _IsInCloudStorage(binary_name, arch_name, platform_name):
+ cloud_storage.GetIfChanged(
+ _GetBinPath(binary_name, arch_name, platform_name))
+ command = _GetBinPath(binary_name, arch_name, platform_name)
# Ensure the downloaded file is actually executable.
if command and os.path.exists(command):

Powered by Google App Engine
This is Rietveld 408576698