1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-07-15 11:34:24 +01:00

25 Commits

Author SHA1 Message Date
637bf57cbc fw/version: Bump revison versions
Bump the revision version for WA and the required version for
devlib.
2019-03-04 10:37:39 +00:00
60ffd27bba extras/Dockerfile: Update to use the latest release version 2019-03-04 10:37:39 +00:00
984a74a6ca doc/changes: Update changelog for v3.1.2 2019-03-04 10:37:39 +00:00
5b8dc1779c setup.py: Limit the maximum version of PyYAML
Specify the latest stable release of PyYAML should be installed rather
than the latest pre-release.
2019-03-04 10:37:39 +00:00
ba0cd7f842 fw/target/info: Bump target info version
Due to mismatches in WA and devlib versions this previous upgrade method
could have been trigger before it was needed and would not be called a
second time. Now we can be sure that WA and devlib are updated together
bump the version number again to ensure the upgrade method is called a
second time to ensure the POD is upgraded correctly.
2019-03-04 10:37:39 +00:00
adb3ffa6aa fw/version: Introduce required version for devlib
To ensure that a compatible version of devlib is installed on the system
keep track of the version of devlib that is required by WA and provide a
more useful error message if this is not satisfied.
2019-03-04 10:37:39 +00:00
bedd3bf062 docs/faq: Add entry about missing kernel config errors
Although WA supports automatic updating during parsing of a serialized
`kernel_config` from devlib, if the installed versions of WA and devlib
have become out of sync where WA has "updated" the old implementation it
will not attempt to update it again when devlib is later updated to use
the new implementation and therefore will not trigger the existing
checks that are in place.
2019-02-21 11:57:32 +00:00
03e463ad4a docs/installation: Add warning about using pip to install from github 2019-02-20 16:30:53 +00:00
2ce8d6fc95 output_processors/postgresql: Add missing default
In the case of no screen resolution being present ensure that a default
is used instead of `None`.
2019-02-14 10:51:38 +00:00
1415f61e36 workloads/chrome: Fix for tablet devices
Some tablet devices use an alternate tab switching method due to the
larger screen space. Add support for adding new tabs via the menu
instead of via the tab switcher.
2019-02-08 14:32:58 +00:00
6ab1ae74a6 wa/apk_workloads: Update to not specify a default apk version.
No longer specify a default version to allow any available apks to be
detected and then choose the appropriate automation based on the
detected version.
Refactor to support new supported_versions attribute and since APK
resolution needs to have happened before setting uiauto parameter
move assignments to ``initialize``.
2019-02-08 13:56:55 +00:00
a1cecc0002 fw/workload: Add "support_versions" attribute to workloads
Allow for specifying a list of supported APK versions for a workload. If
a specific version is no specified then attempt to a resolve any valid
version for the workload.
2019-02-08 13:56:55 +00:00
0cba3c68dc fw/resource: Support matching APKs on multiple versions.
In the case where a range of apk versions are valid allow for the matching
process to accommodate a list of versions instead of a single value.
2019-02-08 13:56:55 +00:00
f267fc9277 fw/workload: Use apk version for workload if not set.
If a workloads `version` attribute is not set, and an APK file is
found, use this as the version number. This allows for workloads to not
specify a default version via parameters and for an available APK to be
automatically chosen.
2019-02-08 13:56:55 +00:00
462a5b651a fw/output: add label property to Metric
Add a "label" property to Metric that combines its name with its
classifiers into a single string.
2019-02-05 10:27:06 +00:00
7cd7b73f58 Fixed an error emptying the reading buffer of the poller
Fixed identation

