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

Unified Diff: tools/telemetry/telemetry/core/platform/profiler/android_prebuilt_profiler_helper.py

Issue 238513003: [Telemetry] Make Telemetry binaries platform aware. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to util/ Created 6 years, 8 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/core/platform/profiler/android_prebuilt_profiler_helper.py
diff --git a/tools/telemetry/telemetry/core/platform/profiler/android_prebuilt_profiler_helper.py b/tools/telemetry/telemetry/core/platform/profiler/android_prebuilt_profiler_helper.py
index 0e39cb2298f5170538e093903d208269d1b9c3b1..17abf08ee7ad015cc906577644fc661236f40408 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/android_prebuilt_profiler_helper.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/android_prebuilt_profiler_helper.py
@@ -2,20 +2,13 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-"""Android-specific, downloads and installs pre-built profilers.
-
-These pre-built binaries are stored in Cloud Storage, and they were
-built from AOSP source. Specific profilers using this helper class contain
-more detailed information.
-"""
+"""Android-specific, installs pre-built profilers."""
import logging
import os
-import sys
from telemetry import decorators
-from telemetry.core import util
-from telemetry.page import cloud_storage
+from telemetry.util import support_binaries
_DEVICE_PROFILER_DIR = '/data/local/tmp/profilers/'
@@ -25,31 +18,15 @@ def GetDevicePath(profiler_binary):
return os.path.join(_DEVICE_PROFILER_DIR, os.path.basename(profiler_binary))
-def GetHostPath(profiler_binary):
- return os.path.join(util.GetTelemetryDir(),
- 'bin', 'prebuilt', 'android', profiler_binary)
-
-def GetIfChanged(profiler_binary):
- cloud_storage.GetIfChanged(GetHostPath(profiler_binary),
- cloud_storage.PUBLIC_BUCKET)
-
-
@decorators.Cache
def InstallOnDevice(adb, profiler_binary):
- host_binary_path = util.FindSupportBinary(profiler_binary)
- if not host_binary_path:
- has_prebuilt = (
- sys.platform.startswith('linux') and
- adb.system_properties['ro.product.cpu.abi'].startswith('armeabi'))
- if has_prebuilt:
- GetIfChanged(profiler_binary)
- host_binary_path = GetHostPath(profiler_binary)
- else:
- logging.error('Profiler binary "%s" not found. Could not be installed',
- profiler_binary)
- return False
+ host_path = support_binaries.FindPath(profiler_binary, 'android')
+ if not host_path:
+ logging.error('Profiler binary "%s" not found. Could not be installed',
+ host_path)
+ return False
device_binary_path = GetDevicePath(profiler_binary)
- adb.PushIfNeeded(host_binary_path, device_binary_path)
+ adb.PushIfNeeded(host_path, device_binary_path)
adb.RunShellCommand('chmod 777 ' + device_binary_path)
return True

Powered by Google App Engine
This is Rietveld 408576698