diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2017-09-15 16:04:40 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-18 11:07:30 +0100 |
commit | 6c222a5c11ee1abe2b5b81e97d4dc6ac7346410b (patch) | |
tree | 7ae89867ed8fdc3e7c9016e4ac97a74842825d6a /scripts | |
parent | a80f5e761cf1c0ac1b5d457ec5284f601c60f459 (diff) | |
download | poky-6c222a5c11ee1abe2b5b81e97d4dc6ac7346410b.tar.gz |
scripts/oe-build-perf-report: show recipe version changes in html report
If buildstats are available (for a certain measurement), show recipe
version changes between the two builds that are being compared. The
information shown includes new and dropped recipes as well as changes in
recipe version, revision or epoch.
[YOCTO #11382]
(From OE-Core rev: 46eb839b51bb1466a9feeb09c9c437d6d45576cc)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/build_perf/html/report.html | 20 | ||||
-rw-r--r-- | scripts/lib/buildstats.py | 15 | ||||
-rwxr-xr-x | scripts/oe-build-perf-report | 17 |
3 files changed, 49 insertions, 3 deletions
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html index e56186c958..291ad9d721 100644 --- a/scripts/lib/build_perf/html/report.html +++ b/scripts/lib/build_perf/html/report.html | |||
@@ -250,6 +250,26 @@ h3 { | |||
250 | </td> | 250 | </td> |
251 | </tr> | 251 | </tr> |
252 | </table> | 252 | </table> |
253 | |||
254 | {# Recipe version differences #} | ||
255 | {% if measurement.buildstats.ver_diff %} | ||
256 | <div style="margin-top: 16px">Recipe version changes</div> | ||
257 | <table class="details"> | ||
258 | {% for head, recipes in measurement.buildstats.ver_diff.items() %} | ||
259 | <tr> | ||
260 | <th colspan="2">{{ head }}</th> | ||
261 | </tr> | ||
262 | {% for name, info in recipes|sort %} | ||
263 | <tr> | ||
264 | <td>{{ name }}</td> | ||
265 | <td>{{ info }}</td> | ||
266 | </tr> | ||
267 | {% endfor %} | ||
268 | {% endfor %} | ||
269 | </table> | ||
270 | {% else %} | ||
271 | <div style="margin-top: 16px">No recipe version changes detected</div> | ||
272 | {% endif %} | ||
253 | {% endif %} | 273 | {% endif %} |
254 | </div> | 274 | </div> |
255 | {% endfor %} | 275 | {% endfor %} |
diff --git a/scripts/lib/buildstats.py b/scripts/lib/buildstats.py index b1c9e617c6..d9aadf3cb8 100644 --- a/scripts/lib/buildstats.py +++ b/scripts/lib/buildstats.py | |||
@@ -157,9 +157,9 @@ class BSRecipe(object): | |||
157 | self.version = version | 157 | self.version = version |
158 | self.revision = revision | 158 | self.revision = revision |
159 | if epoch is None: | 159 | if epoch is None: |
160 | self.nevr = "{}-{}-{}".format(name, version, revision) | 160 | self.evr = "{}-{}".format(version, revision) |
161 | else: | 161 | else: |
162 | self.nevr = "{}-{}_{}-{}".format(name, epoch, version, revision) | 162 | self.evr = "{}_{}-{}".format(epoch, version, revision) |
163 | self.tasks = {} | 163 | self.tasks = {} |
164 | 164 | ||
165 | def aggregate(self, bsrecipe): | 165 | def aggregate(self, bsrecipe): |
@@ -176,6 +176,10 @@ class BSRecipe(object): | |||
176 | self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]]) | 176 | self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]]) |
177 | self.tasks[taskname].append(taskdata) | 177 | self.tasks[taskname].append(taskdata) |
178 | 178 | ||
179 | @property | ||
180 | def nevr(self): | ||
181 | return self.name + '-' + self.evr | ||
182 | |||
179 | 183 | ||
180 | class BuildStats(dict): | 184 | class BuildStats(dict): |
181 | """Class representing buildstats of one build""" | 185 | """Class representing buildstats of one build""" |
@@ -323,6 +327,7 @@ class BSVerDiff(object): | |||
323 | self.vchanged = {} | 327 | self.vchanged = {} |
324 | self.rchanged = {} | 328 | self.rchanged = {} |
325 | self.unchanged = {} | 329 | self.unchanged = {} |
330 | self.empty_diff = False | ||
326 | 331 | ||
327 | common = recipes2.intersection(recipes1) | 332 | common = recipes2.intersection(recipes1) |
328 | if common: | 333 | if common: |
@@ -336,3 +341,9 @@ class BSVerDiff(object): | |||
336 | self.rchanged[recipe] = rdiff | 341 | self.rchanged[recipe] = rdiff |
337 | else: | 342 | else: |
338 | self.unchanged[recipe] = rdiff | 343 | self.unchanged[recipe] = rdiff |
344 | |||
345 | if len(recipes1) == len(recipes2) == len(self.unchanged): | ||
346 | self.empty_diff = True | ||
347 | |||
348 | def __bool__(self): | ||
349 | return not self.empty_diff | ||
diff --git a/scripts/oe-build-perf-report b/scripts/oe-build-perf-report index 0b2f730e57..ac88f0fce5 100755 --- a/scripts/oe-build-perf-report +++ b/scripts/oe-build-perf-report | |||
@@ -32,7 +32,7 @@ from build_perf.report import (metadata_xml_to_json, results_xml_to_json, | |||
32 | aggregate_data, aggregate_metadata, measurement_stats, | 32 | aggregate_data, aggregate_metadata, measurement_stats, |
33 | AggregateTestData) | 33 | AggregateTestData) |
34 | from build_perf import html | 34 | from build_perf import html |
35 | from buildstats import BuildStats, diff_buildstats | 35 | from buildstats import BuildStats, diff_buildstats, BSVerDiff |
36 | 36 | ||
37 | scriptpath.add_oe_lib_path() | 37 | scriptpath.add_oe_lib_path() |
38 | 38 | ||
@@ -341,6 +341,7 @@ class BSSummary(object): | |||
341 | self.top_consumer = None | 341 | self.top_consumer = None |
342 | self.top_decrease = None | 342 | self.top_decrease = None |
343 | self.top_increase = None | 343 | self.top_increase = None |
344 | self.ver_diff = OrderedDict() | ||
344 | 345 | ||
345 | tasks_diff = diff_buildstats(bs1, bs2, 'cputime') | 346 | tasks_diff = diff_buildstats(bs1, bs2, 'cputime') |
346 | 347 | ||
@@ -353,6 +354,20 @@ class BSSummary(object): | |||
353 | self.top_decrease = tasks_diff[0:5] | 354 | self.top_decrease = tasks_diff[0:5] |
354 | self.top_increase = tasks_diff[-5:] | 355 | self.top_increase = tasks_diff[-5:] |
355 | 356 | ||
357 | # Compare recipe versions and prepare data for display | ||
358 | ver_diff = BSVerDiff(bs1, bs2) | ||
359 | if ver_diff: | ||
360 | if ver_diff.new: | ||
361 | self.ver_diff['New recipes'] = [(n, r.evr) for n, r in ver_diff.new.items()] | ||
362 | if ver_diff.dropped: | ||
363 | self.ver_diff['Dropped recipes'] = [(n, r.evr) for n, r in ver_diff.dropped.items()] | ||
364 | if ver_diff.echanged: | ||
365 | self.ver_diff['Epoch changed'] = [(n, "{} → {}".format(r.left.evr, r.right.evr)) for n, r in ver_diff.echanged.items()] | ||
366 | if ver_diff.vchanged: | ||
367 | self.ver_diff['Version changed'] = [(n, "{} → {}".format(r.left.version, r.right.version)) for n, r in ver_diff.vchanged.items()] | ||
368 | if ver_diff.rchanged: | ||
369 | self.ver_diff['Revision changed'] = [(n, "{} → {}".format(r.left.evr, r.right.evr)) for n, r in ver_diff.rchanged.items()] | ||
370 | |||
356 | 371 | ||
357 | def print_html_report(data, id_comp, buildstats): | 372 | def print_html_report(data, id_comp, buildstats): |
358 | """Print report in html format""" | 373 | """Print report in html format""" |