From 3711f7316dacb22fcb390f8362435483bdbedbcd Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 30 Aug 2016 17:48:40 +0100 Subject: [PATCH 1/3] cpustates: fixing stand-alone script with timeline option When running the stand-alone cpustates script and specifying a timeline file (which causes the corresponding reporter to be enabled), a timeline report is generated in addition to the usual cpustates and parallelism reports. Up to this point, the main() of the stand-alone script was expecting exactly two reports and so it crashing when running with the timeline option. This commit fixes this case. --- wlauto/utils/power.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wlauto/utils/power.py b/wlauto/utils/power.py index f50a6362..070714cf 100755 --- a/wlauto/utils/power.py +++ b/wlauto/utils/power.py @@ -682,7 +682,8 @@ def main(): # pylint: disable=unbalanced-tuple-unpacking logging.basicConfig(level=logging.INFO) args = parse_arguments() - parallel_report, powerstate_report = report_power_stats( + + reports = report_power_stats( trace_file=args.infile, idle_state_names=args.idle_state_names, core_names=args.core_names, @@ -696,6 +697,10 @@ def main(): max_freq_list=args.max_freq_list, start_marker_handling=args.start_marker_handling, ) + + parallel_report = reports.pop(0) + powerstate_report = reports.pop(0) + parallel_report.write(os.path.join(args.output_directory, 'parallel.csv')) powerstate_report.write(os.path.join(args.output_directory, 'cpustate.csv')) From 20996e9a580c26a9712c8834710fe27d087022b4 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 13 Sep 2016 10:20:52 +0100 Subject: [PATCH 2/3] core: changing the time of constraint validation for params Constraints and allowed values of Extension Parameters will now be check when the Parameter value is set, rather than when validating the extension. Mandatory status of a Parameter is still checked during valudation. --- wlauto/core/extension.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/wlauto/core/extension.py b/wlauto/core/extension.py index 6611aa46..3340ff37 100644 --- a/wlauto/core/extension.py +++ b/wlauto/core/extension.py @@ -224,18 +224,11 @@ class Param(object): else: new_value = current_value + [value] setattr(obj, self.name, new_value) - - def validate(self, obj): - value = getattr(obj, self.name, None) if value is not None: if self.allowed_values: self._validate_allowed_values(obj, value) if self.constraint: self._validate_constraint(obj, value) - else: - if self.mandatory: - msg = 'No value specified for mandatory parameter {} in {}.' - raise ConfigError(msg.format(self.name, obj.name)) def get_type_name(self): typename = str(self.kind) @@ -567,7 +560,9 @@ class Extension(object): if self.name is None: raise ValidationError('Name not set for {}'.format(self._classname)) for param in self.parameters: - param.validate(self) + if param.mandatory and getattr(self, param.name, None) is None: + msg = 'No value specified for mandatory parameter {} in {}.' + raise ConfigError(msg.format(param.name, self.name)) def initialize(self, context): pass From ea1d13c37fb94bdbee1dd87b3465faf2d4ce50f6 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 13 Sep 2016 10:22:47 +0100 Subject: [PATCH 3/3] common/android: pep8 fixes - added missing space between global definitions and a class - added missing space for inline comment --- wlauto/common/android/workload.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wlauto/common/android/workload.py b/wlauto/common/android/workload.py index 34bb8059..4e56a811 100644 --- a/wlauto/common/android/workload.py +++ b/wlauto/common/android/workload.py @@ -35,6 +35,7 @@ import wlauto.common.android.resources DELAY = 5 + # Due to the way `super` works you have to call it at every level but WA executes some # methods conditionally and so has to do them directly via the class, this breaks super # and causes it to run things mutiple times ect. As a work around for this untill workloads @@ -221,7 +222,7 @@ class ApkWorkload(Workload): self.check_apk_version() if self.launch_main: - self.launch_package() # launch default activity without intent data + self.launch_package() # launch default activity without intent data self.device.execute('am kill-all') # kill all *background* activities self.device.clear_logcat()