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

Side by Side Diff: tools/profile_chrome/perf_controller.py

Issue 1332603002: [Android] Move perf utilities into devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: redirections for v8 Created 5 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 unified diff | Download patch
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import logging 5 import logging
6 import os 6 import os
7 import signal 7 import signal
8 import subprocess 8 import subprocess
9 import sys 9 import sys
10 import tempfile 10 import tempfile
11 11
12 from devil.android import device_temp_file
13 from devil.android.perf import perf_control
14
12 from profile_chrome import controllers 15 from profile_chrome import controllers
13 from profile_chrome import ui 16 from profile_chrome import ui
14 17
15 from pylib import constants 18 from pylib import constants
16 from pylib.perf import perf_control
17 from pylib.utils import device_temp_file
18 19
19 sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT, 20 sys.path.append(os.path.join(constants.DIR_SOURCE_ROOT,
20 'tools', 21 'tools',
21 'telemetry')) 22 'telemetry'))
22 try: 23 try:
23 # pylint: disable=F0401 24 # pylint: disable=F0401
24 from telemetry.internal.platform.profiler import android_profiling_helper 25 from telemetry.internal.platform.profiler import android_profiling_helper
25 from telemetry.internal.util import binary_manager 26 from telemetry.internal.util import binary_manager
26 except ImportError: 27 except ImportError:
27 android_profiling_helper = None 28 android_profiling_helper = None
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 open(json_file_name, 'w') as json_file: 181 open(json_file_name, 'w') as json_file:
181 cmd = [perfhost_path, 'script', '-s', perf_script_path, '-i', 182 cmd = [perfhost_path, 'script', '-s', perf_script_path, '-i',
182 perf_profile, '--symfs', symfs_dir, '--kallsyms', kallsyms] 183 perf_profile, '--symfs', symfs_dir, '--kallsyms', kallsyms]
183 if subprocess.call(cmd, stdout=json_file, stderr=dev_null): 184 if subprocess.call(cmd, stdout=json_file, stderr=dev_null):
184 logging.warning('Perf data to JSON conversion failed. The result will ' 185 logging.warning('Perf data to JSON conversion failed. The result will '
185 'not contain any perf samples. You can still view the ' 186 'not contain any perf samples. You can still view the '
186 'perf data manually as shown above.') 187 'perf data manually as shown above.')
187 return None 188 return None
188 189
189 return json_file_name 190 return json_file_name
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698