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):
return result
def GetSharedLibraryDependenciesAndroid(binary):
"""Return absolute paths to all shared library dependencies of the binary.
def _GetSharedLibraryDependenciesAndroidOrChromeOS(binary):
"""GetSharedLibraryDependencies* suitable for Android or ChromeOS.
This implementation assumes that we're running on a Linux system, but
compiled for Android."""
Both assume that the host is Linux-based, but the binary being symbolized is
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])
lib_re = re.compile('Shared library: \[(.+)\]$')
result = []
......@@ -92,6 +95,14 @@ def GetSharedLibraryDependenciesAndroid(binary):
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():
"""Finds a good DEVELOPER_DIR value to run Mac dev tools.
......@@ -192,6 +203,14 @@ def GetSharedLibraryDependenciesMac(binary, exe_path):
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):
"""Return absolute paths to all shared library dependencies of the binary."""
deps = []
......@@ -201,6 +220,8 @@ def GetSharedLibraryDependencies(options, binary, exe_path):
deps = GetSharedLibraryDependenciesAndroid(binary)
elif options.platform == 'darwin':
deps = GetSharedLibraryDependenciesMac(binary, exe_path)
elif options.platform == 'chromeos':
deps = GetSharedLibraryDependenciesChromeOS(binary)
else:
print "Platform not supported."
sys.exit(1)
......@@ -224,7 +245,8 @@ def GetTransitiveDependencies(options):
deps = set(GetSharedLibraryDependencies(options, binary, exe_path))
deps.add(binary)
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])
queue = [binary]
while queue:
......
......@@ -82,6 +82,12 @@ group("telemetry_chrome_test_without_chrome") {
data_deps = [
"//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) {
data += [
"//build/android/stacktrace/",
......
......@@ -16,7 +16,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
@decorators.Isolated
# ChromeOS and Android are currently hard coded to return None for minidump
# paths, so disable on those platforms.
@decorators.Disabled('chromeos', 'android')
@decorators.Disabled('android')
def testSymbolizeMinidump(self):
# Wait for the browser to restart fully before crashing
self._LoadPageThenWait('var sam = "car";', 'sam')
......@@ -88,7 +88,7 @@ class BrowserMinidumpTest(tab_test_case.TabTestCase):
self.assertTrue(crash_function in sections[4])
@decorators.Isolated
@decorators.Disabled('chromeos', 'android')
@decorators.Disabled('android')
def testMultipleCrashMinidumps(self):
# Wait for the browser to restart fully before crashing
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