summaryrefslogtreecommitdiffstats
path: root/build/android
diff options
context:
space:
mode:
authorrmcilroy@chromium.org <rmcilroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 16:22:47 +0000
committerrmcilroy@chromium.org <rmcilroy@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-08-07 16:22:47 +0000
commit02c4ace33a15b79001e19555dc4912723b1ab002 (patch)
treef3da51faac622cff8e380d438983fea1c0b70955 /build/android
parentb385d080ed4c30fdff934c94a78d30b8e43a8dfd (diff)
downloadchromium_src-02c4ace33a15b79001e19555dc4912723b1ab002.zip
chromium_src-02c4ace33a15b79001e19555dc4912723b1ab002.tar.gz
chromium_src-02c4ace33a15b79001e19555dc4912723b1ab002.tar.bz2
[Android]: Fix tombstones.py architecture detection.
This CL fixes tombstones.py architecture detection in two ways: - If the tombstone contains an ABI line, use this in preference to the devices default ABI, since some devices support multiple ABIs (e.g., 'arm' and 'arm64'). - Map the abi to an arch which the stack tool accepts, e.g., armeabi-v7a -> arm, arm64-v8a -> arm64. NOTRY=true Review URL: https://codereview.chromium.org/446273003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288072 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/android')
-rwxr-xr-xbuild/android/tombstones.py28
1 files changed, 24 insertions, 4 deletions
diff --git a/build/android/tombstones.py b/build/android/tombstones.py
index ebe1bf8..fd060ad 100755
--- a/build/android/tombstones.py
+++ b/build/android/tombstones.py
@@ -12,6 +12,7 @@
import datetime
import multiprocessing
import os
+import re
import subprocess
import sys
import optparse
@@ -76,17 +77,36 @@ def _EraseTombstone(device, tombstone_file):
'rm /data/tombstones/' + tombstone_file, as_root=True)
-def _ResolveSymbols(tombstone_data, include_stack, arch):
+def _DeviceAbiToArch(device_abi):
+ # The order of this list is significant to find the more specific match (e.g.,
+ # arm64) before the less specific (e.g., arm).
+ arches = ['arm64', 'arm', 'x86_64', 'x86_64', 'x86', 'mips']
+ for arch in arches:
+ if arch in device_abi:
+ return arch
+ raise RuntimeError('Unknown device ABI: %s' % device_abi)
+
+def _ResolveSymbols(tombstone_data, include_stack, device_abi):
"""Run the stack tool for given tombstone input.
Args:
tombstone_data: a list of strings of tombstone data.
include_stack: boolean whether to include stack data in output.
- arch: the device architecture of tombstone data.
+ device_abi: the default ABI of the device which generated the tombstone.
Yields:
A string for each line of resolved stack output.
"""
+ # Check if the tombstone data has an ABI listed, if so use this in preference
+ # to the device's default ABI.
+ for line in tombstone_data:
+ found_abi = re.search('ABI: \'(.+?)\'', line)
+ if found_abi:
+ device_abi = found_abi.group(1)
+ arch = _DeviceAbiToArch(device_abi)
+ if not arch:
+ return
+
stack_tool = os.path.join(os.path.dirname(__file__), '..', '..',
'third_party', 'android_platform', 'development',
'scripts', 'stack')
@@ -108,7 +128,7 @@ def _ResolveTombstone(tombstone):
print '\n'.join(lines)
print 'Resolving...'
lines += _ResolveSymbols(tombstone['data'], tombstone['stack'],
- tombstone['arch'])
+ tombstone['device_abi'])
return lines
@@ -153,7 +173,7 @@ def _GetTombstonesForDevice(device, options):
device_now = _GetDeviceDateTime(device)
for tombstone_file, tombstone_time in tombstones:
ret += [{'serial': str(device),
- 'arch': device.GetProp('ro.product.cpu.abi'),
+ 'device_abi': device.GetProp('ro.product.cpu.abi'),
'device_now': device_now,
'time': tombstone_time,
'file': tombstone_file,