wlauto.devices.android.gem5 package

Module contents

class wlauto.devices.android.gem5.Gem5AndroidDevice(**kwargs)[source]

Bases: wlauto.common.gem5.device.BaseGem5Device, wlauto.common.android.device.AndroidDevice

Implements gem5 Android device.

This class allows a user to connect WA to a simulation using gem5. The connection to the device is made using the telnet connection of the simulator, and is used for all commands. The simulator does not have ADB support, and therefore we need to fall back to using standard shell commands.

Files are copied into the simulation using a VirtIO 9P device in gem5. Files are copied out of the simulated environment using the m5 writefile command within the simulated system.

When starting the workload run, the simulator is automatically started by Workload Automation, and a connection to the simulator is established. WA will then wait for Android to boot on the simulated system (which can take hours), prior to executing any other commands on the device. It is also possible to resume from a checkpoint when starting the simulation. To do this, please append the relevant checkpoint commands from the gem5 simulation script to the gem5_discription argument in the agenda.

Host system requirements:
  • VirtIO support. We rely on diod on the host system. This can be installed on ubuntu using the following command:

    sudo apt-get install diod

Guest requirements:
  • VirtIO support. We rely on VirtIO to move files into the simulation. Please make sure that the following are set in the kernel configuration:

    CONFIG_NET_9P=y

    CONFIG_NET_9P_VIRTIO=y

    CONFIG_9P_FS=y

    CONFIG_9P_FS_POSIX_ACL=y

    CONFIG_9P_FS_SECURITY=y

    CONFIG_VIRTIO_BLK=y

  • m5 binary. Please make sure that the m5 binary is on the device and can by found in the path.

aliases = AC([])
artifacts = AC([])
capture_screen(filepath)[source]
clear_logcat()[source]

Clear (flush) logcat log.

core_modules = []
disable_selinux()[source]

Disable SELinux. Overridden as parent implementation uses ADB

dump_logcat(outfile, filter_spec=None)[source]

Extract logcat from simulation

dynamic_modules = AC(["{'devcpufreq': {}}", "{'cpuidle': {}}"])
finalize(*args, **kwargs)
get_properties(context)[source]

Get the property files from the device

initialize(*args, **kwargs)
install(filepath, timeout=10800)[source]

Install an APK or a normal executable

install_apk(filepath, timeout=10800)[source]

Install an APK on the gem5 device

The APK is pushed to the device. Then the file and folder permissions are changed to ensure that the APK can be correctly installed. The APK is then installed on the device using ‘pm’.

install_executable(filepath, with_name=None)[source]

Install an executable

kind = 'device'
login_to_device()[source]
name = 'gem5_android'
parameters = AC(["Param({'kind': <type 'str'>, 'mandatory': False, 'name': 'gem5_binary', 'constraint': None, 'default': './build/ARM/gem5.fast', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <class 'wlauto.utils.types.arguments'>, 'mandatory': True, 'name': 'gem5_args', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <class 'wlauto.utils.types.arguments'>, 'mandatory': True, 'name': 'gem5_vio_args', 'constraint': <function <lambda>>, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'temp_dir', 'constraint': None, 'default': '/tmp', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': False, 'name': 'checkpoint', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': False, 'name': 'run_delay', 'constraint': <function <lambda>>, 'default': 0, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'list'>, 'mandatory': None, 'name': 'modules', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'_overridden': 'Gem5AndroidDevice', 'kind': <class 'wlauto.utils.types.list_of_caseless_strings'>, 'mandatory': True, 'name': 'core_names', 'constraint': None, 'default': [], 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'_overridden': 'Gem5AndroidDevice', 'kind': <function list_of_ints>, 'mandatory': True, 'name': 'core_clusters', 'constraint': None, 'default': [], 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'scheduler', 'constraint': None, 'default': 'unknown', 'allowed_values': ['unknown', 'smp', 'hmp', 'iks', 'ea', 'other'], 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'iks_switch_frequency', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function list_of_strs>, 'mandatory': None, 'name': 'property_files', 'constraint': None, 'default': ['/etc/arch-release', '/etc/debian_version', '/etc/lsb-release', '/proc/config.gz', '/proc/cmdline', '/proc/cpuinfo', '/proc/version', '/proc/zconfig', '/sys/kernel/debug/sched_features', '/sys/kernel/hmp'], 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'_overridden': 'AndroidDevice', 'kind': <type 'str'>, 'mandatory': None, 'name': 'binaries_directory', 'constraint': None, 'default': '/data/local/tmp/wa-bin', 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'_overridden': 'AndroidDevice', 'kind': <type 'str'>, 'mandatory': None, 'name': 'working_directory', 'constraint': None, 'default': '/sdcard/wa-working', 'allowed_values': None, 'global_alias': None, 'override': True})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'adb_name', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function regex>, 'mandatory': None, 'name': 'android_prompt', 'constraint': None, 'default': <_sre.SRE_Pattern object>, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'package_data_directory', 'constraint': None, 'default': '/data/data', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'external_storage_directory', 'constraint': None, 'default': '/sdcard', 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'connection', 'constraint': None, 'default': 'usb', 'allowed_values': ['usb', 'ethernet'], 'global_alias': None, 'override': False})", "Param({'kind': <function integer>, 'mandatory': None, 'name': 'logcat_poll_period', 'constraint': None, 'default': None, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <function boolean>, 'mandatory': None, 'name': 'enable_screen_check', 'constraint': None, 'default': False, 'allowed_values': None, 'global_alias': None, 'override': False})", "Param({'kind': <type 'str'>, 'mandatory': None, 'name': 'swipe_to_unlock', 'constraint': None, 'default': None, 'allowed_values': [None, 'horizontal', 'vertical'], 'global_alias': None, 'override': False})"])
platform = 'android'
runtime_parameters = AC(['sysfile_values', '${core}_cores', '${core}_min_frequency', '${core}_max_frequency', '${core}_frequency', '${core}_governor', '${core}_governor_tunables'])
uninstall(package)[source]
validate(*args, **kwargs)
wait_for_boot()[source]

Wait for the system to boot

We monitor the sys.boot_completed and service.bootanim.exit system properties to determine when the system has finished booting. In the event that we cannot coerce the result of service.bootanim.exit to an integer, we assume that the boot animation was disabled and do not wait for it to finish.