Commit 652533b0 authored by rmcilroy@chromium.org's avatar rmcilroy@chromium.org

[Telemetry]: Add --target-arch option to browser options.

Add a --target-arch argument to the browser finder options. This is used by the
backend to pass the correct arch to the stack symbolization script on crashes.

BUG=399896,385125

Review URL: https://codereview.chromium.org/443443002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@287413 0039d316-1c4b-4281-b951-d872f2087c98
parent 1d1e53d5
......@@ -170,7 +170,7 @@ class WebviewBackendSettings(AndroidBrowserBackendSettings):
class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
"""The backend for controlling a browser instance running on Android."""
def __init__(self, browser_options, backend_settings, use_rndis_forwarder,
output_profile_path, extensions_to_load):
output_profile_path, extensions_to_load, target_arch):
super(AndroidBrowserBackend, self).__init__(
supports_tab_control=backend_settings.supports_tab_control,
supports_extensions=False, browser_options=browser_options,
......@@ -184,6 +184,7 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
self._adb = backend_settings.adb
self._backend_settings = backend_settings
self._saved_cmdline = ''
self._target_arch = target_arch
# TODO(tonyg): This is flaky because it doesn't reserve the port that it
# allocates. Need to fix this.
......@@ -398,8 +399,10 @@ class AndroidBrowserBackend(chrome_browser_backend.ChromeBrowserBackend):
'android_platform', 'development', 'scripts', 'stack')
# Try to symbolize logcat.
if os.path.exists(stack):
p = subprocess.Popen([stack], stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
cmd = [stack]
if self._target_arch:
cmd.append('--arch=%s' % self._target_arch)
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
ret += Decorate('Stack from Logcat', p.communicate(input=logcat)[0])
# Try to get tombstones.
......
......@@ -108,7 +108,8 @@ class PossibleAndroidBrowser(possible_browser.PossibleBrowser):
self.finder_options.browser_options, self._backend_settings,
use_rndis_forwarder,
output_profile_path=self.finder_options.output_profile_path,
extensions_to_load=self.finder_options.extensions_to_load)
extensions_to_load=self.finder_options.extensions_to_load,
target_arch=self.finder_options.target_arch)
b = browser.Browser(backend, self._platform_backend)
return b
......
......@@ -76,6 +76,11 @@ class BrowserFinderOptions(optparse.Values):
dest='android_device',
help='The android device ID to use'
'If not specified, only 0 or 1 connected devcies are supported.')
group.add_option('--target-arch',
dest='target_arch',
help='The target architecture of the browser. Options available are: '
'x64, x86_64, arm, arm64 and mips. '
'Defaults to the default architecture of the platform if omitted.')
group.add_option(
'--remote',
dest='cros_remote',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment