summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 16:56:05 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-15 16:56:05 +0000
commit927be38dd95b9771412769dd0ddc9c1e287f9659 (patch)
tree8b7b49f1f7129b6e133d47ac6de687d654aa2542 /tools
parente9ab6ffd3ced93bfb65bde4621bd44235429c126 (diff)
downloadchromium_src-927be38dd95b9771412769dd0ddc9c1e287f9659.zip
chromium_src-927be38dd95b9771412769dd0ddc9c1e287f9659.tar.gz
chromium_src-927be38dd95b9771412769dd0ddc9c1e287f9659.tar.bz2
Android: rely on constants.py to find hprof-conv instead of PATH.
BUG=330631 Review URL: https://codereview.chromium.org/236313004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263885 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/telemetry/telemetry/core/platform/profiler/java_heap_profiler.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/telemetry/telemetry/core/platform/profiler/java_heap_profiler.py b/tools/telemetry/telemetry/core/platform/profiler/java_heap_profiler.py
index ce120ab..16a9cca 100644
--- a/tools/telemetry/telemetry/core/platform/profiler/java_heap_profiler.py
+++ b/tools/telemetry/telemetry/core/platform/profiler/java_heap_profiler.py
@@ -10,6 +10,13 @@ from telemetry.core import util
from telemetry.core.backends.chrome import android_browser_finder
from telemetry.core.platform import profiler
+util.AddDirToPythonPath(util.GetChromiumSrcDir(), 'build', 'android')
+try:
+ from pylib import constants # pylint: disable=F0401
+except Exception:
+ constants = None
+
+
class JavaHeapProfiler(profiler.Profiler):
"""Android-specific, trigger and fetch java heap dumps."""
@@ -48,7 +55,9 @@ class JavaHeapProfiler(profiler.Profiler):
if os.path.splitext(f)[1] == '.aprof':
input_file = os.path.join(self._output_path, f)
output_file = input_file.replace('.aprof', '.hprof')
- subprocess.call(['hprof-conv', input_file, output_file])
+ hprof_conv = os.path.join(constants.ANDROID_SDK_ROOT,
+ 'tools', 'hprof-conv')
+ subprocess.call([hprof_conv, input_file, output_file])
output_files.append(output_file)
return output_files