1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2024-10-06 10:51:13 +01:00
Commit Graph

217 Commits

Author SHA1 Message Date
Sergei Trofimov
28e339d3b2 tools/revent: timestamp adjustment fixes
- Make sure start/end timestamps are properly adjusted when there are
  zero events.
- Rename adjust_event_times --> adjust_timestamps, as the latter better
  fits its current function.
- Add a couple of debug messages.
2017-09-28 15:11:28 +01:00
Brendan Jackman
14eba69229 wa: Add ApkWorkload to default imports 2017-09-28 13:09:28 +01:00
Sergei Trofimov
831515ae8d instrumentation/energy_measurement: update for DerivedMetrics
DerivedMeasurements in devlib was changed to return DerivedMetrics
instead of Measurements. The former do not have "channel" attribute, so
just pass its name to WA's metrics.
2017-09-28 13:06:33 +01:00
Sergei Trofimov
7b1cc6fa4e utils/serializer: add OrderedDict to POD_TYPES
Allow OrderedDict to be serialized in the same way as regular dicts by
defining it as a Plain Old Data type.
2017-09-28 10:46:03 +01:00
Sergei Trofimov
ecd0dbd55b Add templerun2 workload 2017-09-27 10:34:50 +01:00
Sergei Trofimov
9d7f998511 framework/instrumentation: handle non-job errors in ManagedCallback
If an error occurs in a ManagedCallback that is invoked outside of a
job, re-raise rather than attempting to update the status of the
non-existent job.
2017-09-27 10:34:50 +01:00
Sergei Trofimov
0c40cdae18 tools/revent: improve recording + add prebuilts
The begining and end of recording timestamps are now stored as part of
the recording. This allows to correctly replay recordings where the
first event occurs some time after the recording started, or the last
event some time before recording ended.

Add pre-built revent binaries for the armeabi and arm64 architectures.
2017-09-27 10:34:00 +01:00
Sergei Trofimov
0934037e1b revent fixes
- do not attempt to replay setup if a setup recording has not been
  provided (perviously, setup was mandatory).
- update the apk initialization to the correct method inside the record
  command.
2017-09-27 10:32:41 +01:00
Sergei Trofimov
335ed8198c instumentation/energy_management: update import to match devlib change 2017-09-27 10:32:41 +01:00
Sergei Trofimov
261417a9db framework/configuration: fix workload config with multiple sections
When an agenda contains multiple sections, the same workload entry might
be used in construction of multiple job specs. Job spec construction may
mangle the workload entry. To prevent this from impacting other
jobs, use a deep copy of the workload entry when constructing a job
spec.
2017-09-27 10:32:41 +01:00
Sergei Trofimov
c96181bed7 framework/configruation: fix mandatory workload parameters
PluginCache.get_plugin_config assumes that no more configuration is to
be processed, and therefore config is final. As such, it is validating
that mandatory parameters are set. This assumption is invalid for
workload_parameters, however, as those need to be resolved on per-spec
basis, and cannot be globally cached.

This commit adds a prameter for get_plugin_config that indicates whether
or not it should consider the config to be final.
2017-09-27 10:32:41 +01:00
Sergei Trofimov
aec89a077e framework/configuration: fix connection_settings configuration
Connection settings were not being properly extracted from device_config
and not used. Meaning it was impossible to e.g. specify the adb device
to use for a run.

This ensures that connection settings are extracted, validated, and used
properly.
2017-09-27 10:32:31 +01:00
Sergei Trofimov
04d5ec4277 framework/run: fix JobState deserialization
At some point, JobState __init__ was changed to take the iteration
number, but its from_pod was not updated accordingly.
2017-09-27 10:32:31 +01:00
Sergei Trofimov
7c7ffe3e77 framework/run: fix job status handling.
- Re-order Status entries so that higher severity entries have higher
  enum values.
- Add set_status() to Job that ensures that a status is only set if it
  is of higher severity (e.g. a Job that has been marked as PARTIAL by
  an instrument will not be overwritten as OK by the runner).
- Retry no generates a new job, rather than re-enqueuing the existing
  object; this ensures that the output status is tracked properly.
