From 3711f7316dacb22fcb390f8362435483bdbedbcd Mon Sep 17 00:00:00 2001
From: Sergei Trofimov <sergei.trofimov@arm.com>
Date: Tue, 30 Aug 2016 17:48:40 +0100
Subject: [PATCH] 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'))