Fixed identation
2019-02-04 09:46:13 +00:00
4a9a2ad105 fw/target/info: Fix for KernelConfig refactor
The Devlib KernelConfig object was refactored in commit
f65130b7c7
therefore update the way KernelConfig objects are deserialized to reflect the new
implementation and provide a conversion for PODs.
2019-01-31 09:44:30 +00:00
9f88459f56 fw/workload: Fix Typo 2019-01-30 15:46:54 +00:00
a2087ea467 workloads/manual: Fix incorrect attribute used to access target 2019-01-30 15:46:54 +00:00
31a5a95803 output_processors/postgresql: Ensure screen resolution is a list
Ensure that the screen resolution is converted to a list to prevent
casting errors.
2019-01-30 15:46:54 +00:00
3f202205a5 doc/faq: Add answer on how to fall back to surfaceflinger 2019-01-28 12:45:10 +00:00
ce7720b26d instruments/fps: Fix Typo 2019-01-28 12:45:10 +00:00
766b96e2ad fw/workload: Add a 'View' parameter to ApkWorkloads
Allow for easy configuring of a view for a particular workload as this
can vary depending on the device which can be used when using certain
instruments for example `fps`.
2019-01-11 10:12:42 +00:00
3c9de98a4b setup: Update devlib requirements to development versions. 2019-01-11 10:12:26 +00:00
5263cfd6f8 fw/version: Add development tag to version
Add a development tag to the version format instead of using the
revision field.
2019-01-11 10:12:26 +00:00
25 changed files with 207 additions and 73 deletions
doc/source
extras
setup.py
wa
framework
instruments
fps.py
poller
bin
arm64
armeabi
poller.c
output_processors
workloads
chrome
com.arm.wa.uiauto.chrome.apk
uiauto
app
src
main
java
com
exoplayer
geekbench
glbenchmark
manual
vellamo

@ -497,6 +497,11 @@ A :class:`Metric` has the following attributes:
or they may have been added by the workload to help distinguish between
otherwise identical metrics.
``label``
This is a string constructed from the name and classifiers, to provide a
more unique identifier, e.g. for grouping values across iterations. The
format is in the form ``name/cassifier1=value1/classifier2=value2/...``.
:class:`Artifact`
-----------------

@ -178,6 +178,11 @@ methods.
locations) and device will be searched for an application with a matching
package name.
``supported_versions``
This attribute should be a list of apk versions that are suitable for this
workload, if a specific apk version is not specified then any available
supported version may be chosen.
``view``
This is the "view" associated with the application. This is used by
instruments like ``fps`` to monitor the current framerate being generated by

@ -2,6 +2,34 @@
What's New in Workload Automation
=================================
*************
Version 3.1.2
*************
Fixes/Improvements
==================
Framework:
----------
- Implement an explicit check for Devlib versions to ensure that versions
are kept in sync with each other.
- Added a ``View`` parameter to ApkWorkloads for use with certain instruments
for example ``fps``.
- Added ``"supported_versions"`` attribute to workloads to allow specifying a
list of supported version for a particular workload.
- Change default behaviour to run any available version of a workload if a
specific version is not specified.
Output Processors:
------------------
- ``Postgres``: Fix handling of ``screen_resoultion`` during processing.
Other
-----
- Added additional information to documentation
- Added fix for Devlib's ``KernelConfig`` refactor
- Added a ``"label"`` property to ``Metrics``
*************
Version 3.1.1
*************