- Adjust ManagedCallback to set set job status to FAILED if it sees a
  WorkloadError, and to PARTIAL other wise. The idea being that
  instruments raise WorkloadError if they have a reason to believe
  workload did not execute properly and indicated failure even if the
  workload itself has failed to detect it (e.g. FPS instrument detecting
  crashed content, where the workload might lack any feedback regarding
  the crash). Other errors would indicate an issue with the instrument
  itself, and so the job is marked as PARTIAL, as there is no reason to
  suspect that the workload is at fault and the other results generated
  for this execution may be valid.
2017-09-27 10:32:20 +01:00
Sergei Trofimov
fe53efcd49 framework/workload: ApkWorkload consistent package handling
Rename "package" parameter to "package_name" (to be cosnsitent with
package_names class attribute). "package" is now a property containting
the name of the actual package used after the APK is resolved.
2017-09-27 10:32:20 +01:00
Sergei Trofimov
1e233d2104 framework/job: track run time.
Job now tracks how long it took to run the workload and save the
timedelta value in the run_time attribute.
2017-09-27 10:32:20 +01:00
Sergei Trofimov
2ef4074c8b framework/execution: ExecutionContext enhancements
- Add workload property as the shortcut for accessing the workoad for
  the current job.
- Add set_status method that setts the status of the current job.
- Add get_metric method that searches for a metric in the output for the
  current job, or failing that, in the run output.
2017-09-27 10:32:19 +01:00
Sergei Trofimov
82b0b238c2 framework/output: add accessors for metrics and artifacts
- Add get_metric methods to Result and Output
- Add metrics and artifacts properties to Output
2017-09-27 10:32:19 +01:00
Sergei Trofimov
9b6d4d9fa6 utils/revent: stop recording fix.
It seems that occasionally an inclomplete recording file is pulled. Add
a one-second (target time) delay to allow SIGINT to be properly handled
and recording to be updated, followed by a sync to ensure the file has
been written.
2017-09-27 10:32:19 +01:00
Sergei Trofimov
c29b1c8b23 utils/log: log_error marks Exception as logged.
Mark the Exception is logged inside log_error, to prevent it form being
logged repeatedly if re-raised.
2017-09-27 10:32:19 +01:00
setrofim
67eca23ef7 Merge pull request #479 from bjackman/homescreen
Homescreen: Port homescreen workload to WA3
2017-09-15 21:47:12 +01:00
setrofim
5063ed6907 Merge pull request #480 from bjackman/remove-cpufreq-interactive
trace-cmd: remove cpufreq_interactive from default events
2017-09-15 21:45:06 +01:00
Brendan Jackman
4063ea0ba8 trace-cmd: remove cpufreq_interactive from default events
The interactive governor isn't standard any more (and was
Android-only anyway). Remove this default so you don't get errors for
kernels that don't support it.
2017-09-15 18:05:17 +01:00
Brendan Jackman
a79fb83fd1 framework/workload: Fix resolve_packge_from_target
This currently raises an error undonditionally when self.package is set, fix the
indentation so it only does that if it isn't installed on the target.
2017-09-15 18:04:11 +01:00
Sergei Trofimov
df01d8aa22 Homescreen: Port homescreen workload to WA3
Just did:  wlauto      -> wa
           self.device -> self.target
