Commit 35309b02 authored by Brian Sheedy's avatar Brian Sheedy Committed by Commit Bot

Make ChromeOS symbolization work in Chromium

Adds the necessary data dependencies for Telemetry ChromeOS stack
symbolization to work on the bots and re-enables the stack symbolization
tests on ChromeOS.

Also adds support for ChromeOS to generage_breakpad_symbols.py, which is
the same as Android. This is necessary because Android and ChromeOS need
to use readelf instead of ldd due to potentially different architectures
between the host and device.

Bug: 978952
Change-Id: Ic143d8a9d233c324a1e4fd20463c9ce2ffeec40a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1790330
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Commit-Queue: Robert Sesek <rsesek@chromium.org>
Auto-Submit: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699072}
parent fa2bd15b
...@@ -74,11 +74,14 @@ def GetSharedLibraryDependenciesLinux(binary): ...@@ -74,11 +74,14 @@ def GetSharedLibraryDependenciesLinux(binary):
return result return result
def GetSharedLibraryDependenciesAndroid(binary): def _GetSharedLibraryDependenciesAndroidOrChromeOS(binary):
"""Return absolute paths to all shared library dependencies of the binary. """GetSharedLibraryDependencies* suitable for Android or ChromeOS.
This implementation assumes that we're running on a Linux system, but Both assume that the host is Linux-based, but the binary being symbolized is
compiled for Android.""" being run on a device with potentially different architectures. Unlike ldd,
readelf plays nice with mixed host/device architectures (e.g. x86-64 host,
arm64 device), so use that.
"""
readelf = subprocess.check_output(['readelf', '-d', binary]) readelf = subprocess.check_output(['readelf', '-d', binary])
lib_re = re.compile('Shared library: \[(.+)\]$') lib_re = re.compile('Shared library: \[(.+)\]$')
result = [] result = []
...@@ -92,6 +95,14 @@ def GetSharedLibraryDependenciesAndroid(binary): ...@@ -92,6 +95,14 @@ def GetSharedLibraryDependenciesAndroid(binary):
return result return result
def GetSharedLibraryDependenciesAndroid(binary):
"""Return absolute paths to all shared library dependencies of the binary.
This implementation assumes that we're running on a Linux system, but
compiled for Android."""
return _GetSharedLibraryDependenciesAndroidOrChromeOS(binary)
def GetDeveloperDirMac(): def GetDeveloperDirMac():
"""Finds a good DEVELOPER_DIR value to run Mac dev tools. """Finds a good DEVELOPER_DIR value to run Mac dev tools.
...@@ -192,6 +203,14 @@ def GetSharedLibraryDependenciesMac(binary, exe_path): ...@@ -192,6 +203,14 @@ def GetSharedLibraryDependenciesMac(binary, exe_path):
return deps return deps
def GetSharedLibraryDependenciesChromeOS(binary):
"""Return absolute paths to all shared library dependencies of the binary.
This implementation assumes that we're running on a Linux system, but
compiled for ChromeOS."""
return _GetSharedLibraryDependenciesAndroidOrChromeOS(binary)
def GetSharedLibraryDependencies(options, binary, exe_path): def GetSharedLibraryDependencies(options, binary, exe_path):
"""Return absolute paths to all shared library dependencies of the binary.""" """Return absolute paths to all shared library dependencies of the binary."""
deps = [] deps = []
...@@ -201,6 +220,8 @@ def GetSharedLibraryDependencies(options, binary, exe_path): ...@@ -201,6 +220,8 @@ def GetSharedLibraryDependencies(options, binary, exe_path):
deps = GetSharedLibraryDependenciesAndroid(binary) deps = GetSharedLibraryDependenciesAndroid(binary)
elif options.platform == 'darwin': elif options.platform == 'darwin':
deps = GetSharedLibraryDependenciesMac(binary, exe_path) deps = GetSharedLibraryDependenciesMac(binary, exe_path)
elif options.platform == 'chromeos':
deps = GetSharedLibraryDependenciesChromeOS(binary)
else: else:
print "Platform not supported." print "Platform not supported."
sys.exit(1) sys.exit(1)
...@@ -224,7 +245,8 @@ def GetTransitiveDependencies(options): ...@@ -224,7 +245,8 @@ def GetTransitiveDependencies(options):
deps = set(GetSharedLibraryDependencies(options, binary, exe_path)) deps = set(GetSharedLibraryDependencies(options, binary, exe_path))
deps.add(binary) deps.add(binary)
return list(deps) return list(deps)
elif options.platform == 'darwin' or options.platform == 'android': elif (options.platform == 'darwin' or options.platform == 'android' or
options.platform == 'chromeos'):
binaries = set([binary]) binaries = set([binary])
queue = [binary] queue = [binary]
while queue: while queue:
......
...@@ -82,6 +82,12 @@ group("telemetry_chrome_test_without_chrome") { ...@@ -82,6 +82,12 @@ group("telemetry_chrome_test_without_chrome") {
data_deps = [ data_deps = [
"//third_party/catapult:telemetry_chrome_test_support", "//third_party/catapult:telemetry_chrome_test_support",
] ]
if (is_chromeos) {
data_deps += [
"//third_party/breakpad:minidump_stackwalk",
"//third_party/breakpad:dump_syms",
]
}
if (is_android) { if (is_android) {
data += [ data += [
"//build/android/stacktrace/", "//build/android/stacktrace/",
......
...@@ -16,7 +16,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -16,7 +16,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
@decorators.Isolated @decorators.Isolated
# ChromeOS and Android are currently hard coded to return None for minidump # ChromeOS and Android are currently hard coded to return None for minidump
# paths, so disable on those platforms. # paths, so disable on those platforms.
@decorators.Disabled('chromeos', 'android') @decorators.Disabled('android')
def testSymbolizeMinidump(self): def testSymbolizeMinidump(self):
# Wait for the browser to restart fully before crashing # Wait for the browser to restart fully before crashing
self._LoadPageThenWait('var sam = "car";', 'sam') self._LoadPageThenWait('var sam = "car";', 'sam')
...@@ -88,7 +88,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase): ...@@ -88,7 +88,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
self.assertTrue(crash_function in sections[4]) self.assertTrue(crash_function in sections[4])
@decorators.Isolated @decorators.Isolated
@decorators.Disabled('chromeos', 'android') @decorators.Disabled('android')
def testMultipleCrashMinidumps(self): def testMultipleCrashMinidumps(self):
# Wait for the browser to restart fully before crashing # Wait for the browser to restart fully before crashing
self._LoadPageThenWait('var cat = "dog";', 'cat') self._LoadPageThenWait('var cat = "dog";', 'cat')
......
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