From 7bf0e3c3443702791833444ccf10ab0e8a618391 Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Mon, 31 Oct 2016 13:58:03 +0000 Subject: [PATCH 1/2] energy_model: only set "ui" parameter for ChomeOS Fixed a bug, where "ui" runtime parameter was being set regardless of the underlying platforms for "freq" iterations, causing the to fail on non-ChomeOS devices. --- wlauto/instrumentation/energy_model/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wlauto/instrumentation/energy_model/__init__.py b/wlauto/instrumentation/energy_model/__init__.py index 904140cf..95056ece 100644 --- a/wlauto/instrumentation/energy_model/__init__.py +++ b/wlauto/instrumentation/energy_model/__init__.py @@ -745,7 +745,8 @@ class EnergyModelInstrument(Instrument): spec.runtime_parameters['{}_frequency'.format(core)] = freq if not self.no_hotplug: spec.runtime_parameters['{}_cores'.format(core)] = num_cpus - spec.runtime_parameters['ui'] = 'off' + if self.device.platform == 'chromeos': + spec.runtime_parameters['ui'] = 'off' spec.id = '{}_{}_{}'.format(cluster, num_cpus, freq) spec.label = 'freq_{}_{}'.format(cluster, spec.label) spec.workload_parameters['taskset_mask'] = list_to_mask(self.get_cpus(cluster)) From 5db11462be21413294fa17d3a7c743517d5433dc Mon Sep 17 00:00:00 2001 From: Sergei Trofimov Date: Tue, 29 Nov 2016 10:15:40 +0000 Subject: [PATCH 2/2] utils/power: handle devlib frequency reporting When collecting ftrace events, the instrument will insert frequencies into the trace to make it possible reconstruct power states when there were no frequency transitions during the measured period. The format in which frequencies are inserted is different in devlib. Since post-processing scripts may be run on traces collected by devlib as well as WA, it needs to support both formats. --- wlauto/utils/power.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/wlauto/utils/power.py b/wlauto/utils/power.py index 070714cf..6feaa87d 100755 --- a/wlauto/utils/power.py +++ b/wlauto/utils/power.py @@ -32,6 +32,7 @@ logger = logging.getLogger('power') UNKNOWN_FREQUENCY = -1 INIT_CPU_FREQ_REGEX = re.compile(r'CPU (?P\d+) FREQUENCY: (?P\d+) kHZ') +DEVLIB_CPU_FREQ_REGEX = re.compile(r'cpu_frequency(?:_devlib):\s+state=(?P\d+)\s+cpu_id=(?P\d+)') class CorePowerTransitionEvent(object): @@ -311,7 +312,10 @@ def stream_cpu_power_transitions(events): elif TRACE_MARKER_STOP in event.text: yield TraceMarkerEvent('STOP') else: - match = INIT_CPU_FREQ_REGEX.search(event.text) + if 'cpu_frequency' in event.text: + match = DEVLIB_CPU_FREQ_REGEX.search(event.text) + else: + match = INIT_CPU_FREQ_REGEX.search(event.text) if match: yield CorePowerTransitionEvent(event.timestamp, int(match.group('cpu')),