2017-09-15 18:03:24 +01:00
setrofim
0cc8ebbf69 Merge pull request #469 from marcbonnici/energy_measurement
Energy measurement
2017-08-21 08:50:28 +01:00
Marc Bonnici
bd126a430d Instruments/EnergyMeas: Adds support for DerivedMeasurement from devlib
Delvib now is capable of performing postprocessing of MeasurementCSV
files, instead of calculating additional metrics in WA this will be
performed externally. Currently support has been added for calculating
average power and cumulative energy.
2017-08-18 09:53:27 +01:00
Marc Bonnici
0f506dde17 RTConfig: Added support for specifying device initial screen state. 2017-08-16 17:35:19 +01:00
Marc Bonnici
51464165c1 RTConfig: Added android runtime config
Added a runtime config for android specific settings, currently
supported are screen brightness, rotation and airplane mode.
2017-08-16 17:35:19 +01:00
Marc Bonnici
c5b1caa276 Utils/Enum: Adds a __str__ method to display enum levels 2017-08-16 17:35:19 +01:00
Marc Bonnici
2cc60b77cb Utils/Serializer: Adds serializer support for level type 2017-08-16 11:10:46 +01:00
Marc Bonnici
5f919445d9 EnergyMeaseurement: Adds support for acme_cape 2017-08-11 10:30:19 +01:00
Marc Bonnici
b98b74f0be EnergyMeasurement: Removes parameter defaults
The instrument baseclass expects None for not defined parameters
instead of empty containers.
2017-08-11 10:30:19 +01:00
Marc Bonnici
de3301312f RTParams: Adds support for using default values for RT parameters 2017-08-09 16:01:39 +01:00
Marc Bonnici
bbfb802c00 RuntimeConfig: Makes setter_params optional
Now setter_params are optional when creating a Runtime Parameter to
allow them to be used for more purposes which don't require additional
settings.
2017-08-09 16:01:39 +01:00
Marc Bonnici
06be73f8e1 RuntimeConfig: Fixed typo 2017-08-09 16:01:39 +01:00
Sergei Trofimov
3f87f3ab07 utils/misc: remove enum_metaclass
It is unused and has been obsoleted by enum type in utils/types.
2017-08-09 15:59:20 +01:00
Sergei Trofimov
a9959550af utils/types: better enum class member setting
- What used to be enum.values is now enum.levels.
- Add enum.names and enum.values that are lists of enum's levels' names
  and values respectively.
- Add a check on creation to make sure that provided level names do not
  conflict with the atomatically created members.
2017-08-09 15:59:20 +01:00
Sergei Trofimov
5e0ff6aa51 cpufreq: rename get_domain_cpus
get_domain_cpus() got renamed to get_related_cpus() in devlib to reflect
the cpufreq nomenclature. This commit makes corresponding changes in WA.
2017-07-26 14:58:46 +01:00
setrofim
531dcfbb1b Merge pull request #447 from marcbonnici/energy_measurement
Energy measurement
2017-07-25 16:22:18 +01:00
Marc Bonnici
c455ad524f Parser: Fixes raising duplicate entry error. 2017-07-25 16:08:17 +01:00
Marc Bonnici
af49c5020f Instrumentation/Misc: Fixed using 'target' instead of 'device' 2017-07-25 16:08:17 +01:00
Marc Bonnici
e9a9f16032 EnergyMeasurement: Adds a wrapper for devlib instrumentation
The instrument allows for various devlib instruments (currently only
daq and energy_probe) to be used in WA to collect energy measurements.
2017-07-25 16:08:17 +01:00
Marc Bonnici
f8e4d34e60 APKResolution: Uses loose version matching
Allows for more flexible version matching  e.g. specifying a
version of 4, 4.3, 4.3.1 will all resolve to an apk version of 4.3.1
2017-07-20 14:30:52 +01:00
Marc Bonnici
c722a6a73c ApkResolution: Now takes into account apk abi when resolving.
Previously any apk found would be selected even if the abi did not match
the device, now an apk is only selected if it is compatible with the
device. Additionally the 'exact_abi' parameter has been added to allow only
selecting an apk if a devices primary abi's native code is present in
the apk, or there is no native code.
2017-07-20 14:30:52 +01:00
Marc Bonnici
5ef3d7673f Getters: Fixes raising error instead of returning. 2017-07-14 18:09:01 +01:00
Marc Bonnici
d76c78f3f6 trace-cmd: documentation fixes.
- Remove reference to default events from the overall workload
  documentation. It was, as of recently, outdated, and was also
  redundant, as the actual defaults will be in the parameter-specific
  documentation.
- Remove reference to Android-specific trace-cmd binary -- this was not
  true for a long time.
- Clarify that the on-host trace-cmd binary is now optional due to the
  report_on_target config.
