diff options
author | frankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-13 18:33:37 +0000 |
---|---|---|
committer | frankf@chromium.org <frankf@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-13 18:33:37 +0000 |
commit | 54869820a2a86b326810c96e0af330a5a06b1ed5 (patch) | |
tree | d8a085e8b745f25685c59d5038de962094ac3fd6 /tools | |
parent | 87dac9743e63fd7ea0828e58e667a68c77869995 (diff) | |
download | chromium_src-54869820a2a86b326810c96e0af330a5a06b1ed5.zip chromium_src-54869820a2a86b326810c96e0af330a5a06b1ed5.tar.gz chromium_src-54869820a2a86b326810c96e0af330a5a06b1ed5.tar.bz2 |
[Telemetry] Build and install memconsumer app.
BUG=None
Review URL: https://codereview.chromium.org/26932003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r-- | tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py | 9 | ||||
-rw-r--r-- | tools/telemetry/telemetry/core/util.py | 7 |
2 files changed, 14 insertions, 2 deletions
diff --git a/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py index 825fc71..c09add5 100644 --- a/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py +++ b/tools/telemetry/telemetry/core/platform/profiler/oomkiller_profiler.py @@ -2,6 +2,9 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import os + +from telemetry.core import util from telemetry.core.backends.chrome import android_browser_finder from telemetry.core.platform import profiler @@ -26,6 +29,12 @@ class OOMKillerProfiler(profiler.Profiler): browser_backend, platform_backend, output_path, state) if not 'mem_consumer_launched' in state: state['mem_consumer_launched'] = True + mem_consumer_path = util.FindSupportBinary( + os.path.join('apks', 'MemConsumer.apk'), + executable=False) + assert mem_consumer_path, ('Could not find memconsumer app. Please build ' + 'memconsumer target.') + self._browser_backend.adb.Install(mem_consumer_path) self._browser_backend.adb.GoHome() self._platform_backend.LaunchApplication( 'org.chromium.memconsumer/.MemConsumer', diff --git a/tools/telemetry/telemetry/core/util.py b/tools/telemetry/telemetry/core/util.py index a013eea..59cf52f 100644 --- a/tools/telemetry/telemetry/core/util.py +++ b/tools/telemetry/telemetry/core/util.py @@ -122,16 +122,19 @@ def GetBuildDirectories(): for build_type in build_types: yield build_dir, build_type -def FindSupportBinary(binary_name): +def FindSupportBinary(binary_name, executable=True): """Returns the path to the given binary name.""" # TODO(tonyg/dtu): This should support finding binaries in cloud storage. command = None command_mtime = 0 + required_mode = os.R_OK + if executable: + required_mode = os.X_OK chrome_root = GetChromiumSrcDir() for build_dir, build_type in GetBuildDirectories(): candidate = os.path.join(chrome_root, build_dir, build_type, binary_name) - if os.path.isfile(candidate) and os.access(candidate, os.X_OK): + if os.path.isfile(candidate) and os.access(candidate, required_mode): candidate_mtime = os.stat(candidate).st_mtime if candidate_mtime > command_mtime: command = candidate |