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

135 Commits

Author SHA1 Message Date
Marc Bonnici
d56f0fbe20 utils/misc: Add file locking context manager
Enable automation locking and unlocking of a file path provided. Used to
prevent synchronisation issues between multiple wa processes.
2020-04-09 09:14:39 +01:00
Marc Bonnici
dad0a28b5e logcat_parsing: Replace errors when decoding logcat output
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.
2020-04-07 14:15:24 +01:00
Sergei Trofimov
5f00a94121 utils/types: fix toggle_set creation
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'}
2020-02-19 17:02:58 +00:00
Sergei Trofimov
0f2de5f951 util/exec_control: add once_per_attribute_value
Add a decorator to run a method once for all instances that share the
value of the specified attribute.
2020-02-07 16:49:48 +00:00
Marc Bonnici
977ce4995d utils/types: Add module_name_set type
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.
2020-01-16 15:55:29 +00:00
Marc Bonnici
39a294ddbe utils/types: Update version_tuple to allow splitting on "-"
Some Apks use "-" characters to separate their version and identifier so
treat as a separator value.
2020-01-14 13:24:51 +00:00
Marc Bonnici
164095e664 utils/types: Update version_tuple to use strings
The versionName field of an apk allows for containing non-numerical
characters so update the type to be a string.
2020-01-14 13:24:51 +00:00
Sergei Trofimov
05857ec2bc utils/cpustates: update idle state naming
If idle state names for a cpu could not be discovered, use "idle[N]"
where N is the state number, instead of just making them all as
"unknown".
2020-01-10 13:32:40 +00:00
Sergei Trofimov
fd8a7e442c utils/trace_cmd: update for Python 3
re._pattern_type became re.Pattern in Python 3.
2020-01-10 13:31:30 +00:00
Marc Bonnici
817d98ed72 wa/instruments: Refactor collectors to use Collector Inferface
Update the WA instruments which rely on the refactored devlib collectors
to reflect the new API.
2019-12-20 15:17:01 +00:00
Marc Bonnici
494424c8ea utils/types: Fix ParameterDict update method.
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.
2019-12-18 10:07:11 +00:00
Sergei Trofimov
cc1cc6f77f tests: fix pytest warnings
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".
2019-12-03 14:03:18 +00:00
Marc Bonnici
ab5d12be72 output_processors/cpustates: Improve handling of missing cpuinfo data
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.
2019-10-15 15:17:02 +01:00
Marc Bonnici
298bc3a7f3 output_processors/cpustates: Deal with cpufreq data being unavailable
If the `cpufreq` module is not detected as present then warn the user
and processes the remaining data instead of crashing.
2019-10-15 15:17:02 +01:00
Marc Bonnici
09d6f4dea1 uilts/cpustates: Fix inverted no_idle check
If there is no information about idle states then `no_idle` should be
set to `True` instead of `False`.
2019-10-15 15:17:02 +01:00
Marc Bonnici
c950f5ec8f utils/postgres: Fix formatting 2019-07-19 16:36:11 +01:00
Marc Bonnici
d87025ad3a output_processors/postgres: Fix empty iterable
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.
2019-07-19 16:36:11 +01:00
Marc Bonnici
a5f0521353 utils/types: Fix typos 2019-06-28 17:56:13 +01:00
Marc Bonnici
f46851a3b4 utils/types: Add version_tuple
Allow for `version_tuple` to be used more generically to enable
natural comparing of versions encoded as strings.
2019-06-28 17:56:13 +01:00
Marc Bonnici
83f826d6fe utils/serializser: Re-fix support for YAML anchors
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.
2019-05-17 20:04:33 +01:00
Marc Bonnici
76e6f14212 utils/serializer: pylint fixes 2019-05-15 19:48:39 +01:00
Marc Bonnici
ce59318e66 utils/serializer: Fix using incorrect loader and imports
- Ensure that the new loader is used when opening files to ensure that our
custom constructors are used.
- Fix missing imports
2019-05-15 19:48:39 +01:00
Sergei Trofimov
5652057adb utils/serializer: fix support for YAML anchors.
Change the way maps get processed by YAML constructor to support YAML
features, such as anchors, while still maintaining dict ordering.
2019-05-15 09:59:14 +01:00
Sergei Trofimov
e9f5577237 utils/serializer: fix error reporting for YAML
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).
2019-05-15 09:57:52 +01:00
Marc Bonnici
769aae3047 utils/serializer: Explicitly state yaml loader
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.
2019-03-04 15:50:13 +00:00
Marc Bonnici
a1ba3c6f69 utils/misc: Update load structure to use WA's yaml wrapper 2019-03-04 15:50:13 +00:00
Sergei Trofimov
ed95755af5 fw/output: better classifiers format for metrics
Use a dict-like string representation for classifiers, rather than the
default OrderedDict one, which is a lot more verbose and difficult to
read.
2019-01-10 13:03:29 +00:00
Marc Bonnici
4f67cda89f utils/types: When creating an enum also try to deserialize from POD
Allows for recreating an Enum from a full string representation of the Enum
rather than just the name of the Enum.
2018-12-07 09:55:17 +00:00
Marc Bonnici
0426a966da utils/postgres: Relocate functions to retrieve schema information
Move the functions to retrieve schema information to general utilities to
be used in other classes.
2018-12-07 09:55:17 +00:00
Marc Bonnici
64f7c2431e utils/postgres: Rename postgres_covert to house more general methods
Rename the postgres_covert file to allow for place more general postgres
utility functions.
2018-12-07 09:55:17 +00:00
Marc Bonnici
86287831b3 utilts/serializer: Update exception method to support Python3 2018-12-07 09:55:17 +00:00
Marc Bonnici
88a4677434 utils/serializer: Fix attempting to deserialize a single value. 2018-12-07 08:46:12 +00:00
Marc Bonnici
4ff7e4aab0 utils/serializer: Add Podable Mix-in class
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.
2018-12-07 08:46:12 +00:00
Marc Bonnici
bb282eb19c wa: Remove reference to devlibs escaping methods
As part of https://github.com/ARM-software/devlib/pull/339 the escaping
method are being removed in favour of using `quote` from `pipes` so
also make reflecting changes here.
2018-11-21 15:07:25 +00:00
Marc Bonnici
f2f210c37f utils/postgres_convert: PEP8 fix
Remove unused local variable.
2018-10-24 10:34:44 +01:00
Marc Bonnici
375a36c155 utils/log: Ensure to convert all arguments to strings
Ensure that all arguments provided for an Exception are converted to
stings before attempting to join them for debug information.
2018-10-09 15:26:53 +01:00
Sergei Trofimov
98727bce30 utils/revent: recording parser fixes
- 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.
2018-10-08 17:46:35 +01:00
Waleed El-Geresy
6d654157b2 Add Postgres Output Processor
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.
2018-09-12 10:13:34 +01:00
Sergei Trofimov
6d9ec3138c In lint we trust
Quieten pylint with regard to import order.
2018-07-18 11:20:48 +01:00
Sergei Trofimov
96dd100b70 utils/toggle_set: fix merge behavior
- 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.
2018-07-11 10:48:00 +01:00
Marc Bonnici
5714c8e6a1 wa: Additional pylint fixes 2018-07-10 12:56:51 +01:00
Marc Bonnici
791d9496a7 wa: Pylint Fixes for Travis
Pylint has trouble using imports from the distutils module in
virtualenvs so we need to explicitly ignore these imports.
2018-07-10 12:56:51 +01:00
Marc Bonnici
e8b0d42758 wa: PEP8 Fixes 2018-07-10 12:56:51 +01:00
Sergei Trofimov
c410d2e1a1 I lint, therefore I am
Implement fixes for the most recent pylint version.
2018-07-09 15:59:40 +01:00
Marc Bonnici
925bc8b719 wa: pep8 fixes 2018-07-06 14:39:41 +01:00
Marc Bonnici
185bff9029 wa/utils: Fix pylint errors 2018-07-06 14:39:41 +01:00
Marc Bonnici
1550e9a788 wa/utils: Remove unrequired imports 2018-07-06 14:39:41 +01:00
Marc Bonnici
4d1c03cc5c utils/types: Rename cls argument 2018-07-06 14:39:41 +01:00
Marc Bonnici
cbc7b2647f utils/types: Ignore import errors 2018-07-06 14:39:41 +01:00
Marc Bonnici
1a08b2a6c7 utils: pep8 fixes 2018-07-06 14:39:41 +01:00