2017-07-11 15:33:21 +01:00
Marc Bonnici
3382036d6e Vellamo: Ported workload to WA3 2017-07-10 11:18:32 +01:00
Marc Bonnici
b6cc845272 Youtube: Adds workload to WA3 2017-07-10 11:18:32 +01:00
Marc Bonnici
d015cce91e BenchmarkPi: Updated for uiauto2 refactor 2017-07-10 11:08:44 +01:00
Marc Bonnici
9284472d8b BaseUiAutomator: Ports additional functionality
Ports required functionality from WA2 for new workloads.
2017-07-10 11:08:44 +01:00
Marc Bonnici
d518328334 Uiauto: Removed reference to wlauto 2017-07-10 11:08:44 +01:00
Marc Bonnici
f9bc0261bf AndroidWorkload: Adds support for apk replacement/downgrading
Now tries to replace and downgrade an apk if already installed.
2017-07-10 11:08:44 +01:00
Marc Bonnici
4d397ab465 AndroidWorkload: Uninstall uiauto apks before reinstalling
Due to the fact that uiauto apk files built on different machines will
be signed with different keys, adb will fail to overwrite a previous
version even when set to replace. This commit now will uninstall the
previous uiauto apk file if present before attempting to install the new
version.
2017-07-10 11:08:43 +01:00
Marc Bonnici
27b488cc56 Jobs: Fixes job initialize/finalize
Previously initialize and finalize were being called for each iteration
of each workload at the start/end of the run which is incorrect
behaviour. To prevent this, each iteration of a workload now shares a
single instance of the workload combined with the 'once_per_instance' decorator
to ensure that the methods are only invoked once per set of workload
runs.
2017-07-10 11:08:43 +01:00
Marc Bonnici
91c49d9e95 ExecControl: Fixes bug with inheritance
Previously there was no differentiation between the same method at different
inheritance levels, therefore using the once_per_instance_decorator with super call would
prevent the super call from executing as they were considered the same
instance.
2017-07-10 11:08:43 +01:00
Marc Bonnici
3a376525cd PluginCache: Fixed Typo 2017-07-10 11:08:43 +01:00
Marc Bonnici
5232bc3504 Workload: Move gui deployment into setup
Ensures that the correct workload gui is deployed before each iteration.
2017-07-10 11:08:43 +01:00
Marc Bonnici
0b245ac2c8 Workload: Move package initialization into setup
To support runs that require different versions of an application
the discovery/installation process should be performed at the beginning
of each iteration and therefore has been moved into setup.
2017-07-10 11:08:43 +01:00
Marc Bonnici
0317604481 Workload: Moved uiauto command initialization to setup
In order to be able to pass the package name of the app under test to
the instrumented test, the generation of the uiautomator commands needed
to be postponed until after the apk resolution had been performed.
2017-07-10 11:08:43 +01:00
Marc Bonnici
d6f18466c9 Workload: Makes APK starting activity optional
The starting activity is not always listed in an apk or required to start
an application to its default state, for example youtube. Therefore now the
starting activity will only be used if one is available.
2017-07-10 11:08:43 +01:00
Marc Bonnici
1b93a4162b Workload: Updated to use a ParameterDict
In order to pass arguments to the instrumented test via the command line
they need to be encoded, this commit utilises a ParamDict to ensure
parameters are encoded correctly before passing them as arguments.
2017-07-10 11:08:43 +01:00
Marc Bonnici
85218a10d2 Types: Adds ParameterDict Type
Acts like a regular dictionary however will automatically url
encode/decode the data along with relevant type information.
2017-07-10 11:08:43 +01:00
marcbonnici
e884c3bcca Merge pull request #424 from setrofim/agenda-fix
AgendaPaser: fix duplicate source error
2017-06-27 10:46:04 +01:00
marcbonnici
b4363e401c Merge pull request #421 from setrofim/next
types: make enum levels serializable
2017-06-27 10:45:54 +01:00
Sergei Trofimov
d68bc49427 AgendaPaser: fix duplicate source error
When both global and config sections are present in an agenda, they both
will be processed by the ConfigManager. In each case, the path to the
agenda file was specified as the source, which resulted ConfigManager
complaining that the same source is being added twice. To avoid that,
the source is now suffixed with the section name.
2017-06-27 10:03:13 +01:00
Anthony Barbier
5c4aa76622 Fixed several typos in runtime_config.py file 2017-06-27 09:18:34 +01:00
Sergei Trofimov
5b3d7af62e types: make enum levels serializable
Add to/from_pod implementations to level, so that it may be serialized
properly. In order to make sure that serialization is a reversible
operation, ensure that the level value is numeric.
2017-06-26 09:13:30 +01:00
setrofim
399efb8474 Merge pull request #408 from marcbonnici/next_uiauto2
Updated apk workload mechanism and support for uiautomator 2
2017-06-21 08:53:04 +01:00
Marc Bonnici
8cf6051db8 TargetManager: Fixed Typo 2017-06-15 17:49:57 +01:00
Marc Bonnici
ec8d75ef4c TargetManager: Updated to allow failure of onlining cpus
Before performing feature discovery on a device, all cores are attempted to be
onlined, however due to power management on some phones, cores can be immediately
hotplugged out again therefore causing the command to file. This commit now just
logs a message to warn that the online process failed and the information obtained
from a device may be incomplete.
2017-06-15 17:49:57 +01:00
Marc Bonnici
d7dcbcae92 RuntimeConfig: Handle initialisation failure of RT plugin
Previously if one of the runtime parameters failed to initialize it would cause
the the entire setup process to fail. Now if an error is encountered e.g. a core
went offline when trying to read its information, that particular parameter will
be disabled along with it's supported parameters. This means that only if a user
attempts to use the RT parameter will execution be stopped however it will raise
a potentially misleading unsupported parameter error.
2017-06-15 17:49:57 +01:00
Marc Bonnici
279ed6a2c9 Workload: Splits ApkUIWorkload into ApkWorkload
This commit removes the UI elements from ApkUIWorkload to provide a base
ApkWorkload class in order to support workloads that do not require a GUI.
It also remove the `@once` decorator as apk resolution may need to be
run more than once per run.
2017-06-15 17:48:58 +01:00
Marc Bonnici
3662686b3f Core: Misc formatting fixes 2017-06-15 17:44:41 +01:00
Marc Bonnici
e186056182 Workload: Adds workload parameters for APKHandler
Now accepts parameters which can be used to determine which apk is to be used
and to control the apk installation procedure.
2017-06-15 17:44:41 +01:00
Marc Bonnici
8e5fd929e2 Core: Fixes error message for invalid config
Previously only an incorrect error message was generated without actually being
raised.
2017-06-15 17:44:41 +01:00
Marc Bonnici
6571d012c2 BenchmarkPi: Added default package name list 2017-06-15 17:44:41 +01:00
Marc Bonnici
4523fb74b6 Workload: Fixes apk resolution when not present on host.
Previously apk resolution would fail if the application apk was not present on
device as this was used to retrieve information e.g. the package name. To work
around this, the resolution process now supports searching the device for either
a list of package names retrieved from the workload or as a parameter passed by
the user at runtime and if found on the device will be pulled to the host to
perform its analysis.
2017-06-15 17:44:41 +01:00
Marc Bonnici
0c3e1c2526 Workload: Renamed ApkHander to PackageHandler 2017-06-12 14:57:55 +01:00
Marc Bonnici
037f0aac41 Resource: Add support for matching apks on package name 2017-06-12 14:57:55 +01:00
Marc Bonnici
238ae18491 Resource: Added support for uiautomator apks
As uiautomator2 uses apk for instrumented tests this allows for distinguishing
between a normal application apk and a uiauto test apk based on the apks package
name.
2017-06-12 14:57:55 +01:00
Marc Bonnici
c0f5d36b9b PluginCache: Add name to duplicate source error 2017-06-12 14:57:55 +01:00
Marc Bonnici
ef3b80d296 Benchmarkpi: Updated to uiautomator2 2017-06-12 14:57:55 +01:00
Marc Bonnici
b84550d981 Uiautomator: Upgraded uiautomator base classes to Uiauto2
Uiautomator1 has been deprecated, therefore the uiautomation base classes have
been upgraded to use uiautomator2 and the new gradle build system.
2017-06-12 14:57:54 +01:00
Marc Bonnici
b9b237f288 Android Workload: Updated to install and use Uiautomator 2 tests.
The new method of using uiautomation 2 is by using instrumented apk files rather
than JAR files. This commit updates the base workload has been updated to
install/uninstall the new uiautomation APK files and to invoke the relevant
instrumentation.
2017-06-12 14:57:54 +01:00
Sergei Trofimov
f0d5ff2309 utils/trace_cmd: add parsers for more sched events
Added parsers for sched_wakeup(_new) and sched_stat_* events
that have non-standard text.
2017-05-31 10:47:50 +01:00
Sergei Trofimov
8e3ae321a2 trace-cmd: Add parser for text trace.
This re-adds the parser for the trace-cmd text trace, after it got
dropped along with wlauto sub-tree. There are minor differences from the
old WA2 parser.