@ -69,7 +69,48 @@ WA3 config file.
**Q:** My Juno board keeps resetting upon starting WA even if it hasn't crashed.
--------------------------------------------------------------------------------
Please ensure that you do not have any other terminals (e.g. ``screen``
**A** Please ensure that you do not have any other terminals (e.g. ``screen``
sessions) connected to the board's UART. When WA attempts to open the connection
for its own use this can cause the board to reset if a connection is already
present.
**Q:** I'm using the FPS instrument but I do not get any/correct results for my workload
-----------------------------------------------------------------------------------------
**A:** If your device is running with Android 6.0 + then the default utility for
collecting fps metrics will be ``gfxinfo`` however this does not seem to be able
to extract any meaningful information for some workloads. In this case please
try setting the ``force_surfaceflinger`` parameter for the ``fps`` augmentation
to ``True``. This will attempt to guess the "View" for the workload
automatically however this is device specific and therefore may need
customizing. If this is required please open the application and execute
``dumpsys SurfaceFlinger --list`` on the device via adb. This will provide a
list of all views available for measuring.
As an example, when trying to find the view for the AngryBirds Rio workload you
may get something like:
.. code-block:: none
...
AppWindowToken{41dfe54 token=Token{77819a7 ActivityRecord{a151266 u0 com.rovio.angrybirdsrio/com.rovio.fusion.App t506}}}#0
a3d001c com.rovio.angrybirdsrio/com.rovio.fusion.App#0
Background for -SurfaceView - com.rovio.angrybirdsrio/com.rovio.fusion.App#0
SurfaceView - com.rovio.angrybirdsrio/com.rovio.fusion.App#0
com.rovio.angrybirdsrio/com.rovio.fusion.App#0
boostedAnimationLayer#0
mAboveAppWindowsContainers#0
...
From these ``"SurfaceView - com.rovio.angrybirdsrio/com.rovio.fusion.App#0"`` is
the mostly likely the View that needs to be set as the ``view`` workload
parameter and will be picked up be the ``fps`` augmentation.
**Q:** I am getting an error which looks similar to ``'CONFIG_SND_BT87X is not exposed in kernel config'...``
-------------------------------------------------------------------------------------------------------------
**A:** If you are receiving this under normal operation this can be caused by a
mismatch of your WA and devlib versions. Please update both to their latest
versions and delete your ``$USER_HOME/.workload_automation/cache/targets.json``
(or equivalent) file.

@ -199,6 +199,11 @@ Alternatively, you can also install the latest development version from GitHub
cd workload-automation
sudo -H python setup.py install
.. note:: Please note that if using pip to install from github this will most
likely result in an older and incompatible version of devlib being
installed alongside WA. If you wish to use pip please also manually
install the latest version of
`devlib <https://github.com/ARM-software/devlib>`_.
If the above succeeds, try ::
@ -222,7 +227,7 @@ image in a container.
The Dockerfile can be found in the "extras" directory or online at
`<https://github.com/ARM-software /workload- automation/blob/next/extras/Dockerfile>`_
which contains addional information about how to build and to use the file.
which contains additional information about how to build and to use the file.
(Optional) Post Installation

@ -42,8 +42,8 @@ FROM ubuntu:17.10
# Please update the references below to use different versions of
# devlib, WA or the Android SDK
ARG DEVLIB_REF=v1.1.0
ARG WA_REF=v3.1.1
ARG DEVLIB_REF=v1.1.1
ARG WA_REF=v3.1.2
ARG ANDROID_SDK_URL=https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip
RUN apt-get update

@ -29,7 +29,8 @@ except ImportError:
wa_dir = os.path.join(os.path.dirname(__file__), 'wa')
sys.path.insert(0, os.path.join(wa_dir, 'framework'))
from version import get_wa_version, get_wa_version_with_commit
from version import (get_wa_version, get_wa_version_with_commit,
format_version, required_devlib_version)
# happens if falling back to distutils
warnings.filterwarnings('ignore', "Unknown distribution option: 'install_requires'")
@ -81,14 +82,15 @@ params = dict(
'pexpect>=3.3', # Send/receive to/from device
'pyserial', # Serial port interface
'colorama', # Printing with colors
'pyYAML', # YAML-formatted agenda parsing
'pyYAML<=3.13', # YAML-formatted agenda parsing
'requests', # Fetch assets over HTTP
'devlib>=1.1.0', # Interacting with devices
'devlib>={}'.format(format_version(required_devlib_version)), # Interacting with devices
'louie-latest', # callbacks dispatch
'wrapt', # better decorators
'pandas>=0.23.0', # Data analysis and manipulation
'future', # Python 2-3 compatiblity
],
dependency_links=['https://github.com/ARM-software/devlib/tarball/master#egg=devlib-1.1.dev1'],
extras_require={
'other': ['jinja2'],
'test': ['nose', 'mock'],
@ -122,7 +124,6 @@ class sdist(orig_sdist):
orig_sdist.initialize_options(self)
self.strip_commit = False
def run(self):
if self.strip_commit:
self.distribution.get_version = get_wa_version

@ -21,14 +21,19 @@ import os
import warnings
import devlib
try:
from devlib.utils.version import version as installed_devlib_version
except ImportError:
installed_devlib_version = None
from wa.framework import pluginloader
from wa.framework.command import init_argument_parser
from wa.framework.configuration import settings
from wa.framework.configuration.execution import ConfigManager
from wa.framework.host import init_user_directory, init_config
from wa.framework.exception import ConfigError
from wa.framework.version import get_wa_version_with_commit
from wa.framework.exception import ConfigError, HostError
from wa.framework.version import (get_wa_version_with_commit, format_version,
required_devlib_version)
from wa.utils import log
from wa.utils.doc import format_body
@ -64,6 +69,13 @@ def split_joined_options(argv):
return output
# Instead of presenting an obscure error due to a version mismatch explicitly warn the user.
def check_devlib_version():
if not installed_devlib_version or installed_devlib_version < required_devlib_version:
msg = 'WA requires Devlib version >={}. Please update the currently installed version {}'
raise HostError(msg.format(format_version(required_devlib_version), devlib.__version__))
def main():
if not os.path.exists(settings.user_directory):
init_user_directory()
@ -102,6 +114,7 @@ def main():
logger.debug('Version: {}'.format(get_wa_version_with_commit()))
logger.debug('devlib version: {}'.format(devlib.__full_version__))
logger.debug('Command Line: {}'.format(' '.join(sys.argv)))
check_devlib_version()
# each command will add its own subparser
subparsers = parser.add_subparsers(dest='command')

@ -602,6 +602,12 @@ class Metric(Podable):
instance._pod_version = pod_version # pylint: disable =protected-access
return instance
@property
def label(self):
parts = ['{}={}'.format(n, v) for n, v in self.classifiers.items()]
parts.insert(0, self.name)
return '/'.join(parts)
def __init__(self, name, value, units=None, lower_is_better=False,
classifiers=None):
super(Metric, self).__init__()

@ -273,10 +273,14 @@ class ResourceResolver(object):
def apk_version_matches(path, version):
version = list_or_string(version)
info = ApkInfo(path)
if info.version_name == version or info.version_code == version:
return True
return loose_version_matching(version, info.version_name)
for v in version:
if info.version_name == v or info.version_code == v:
return True
if loose_version_matching(v, info.version_name):
return True
return False
def loose_version_matching(config_version, apk_version):

@ -53,9 +53,9 @@ def kernel_version_from_pod(pod):
def kernel_config_from_pod(pod):
config = KernelConfig('')
config._config = pod['kernel_config']
config.typed_config._config = pod['kernel_config']
lines = []
for key, value in config._config.items():
for key, value in config.items():
if value == 'n':
lines.append('# {} is not set'.format(key))
else:
@ -313,7 +313,7 @@ def cache_target_info(target_info, overwrite=False):
class TargetInfo(Podable):
_pod_serialization_version = 2
_pod_serialization_version = 4
@staticmethod
def from_pod(pod):
@ -401,3 +401,15 @@ class TargetInfo(Podable):
pod['page_size_kb'] = pod.get('page_size_kb')
pod['_pod_version'] = pod.get('format_version', 0)
return pod
@staticmethod
def _pod_upgrade_v3(pod):
config = {}
for key, value in pod['kernel_config'].items():
config[key.upper()] = value
pod['kernel_config'] = config
return pod
@staticmethod
def _pod_upgrade_v4(pod):
return TargetInfo._pod_upgrade_v3(pod)

@ -19,15 +19,23 @@ from collections import namedtuple
from subprocess import Popen, PIPE
VersionTuple = namedtuple('Version', ['major', 'minor', 'revision'])
VersionTuple = namedtuple('Version', ['major', 'minor', 'revision', 'dev'])
version = VersionTuple(3, 1, 1)
version = VersionTuple(3, 1, 2, '')
required_devlib_version = VersionTuple(1, 1, 1, '')
def format_version(v):
version_string = '{}.{}.{}'.format(
v.major, v.minor, v.revision)
if v.dev:
version_string += '.{}'.format(v.dev)
return version_string
def get_wa_version():
version_string = '{}.{}.{}'.format(
version.major, version.minor, version.revision)
return version_string
return format_version(version)
def get_wa_version_with_commit():

@ -22,7 +22,7 @@ from wa.framework.plugin import TargetedPlugin, Parameter
from wa.framework.resource import (ApkFile, ReventFile,
File, loose_version_matching)
from wa.framework.exception import WorkloadError, ConfigError
from wa.utils.types import ParameterDict
from wa.utils.types import ParameterDict, list_or_string
from wa.utils.revent import ReventRecorder
from wa.utils.exec_control import once_per_instance
@ -73,7 +73,7 @@ class Workload(TargetedPlugin):
supported_platforms = getattr(self, 'supported_platforms', [])
if supported_platforms and self.target.os not in supported_platforms:
msg = 'Supported platforms for "{}" are "{}", attemping to run on "{}"'
msg = 'Supported platforms for "{}" are "{}", attempting to run on "{}"'
raise WorkloadError(msg.format(self.name, ' '.join(self.supported_platforms),
self.target.os))
@ -174,6 +174,7 @@ class ApkWorkload(Workload):
# Times are in seconds
loading_time = 10
package_names = []
supported_versions = []
view = None
clear_data_on_reset = True
@ -235,6 +236,12 @@ class ApkWorkload(Workload):
will fall back to the version on the target if available. If
``False`` then the version on the target is preferred instead.
"""),
Parameter('view', kind=str, default=None, merge=True,
description="""
Manually override the 'View' of the workload for use with
instruments such as the ``fps`` instrument. If not specified,
a workload dependant 'View' will be automatically generated.
"""),
]
@property
@ -253,7 +260,7 @@ class ApkWorkload(Workload):
package_name=self.package_name,
variant=self.variant,
strict=self.strict,
version=self.version,
version=self.version or self.supported_versions,
force_install=self.force_install,
install_timeout=self.install_timeout,
uninstall=self.uninstall,
@ -265,6 +272,9 @@ class ApkWorkload(Workload):
def initialize(self, context):
super(ApkWorkload, self).initialize(context)
self.apk.initialize(context)
# pylint: disable=access-member-before-definition, attribute-defined-outside-init
if self.version is None:
self.version = self.apk.apk_info.version_name
if self.view is None:
self.view = 'SurfaceView - {}/{}'.format(self.apk.package,
self.apk.activity)
@ -749,8 +759,9 @@ class PackageHandler(object):
matching_packages = []
for package in installed_versions:
package_version = self.target.get_package_version(package)
if loose_version_matching(self.version, package_version):
matching_packages.append(package)
for v in list_or_string(self.version):
if loose_version_matching(v, package_version):
matching_packages.append(package)
if len(matching_packages) == 1:
self.package_name = matching_packages[0]
elif len(matching_packages) > 1:

@ -164,7 +164,7 @@ class FpsInstrument(Instrument):
os.remove(entry)
if not frame_count.value:
context.add_event('Could not frind frames data in gfxinfo output')
context.add_event('Could not find frames data in gfxinfo output')
context.set_status('PARTIAL')
self.check_for_crash(context, fps.value, frame_count.value,

Binary file not shown.

Binary file not shown.

@ -196,7 +196,7 @@ int main(int argc, char ** argv) {
strip(buf);
printf(",%s", buf);
buf[0] = '\0'; // "Empty" buffer
memset(buf, 0, sizeof(buf)); // "Empty" buffer
}
printf("\n");
usleep(interval);

@ -206,7 +206,7 @@ class PostgresqlResultProcessor(OutputProcessor):
target_pod['sched_features'],
target_pod['page_size_kb'],
# Android Specific
target_pod.get('screen_resolution'),
list(target_pod.get('screen_resolution', [])),
target_pod.get('prop'),
target_pod.get('android_id'),
target_pod.get('pod_version'),

@ -81,12 +81,22 @@ public class UiAutomation extends BaseUiAutomation implements ApplaunchInterface
// Activate the tab switcher
tabSwitcher = mDevice.findObject(new UiSelector().resourceId(packageID + "tab_switcher_button")
.className("android.widget.ImageButton"));
tabSwitcher.clickAndWaitForNewWindow(uiAutoTimeout);
// Click the New Tab button
newTab = mDevice.findObject(new UiSelector().resourceId(packageID + "new_tab_button")
.className("android.widget.Button"));
newTab.clickAndWaitForNewWindow(uiAutoTimeout);
if (tabSwitcher.exists()){
tabSwitcher.clickAndWaitForNewWindow(uiAutoTimeout);
// Click the New Tab button
newTab = mDevice.findObject(new UiSelector().resourceId(packageID + "new_tab_button")
.className("android.widget.Button"));
newTab.clickAndWaitForNewWindow(uiAutoTimeout);
}
// Support Tablet devices which do not have tab switcher
else {
UiObject menu_button = mDevice.findObject(new UiSelector().resourceId(packageID + "menu_button")
.className("android.widget.ImageButton"));
menu_button.click();
newTab = mDevice.findObject(new UiSelector().resourceId(packageID + "menu_item_text")
.textContains("New tab"));
newTab.click();
}
}
public void followTextLink(String text) throws Exception {

@ -77,13 +77,13 @@ class ExoPlayer(ApkWorkload):
video_directory = os.path.join(settings.dependencies_directory, name)
package_names = ['com.google.android.exoplayer2.demo']
versions = ['2.4', '2.5', '2.6']
supported_versions = ['2.4', '2.5', '2.6']
action = 'com.google.android.exoplayer.demo.action.VIEW'
default_format = 'mov_720p'
view = 'SurfaceView - com.google.android.exoplayer2.demo/com.google.android.exoplayer2.demo.PlayerActivity'
parameters = [
Parameter('version', allowed_values=versions, default=versions[-1], override=True),
Parameter('version', allowed_values=supported_versions, override=True),
Parameter('duration', kind=int, default=20,
description="""
Playback duration of the video file. This becomes the duration of the workload.

@ -78,12 +78,13 @@ class Geekbench(ApkUiautoWorkload):
'activity': '.HomeActivity',
},
}
supported_versions = sorted(versions.keys())
begin_regex = re.compile(r'^\s*D/WebViewClassic.loadDataWithBaseURL\(\s*\d+\s*\)'
r'\s*:\s*(?P<content>\<.*)\s*$')
replace_regex = re.compile(r'<[^>]*>')
parameters = [
Parameter('version', default=sorted(versions.keys())[-1], allowed_values=sorted(versions.keys()),
Parameter('version', allowed_values=supported_versions,
description='Specifies which version of the workload should be run.',
override=True),
Parameter('loops', kind=int, default=1, aliases=['times'],
@ -109,23 +110,16 @@ class Geekbench(ApkUiautoWorkload):
def activity(self):
return self.versions[self.version]['activity']
@property
def package(self):
return self.versions[self.version]['package']
@property
def package_names(self):
return [self.package]
return set(self.versions[v]['package'] for v in self.versions)
def __init__(self, *args, **kwargs):
super(Geekbench, self).__init__(*args, **kwargs)
def initialize(self, context):
super(Geekbench, self).initialize(context)
self.gui.uiauto_params['version'] = self.version
self.gui.uiauto_params['loops'] = self.loops
self.gui.uiauto_params['is_corporate'] = self.is_corporate
self.gui.timeout = self.timeout
def initialize(self, context):
super(Geekbench, self).initialize(context)
if not self.disable_update_result and not self.target.is_rooted:
raise WorkloadError(
'Geekbench workload requires root to collect results. '
@ -135,7 +129,6 @@ class Geekbench(ApkUiautoWorkload):
def setup(self, context):
super(Geekbench, self).setup(context)
self.run_timeout = self.timeout * self.loops
self.exact_apk_version = self.version
def update_output(self, context):
super(Geekbench, self).update_output(context)
@ -154,7 +147,7 @@ class Geekbench(ApkUiautoWorkload):
score_calculator.update_results(context)
def update_result_3(self, context):
outfile_glob = self.target.path.join(self.target.package_data_directory, self.package, 'files', '*gb3')
outfile_glob = self.target.path.join(self.target.package_data_directory, self.apk.package, 'files', '*gb3')
on_target_output_files = [f.strip() for f in self.target.execute('ls {}'.format(outfile_glob),
as_root=True).split('\n') if f]
for i, on_target_output_file in enumerate(on_target_output_files):
@ -176,7 +169,7 @@ class Geekbench(ApkUiautoWorkload):
section['multicore_score'])
def update_result_4(self, context):
outfile_glob = self.target.path.join(self.target.package_data_directory, self.package, 'files', '*gb*')
outfile_glob = self.target.path.join(self.target.package_data_directory, self.apk.package, 'files', '*gb*')
on_target_output_files = [f.strip() for f in self.target.execute('ls {}'.format(outfile_glob),
as_root=True).split('\n') if f]
for i, on_target_output_file in enumerate(on_target_output_files):
@ -395,16 +388,12 @@ class GeekbenchCorproate(Geekbench): # pylint: disable=too-many-ancestors
name = "geekbench-corporate"
is_corporate = True
requires_network = False
versions = ['4.1.0', '5.0.0']
supported_versions = ['4.1.0', '5.0.0']
package_names = ['com.primatelabs.geekbench4.corporate']
activity = 'com.primatelabs.geekbench.HomeActivity'
package = 'com.primatelabs.geekbench4.corporate'
parameters = [
Parameter('version',
default=sorted(versions)[-1], allowed_values=versions,
override=True)
Parameter('version', allowed_values=supported_versions, override=True)
]

@ -56,10 +56,8 @@ class Glb(ApkUiautoWorkload):
view = 'com.glbenchmark.glbenchmark27/com.glbenchmark.activities.GLBRender'
package_names = ['com.glbenchmark.glbenchmark27', 'com.glbenchmark.glbenchmark25']
packages = {
'2.7': 'com.glbenchmark.glbenchmark27',
'2.5': 'com.glbenchmark.glbenchmark25',
}
supported_versions = ['2.7', '2.5']
# If usecase is not specified the default usecase is the first supported usecase alias
# for the specified version.
supported_usecase_aliases = {
@ -74,7 +72,7 @@ class Glb(ApkUiautoWorkload):
regex = re.compile(r'GLBenchmark (metric|FPS): (.*)')
parameters = [
Parameter('version', default='2.7', allowed_values=['2.7', '2.5'], override=True,
Parameter('version', allowed_values=supported_versions, override=True,
description=('Specifies which version of the benchmark to run (different versions '
'support different use cases).')),
Parameter('use_case', default=None,
@ -107,10 +105,9 @@ class Glb(ApkUiautoWorkload):
Alias('t-rex_offscreen', use_case='t-rex', type='offscreen'),
]
def __init__(self, target, **kwargs):
super(Glb, self).__init__(target, **kwargs)
def initialize(self, context):
super(Glb, self).initialize(context)
self.gui.uiauto_params['version'] = self.version
if self.use_case is None:
self.use_case = self.supported_usecase_aliases[self.version][0]
if self.use_case.lower() in USE_CASE_MAP:
@ -124,7 +121,6 @@ class Glb(ApkUiautoWorkload):
self.gui.uiauto_params['usecase_type'] = self.type.replace(' ', '_')
self.gui.uiauto_params['timeout'] = self.run_timeout
self.package_names = [self.packages[self.version]]
def update_output(self, context):
super(Glb, self).update_output(context)

@ -85,7 +85,7 @@ class ManualWorkload(Workload):
def run(self, context):
self.logger.info('START NOW!')
if self.duration:
self.device.sleep(self.duration)
self.target.sleep(self.duration)
elif self.user_triggered:
self.logger.info('')
self.logger.info('hit any key to end your workload execution...')

@ -48,11 +48,11 @@ class Vellamo(ApkUiautoWorkload):
'3.0': ['Browser', 'Metal', 'Multi'],
'3.2.4': ['Browser', 'Metal', 'Multi'],
}
valid_versions = list(benchmark_types.keys())
supported_versions = list(benchmark_types.keys())
summary_metrics = None
parameters = [
Parameter('version', kind=str, allowed_values=valid_versions, default=sorted(benchmark_types, reverse=True)[0], override=True,
Parameter('version', kind=str, allowed_values=supported_versions, override=True,
description=('Specify the version of Vellamo to be run. '
'If not specified, the latest available version will be used.')),
Parameter('benchmarks', kind=list_of_strs, allowed_values=benchmark_types['3.0'], default=benchmark_types['3.0'],
@ -66,15 +66,15 @@ class Vellamo(ApkUiautoWorkload):
]
def setup(self, context):
super(Vellamo, self).setup(context)
self.gui.uiauto_params['version'] = self.version
self.gui.uiauto_params['browserToUse'] = self.browser
self.gui.uiauto_params['metal'] = 'Metal' in self.benchmarks
self.gui.uiauto_params['browser'] = 'Browser' in self.benchmarks
self.gui.uiauto_params['multicore'] = 'Multi' in self.benchmarks
super(Vellamo, self).setup(context)
def validate(self):
super(Vellamo, self).validate()
def initialize(self, context):
super(Vellamo, self).initialize(context)
if self.version == '2.0.3' or not self.benchmarks: # pylint: disable=access-member-before-definition
self.benchmarks = self.benchmark_types[self.version] # pylint: disable=attribute-defined-outside-init
else: