1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-02-27 15:29:00 +00:00

Made abi property common between Android and Linux devices

In both cases, the ABI is now obtained by executing "uname -m" on the
device and perfroming a mapping from the returned machine architecture
a known ABI. If no known ABI is found the architecture string itself is
returned.
This commit is contained in:
Sergei Trofimov 2015-06-11 08:56:11 +01:00
parent 2ee9b40527
commit 557b792c77
3 changed files with 21 additions and 9 deletions
wlauto
common
android
linux
utils

@ -96,10 +96,6 @@ class AndroidDevice(BaseLinuxDevice): # pylint: disable=W0223
self._is_rooted = False self._is_rooted = False
return self._is_rooted return self._is_rooted
@property
def abi(self):
return self.getprop()['ro.product.cpu.abi'].split('-')[0]
@property @property
def supported_eabi(self): def supported_eabi(self):
props = self.getprop() props = self.getprop()

@ -27,7 +27,7 @@ from wlauto.core.resource import NO_ONE
from wlauto.exceptions import ConfigError, DeviceError, TimeoutError, DeviceNotRespondingError from wlauto.exceptions import ConfigError, DeviceError, TimeoutError, DeviceNotRespondingError
from wlauto.common.resources import Executable from wlauto.common.resources import Executable
from wlauto.utils.cpuinfo import Cpuinfo from wlauto.utils.cpuinfo import Cpuinfo
from wlauto.utils.misc import convert_new_lines, escape_double_quotes, ranges_to_list from wlauto.utils.misc import convert_new_lines, escape_double_quotes, ranges_to_list, ABI_MAP
from wlauto.utils.ssh import SshShell from wlauto.utils.ssh import SshShell
from wlauto.utils.types import boolean, list_of_strings from wlauto.utils.types import boolean, list_of_strings
@ -110,6 +110,18 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method
value_name='tunables'), value_name='tunables'),
] ]
@property
def abi(self):
if not self._abi:
val = self.execute('uname -m').strip()
for abi, architectures in ABI_MAP.iteritems():
if val in architectures:
self._abi = abi
break
else:
self._abi = val
return self._abi
@property @property
def online_cpus(self): def online_cpus(self):
val = self.get_sysfile_value('/sys/devices/system/cpu/online') val = self.get_sysfile_value('/sys/devices/system/cpu/online')
@ -158,6 +170,7 @@ class BaseLinuxDevice(Device): # pylint: disable=abstract-method
self._number_of_cores = None self._number_of_cores = None
self._written_sysfiles = [] self._written_sysfiles = []
self._cpuinfo = None self._cpuinfo = None
self._abi = None
def validate(self): def validate(self):
if len(self.core_names) != len(self.core_clusters): if len(self.core_names) != len(self.core_clusters):
@ -879,10 +892,6 @@ class LinuxDevice(BaseLinuxDevice):
self._is_rooted = False self._is_rooted = False
return self._is_rooted return self._is_rooted
@property
def abi(self):
return self.execute('uname -m')
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(LinuxDevice, self).__init__(*args, **kwargs) super(LinuxDevice, self).__init__(*args, **kwargs)
self.shell = None self.shell = None

@ -43,6 +43,13 @@ import yaml
from dateutil import tz from dateutil import tz
# ABI --> architectures list
ABI_MAP = {
'armeabi': ['armeabi', 'armv7', 'armv7l', 'armv7el', 'armv7lh'],
'arm64': ['arm64', 'armv8'],
}
def preexec_function(): def preexec_function():
# Ignore the SIGINT signal by setting the handler to the standard # Ignore the SIGINT signal by setting the handler to the standard
# signal handler SIG_IGN. # signal handler SIG_IGN.