- Changed to work with devlib start/stop markers
- TraceCmdTrace renamed to TraceCmdParser
- The file path is now passed to the parse() method rather than
  on creation.
- detect whether markers are present in the trace and do not filter
  if they aren't
2017-05-25 11:32:42 +01:00
Sergei Trofimov
ac86304f35 idle: do not attempt to turn off screen on Linux
In the teardown, if screen_off was not set, only ensure that the
screen is on for Android targets.
2017-05-15 10:54:13 +01:00
Sergei Trofimov
f1804300d4 idle: makes sure screen is off if was off before
In the case where the device screen was off prior to the execution of
the workload, but the user did not set screen_off, the screen will be
turned on during the setup. Previously, it would remain on for the
subsequent execution, however the correct behavior is for the workload
to always restore the screen to its previous state.
2017-05-15 10:46:21 +01:00
Sergei Trofimov
e7290c3f14 idle: Add idle workload.
Added a workload that idles on target. For Android targets, there are
options for turning off the screen and/or Android services while idling.
2017-05-15 10:32:36 +01:00
Sergei Trofimov
04253b28c2 Fix typo. 2017-05-12 11:11:40 +01:00
Sergei Trofimov
e68d4fa2d1 trace-cmd: adding an instrument to collect kernel trace
This is the re-implementation of WA2's trace-cmd instrument that
utilizes devlib's ftrace collector. It allows collecting a trace of
kernel events.
2017-05-12 10:42:33 +01:00
Sergei Trofimov
83bf7e1510 plugin_cache: adding missing cfg_points definition 2017-05-12 09:28:59 +01:00
Sergei Trofimov
53d29bf3cf plugin: removing virtual referencies from meta
Remove referencies to "virtual" methods (that no longer exist) from the
plugin metaclass.
2017-05-11 09:57:38 +01:00
Sergei Trofimov
2bbe300dc2 tests: moved out of wa package
Tests now reside in the root of the repo, rather than in wa package.
This means they will no longer packaged and installed in user
deployments (they're only useful for developers).
2017-04-27 17:36:44 +01:00
Sergei Trofimov
6a5dda9bfb wa: removing log import from top-level __init__.py
This import no longer exists. Should be imported from utils instead.
2017-04-27 17:35:42 +01:00
Sergei Trofimov
2dd56990bb tests: removing stale test file
This file was never used (due to being incorrectly named) and contains
references to APIs that no longer exit.
2017-04-27 17:30:21 +01:00
Sergei Trofimov
4f33c98d0b Move misc instrumentation
Moved form a directory into a properly named file.
2017-04-27 09:01:21 +01:00
Sergei Trofimov
d96febb035 Remove execution and runner tests.
That part of the framework has been completely rewritting so the old
tests no longer make sense.
2017-04-27 09:01:20 +01:00
Sergei Trofimov
1b2373f5a5 Fix utils tests
- added missing import to types
- removed tests for TreeNode (no longer exists)
2017-04-27 09:01:20 +01:00