]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/oe-build-perf-report: fix comparing arbitrary commits
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 15 Mar 2018 12:40:45 +0000 (14:40 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 16 Mar 2018 10:42:03 +0000 (03:42 -0700)
Fix a crash when generating a txt report and the two commits to be
compared were not consecutive (but there were some tested commits
between them).

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/oe-build-perf-report

index ac88f0fce58b8dafe2e443303615b377dd8280ef..dc999c45c150cdebbcafed6ccd691552205bd203 100755 (executable)
@@ -639,10 +639,6 @@ def main(argv=None):
         data.append(AggregateTestData(aggregate_metadata(raw_m),
                                       aggregate_data(raw_d)))
 
-    # Re-map list indexes to the new table starting from index 0
-    index_r = index_r - index_0
-    index_l = index_l - index_0
-
     # Read buildstats only when needed
     buildstats = None
     if args.dump_buildstats or args.html:
@@ -653,10 +649,11 @@ def main(argv=None):
 
     # Print report
     if not args.html:
-        print_diff_report(data[index_l].metadata, data[index_l].results,
-                          data[index_r].metadata, data[index_r].results)
+        print_diff_report(data[0].metadata, data[0].results,
+                          data[1].metadata, data[1].results)
     else:
-        print_html_report(data, index_l, buildstats)
+        # Re-map 'left' list index to the data table where index_0 maps to 0
+        print_html_report(data, index_l - index_0, buildstats)
 
     return 0