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

Unified Diff: tools/telemetry/telemetry/core/platform/linux_platform_backend.py

Issue 474933005: Perfhost for ubuntu trusty (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: lucid -> precise (shame shame) Created 6 years, 3 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/linux_platform_backend.py
diff --git a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
index dffd4306862abf465525dfd603bb60bce229fa32..c46c5717164aab34e0d32c71513e71ccd414662d 100644
--- a/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
+++ b/tools/telemetry/telemetry/core/platform/linux_platform_backend.py
@@ -15,6 +15,12 @@ from telemetry.util import cloud_storage
from telemetry.util import support_binaries
+_POSSIBLE_PERFHOST_APPLICATIONS = [
+ 'perfhost_precise',
+ 'perfhost_trusty',
+]
+
+
class LinuxPlatformBackend(
posix_platform_backend.PosixPlatformBackend,
linux_based_platform_backend.LinuxBasedPlatformBackend):
@@ -74,9 +80,9 @@ class LinuxPlatformBackend(
if application == 'ipfw':
self._InstallIpfw()
elif application == 'avconv':
- self._InstallBinary(application, 'libav-tools')
- elif application == 'perfhost':
- self._InstallBinary(application, 'linux-tools')
+ self._InstallBinary(application, fallback_package='libav-tools')
+ elif application in _POSSIBLE_PERFHOST_APPLICATIONS:
+ self._InstallBinary(application)
else:
raise NotImplementedError(
'Please teach Telemetry how to install ' + application)
@@ -114,6 +120,8 @@ class LinuxPlatformBackend(
def _InstallBinary(self, bin_name, fallback_package=None):
bin_path = support_binaries.FindPath(bin_name, self.GetOSName())
+ if not bin_path:
+ raise Exception('Could not find the binary package %s' % bin_name)
os.environ['PATH'] += os.pathsep + os.path.dirname(bin_path)
try:
@@ -122,8 +130,8 @@ class LinuxPlatformBackend(
except cloud_storage.CloudStorageError, e:
logging.error(str(e))
if fallback_package:
- logging.error('You may proceed by manually installing %s via:\n'
- 'sudo apt-get install %s' % (bin_name, fallback_package))
- sys.exit(1)
+ raise Exception('You may proceed by manually installing %s via:\n'
+ 'sudo apt-get install %s' %
+ (bin_name, fallback_package))
assert self.CanLaunchApplication(bin_name), 'Failed to install ' + bin_name

Powered by Google App Engine
This is Rietveld 408576698