Sweeps are handled by one of three handlers, ``autofreq``, ``range`` and
``autoparam``. ``range`` allows the user to manually specify values for
a parameter in the agenda; ``autofreq`` allows cpu frequencies to be
swept through, and autoparam allows other parameters to be swept
through.
autoparam requries the parameter to have ``allowed_values`` specified,
and the sweep specification must supply the plugin name and parameter
name as:
``
sweep(autoparam):
param: <param name>
plugin: <plugin name>
``
autofreq can be used with an empty value:
``
sweep(autofreq):
``
to sweep through all values of ``frequency`` by default, although if
``plugin`` is specified, other parameters within cpufreq can be swept
through:
``
sweep(autofreq):
param: cpu0_frequency
``
For either of the above 'automatic' sweeps, a minimum and/or maximum can
be specified to limit the values generated in the sweep:
``
sweep(autofreq):
param: cpu0_frequency
min: 1000000
max: 1700000
``
``range`` sweeps support two specification syntaxes: one for manual
specification of a list, and another for a range of values. These sweeps
only accept the plugin name as a parameter:
``
sweep(range):
threads: [1, 3, 5, 7]
``
or
``
sweep(range):
threads: 1-8,2
# start-stop[,step]
``
These both produce the same result. step is optional and defaults to 1.
Any sweep specified in a workload entry is equivalent to manually
specifying individual workload entries, each with one of the possible
values of the sweep.
Sweeps specified in sections will create the equivalent of a section
group, each section in that group with one of the sweep values. When the
group name is specified, the 'expanded' section entry will maintain that
group name, otherwise will generate its own.
If multiple sweeps are specified in one entry, then this will be
expanded to one entry for every combination of values of each sweep.
To prevent long timeouts occurring during to file locking on
both reads and writes replace locking with
atomic writes.
While this may results in cache entries being overwritten,
the amount of time used in duplicated retrievals will likely
be saved with the prevention of stalls due to waiting to
acquire the file lock.
To simulate atomic writes, use a context manager to write to
a temporary file location and then rename over the original
file.
This is performed using the `safe_move` method which performs
this operation and handles cases where the source and destination
are on separate file systems.
Use the original file path to create a lock file in the system temp
directory. This prevents issues where we are attempting to lock a file
where wa does not have permission to create new files.
Some devices print non standard characters to logcat. If an error
occurs when parsing the output, replace the offending character instead
of raising an error.
Correctly handle the presence of both an element and its toggle in the
input, and handle them base on order, e.g.
toggle_set(['x', 'y', '~x']) --> {'y', '~x'}
toggle_set(['~x', 'y', 'x']) --> {'y', 'x'}
The list of modules retrieved from a `Target` may include configuration
as a dictionary. This helper function will produce a set of only the
module names allowing for comparison.
When updating a ParameterDict with another ParameterDict the unencoded
values were being merged. Ensure consistent behaviour by implicitally
iterating via `__iter__` which will cause ParameterDict values to be
decoded before being re-endcoded as expected.
Fix warnings reported when running unit tests via pytest.
- Rename TestDevice to MockDevice, so that it is not interpreted as a
test case.
- Fix collections abstract base class imports.
- Add an ini file to ignore the same from "past".
Improve checking of whether cpu idle state information is available for
processing.
Add debug message to inform user if the cpuidle module is not detected
on the target.
In the case of an empty iterable an empty string would be returned
however this was not an valid value so ensure that the brackets are
always inserted into the output.
Include missing `flatten_mapping` call in our implementation of
`construct_mapping`. This is performed by a subclass in the default
implementation which was missing in our previous fix.
When attempting to access the message of a exception check not only that
e.args is populated, but also that e.args[0] actually contains
something, before defaulting to str(e).
In newer versions of PyYAML we need to manually specify the `Loader` to
be used as per https://msg.pyyaml.org/load.
`FullLoader` is now the default loader which attempts to avoid arbitrary
code execution, however if we are running an older version where this is
not available default back to the original Loader.
Add a new mix-in class for classes that are serialized to PODs, the aim
of this class is to provide a way to ensure that both the original data
version and the current serialization version are known. When attempting
to de-serialize a POD the serialization version will be compared to the
latest version in WA if not matching will call the appropriate method to
upgrade the pod to a known structure state populating any missing fields
with a sensible default or converting the existing data to the new
format.
- change magic string literal to a b'' string so that the comparison
works in python 3
- expand timestamp tuples (struct.unpack always returns a tuple) before
attempting to cast to float.
The Output processor which is used to upload the results found in the
wa_output folder to a Postgres database, whose schema is defined by the
WA Create Database command.
- Change how "source" and "dest" are handled inside merge() to be more
sane and less confusing, ensuring that disabling toggles are merged
correctly.
- Do not drop disabling values during merge, to ensure that merging
is a transitive operation.
- Add unit tests for the above fixes.