aboutsummaryrefslogtreecommitdiff
path: root/wa/utils
AgeCommit message (Collapse)Author
2018-10-24utils/postgres_convert: PEP8 fixMarc Bonnici
Remove unused local variable.
2018-10-09utils/log: Ensure to convert all arguments to stringsMarc Bonnici
Ensure that all arguments provided for an Exception are converted to stings before attempting to join them for debug information.
2018-10-08utils/revent: recording parser fixesSergei Trofimov
- 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-09-12Add Postgres Output ProcessorWaleed El-Geresy
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-07-18In lint we trustSergei Trofimov
Quieten pylint with regard to import order.
2018-07-11utils/toggle_set: fix merge behaviorSergei Trofimov
- 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-10wa: Additional pylint fixesMarc Bonnici
2018-07-10wa: Pylint Fixes for TravisMarc Bonnici
Pylint has trouble using imports from the distutils module in virtualenvs so we need to explicitly ignore these imports.
2018-07-10wa: PEP8 FixesMarc Bonnici
2018-07-09I lint, therefore I amSergei Trofimov
Implement fixes for the most recent pylint version.
2018-07-06wa: pep8 fixesMarc Bonnici
2018-07-06wa/utils: Fix pylint errorsMarc Bonnici
2018-07-06wa/utils: Remove unrequired importsMarc Bonnici
2018-07-06utils/types: Rename `cls` argumentMarc Bonnici
2018-07-06utils/types: Ignore import errorsMarc Bonnici
2018-07-06utils: pep8 fixesMarc Bonnici
2018-07-04Update copyright headers.Sergei Trofimov
- Add copyright headers to files that did not already have them - Update the year to the last year the file was modified in files with existing headers.
2018-07-04utils/types: Fix correct arguments for joinMarc Bonnici
Ensure that the join method for a ``str`` is passed a single list instead of 2 arguments.
2018-07-04utils/diff: Fix missing import for loggingMarc Bonnici
2018-07-04utils/android: Fix typo in variable assignmentMarc Bonnici
2018-07-04utils/serializer: Fix exception handling in Python3Marc Bonnici
Allow for the fact that exceptions do not have a 'message' attribute in Python3.
2018-06-28utils/misc: fix write_table column widthsSergei Trofimov
Consider headers when calculating column widths. This will ensure proper alignment in cases where the column header is wider than any of the column values.
2018-06-25utils/types: fix typosSergei Trofimov
2018-06-18utils/serializer: Handle empty file extensionsWaleed El-Geresy
The ValueError does not given enough information in the case of an empty file extension. Add a special case to handle files with no extension and prompt the user.
2018-06-14utils/types: implement __ne__ for levelSergei Trofimov
This should have been handled by the @total_ordering decorator, but isn't due to https://bugs.python.org/issue25732 (briefly, total_ordering is back-ported from Python 3, where the base object provides the default implementation of __ne__ based on __eq__, so total_ordering did not override it; this, however does not happen in Python 2). Also update unit tests to catch this edge case.
2018-06-14utils/diff: fix diff_interrupt_files on Python 2Sergei Trofimov
During Python 3 migration, the izip call inside diff_interrupt_files has been replaced with a zip call (zip returning an iterator in Python 3). Import zip from builtins to ensure that it also produces an iterator in Python 2. Also fix the associated unit test by importing the correct function.
2018-06-12utils/serializer: add basestring to POD_TYPESSergei Trofimov
Was replaced with str during Python 3 porting.
2018-06-12utils/serializer: fix level deserializationSergei Trofimov
Fix a regression introduced with Python 3 port -- JSON deserializer should check for basestring rather than str when deciding whether to try to decode a custom type.
2018-06-07Add support for Python 3Sergei Trofimov
Add support for running under Python 3, while maintaining compatibility with Python 2. See http://python-future.org/compatible_idioms.html for more details behind these changes.
2018-05-25utils/serializer: add cpu_mask to POD typesSergei Trofimov
2018-05-25utils/serializer: make is_pod() recursiveSergei Trofimov
If the object being passed into is_pod() is iterable (and not a string), recursively check that its elements are also PODs.
2018-05-24utils/doc: Add missing newline when generating aliases docsMarc Bonnici
Ensure when extracting aliases documentation it is followed by 2 newlines so that it formats correctly.
2018-05-24wa/misc: Fix format_duration() to handle missing timeMarc Bonnici
If a run is interrupted this can cause the time to be `None` causing an error, if this is the case then set time to 0 and therefore return `N/A`.
2018-05-24utils/counters: Remove duplicated counterMarc Bonnici
The implementation of the `counter` was duplicated in both `wa.utils.counters` and `wa.utils.types.counter` the latter of which is currently unsed, therefore port missing functionality to the former and remove.
2018-05-23utils/doc: include plugin aliases in the docsSergei Trofimov
If a plugin defines aliases, include the aliases and the parameter values they correspond to inside the docs.
2018-05-22utils/exec_control: Fix issue with `once_per_instance` decoratorMarc Bonnici
Previously the `once_per_instance` used the output of `__repr__` to identify the class of where the decorated method was called from. For classes that override this method to produce the same output for different instances of the same class this caused different instances to be mistakenly treated as one. Now use the hash of the containing class instead of the string representation and update the tests to catch this error.
2018-05-14wa/types: Add cpu_mask typeMarc Bonnici
Add a cpu_mask type to allow for users to use a consistent way of representing a cpus mask with properties to provide conversions between the various required forms. The mask can be specified directly as a mask, as a list of cpus indexes or a sysfs-style string. Also add support for the type to be serialized/deserialzed for the json and yaml serializers.
2018-05-14processors: add cpustatesSergei Trofimov
Add cpustates output processor. This is more-or-less a port of the cpustates processor from WA, however there are some differences: - Idle states are now tracked individually per-CPU. This will fix processing traces from targets that have different number of idle states on different clusters. - Simplify the parameter list for report_power_stats: - Replace paths to individual report files with a path to a single directory. A subdirectory will be created under it which will contain all the reports. - Replace the individual bits bits of information about CPUs (core names, idle states, etc) with a list of CpuInfo objects. - Clean up and simplify the code a bit: - Make all reports mandatory -- the marginal cost of generating an additional report is minimal compared to tracking power states in the first place. - Standardize the interface for Reporters and Reports. - Rename some of the reports to something a bit more meaningful. - The stand-alone command line interface is not ported for now, as it is now possible to run this offline on existing results using "wa process".
2018-05-14utils/trace_cmd: add trace_has_marker()Sergei Trofimov
Add a function to check whether a trace file contains start/stop markers (actually only check for start marker -- stop marker is assumed).
2018-05-14utils/trace_cmd: move params to __init__()Sergei Trofimov
Move the check_for_markers and events parameters from parser() to __init__(). These parameters control the behavior of the parser, and do not relate to a particular trace file, so it makes more sense to have them there.
2018-05-10fw/execution: handle error on run initializeSergei Trofimov
- Use indentcontext inside initialize_run to make sure log level is dedented on error. - Ensure Executor postamble always runs, event if runner errors. - Fix format_duration() to handle sub-second timedeltas.
2018-05-09utils/log: add indentcontextsergei Trofimov
Add indentcontext context manager to save having to add try/finally clauses around indenting code just to ensure dedenting.
2018-05-09utils/log: maintain indent for buffered recordssergei Trofimov
Ensure buffered records are indented properly by saving the indent level at the time the record was generated as part of the record, and preferring that over the current indent level inside LineFormatter.
2018-05-09utils/log: add early record bufferingsergei Trofimov
Buffer early log records until a log file becomes available, flush records to said file afterwards. This ensures that early log output, which, among other things, contains plugin discovery logging, is not lost. Buffer capacity is configurable via an environment variable.
2018-05-08utils/types: toggle_set: add "~~" semanticssergei Trofimov
Add support for "~~" special value that indicates that, when merging into another set, all values from that set should in fact be dropped. Apart from the unique merge semantics, "~~" just like any other "~" value.
2018-05-08utils/types: fix toggle_set merge methodssergei Trofimov
- The merge_with and merge_into implementation was reversed. Fix this, so that it is implemented correctly, i.e. that a.merge_with(b) === merge(a, b) a.merge_into(b) === merge(b, a) - Ensure that in case of merge_into(), a toggle_set is always returned.
2018-04-30utils/doc: Add function to generate a line breakMarc Bonnici
2018-04-24utils/docs: Update format of parameter type rst outputMarc Bonnici
2018-04-24utils/doc: Add support for dicts to format literalMarc Bonnici
Now supports cleaner outputing of python dicts
2018-03-22utils/types: toggle_set: TypeError on stringSergei Trofimov
Strings are iterable, so can be used to instantiate sets (resulting in a set of chars). This is never what we want for toggle_set's though, and may result in difficult-to-interpret errors when parsing configuration, so raise a TypeError if attempting to create a toggle_set with a string.