summaryrefslogtreecommitdiffstats
path: root/scripts/lib
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2017-09-15 16:04:38 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-18 11:07:30 +0100
commit81aef784fdbd2e8a543475b1892c3d6a1fe97872 (patch)
treed787e9402d3fa667eee19a4447f46b440e7eda5c /scripts/lib
parentb5fb3dd904cd22212c720f3c79d71952ecbaa9c2 (diff)
downloadpoky-81aef784fdbd2e8a543475b1892c3d6a1fe97872.tar.gz
scripts/oe-build-perf-report: summary of task resource usage
Utilize buildstats, if available, and show a summary of the resource usage of bitbake tasks in the html report. The details provided are: - total number of tasks - top 5 resource-hungry tasks (cputime) - top 5 increase in resource usage (cputime) - top 5 decrease in resource usage (cputime) [YOCTO #11381] (From OE-Core rev: ddd9443cb2432af2c15b358bfda708393fa3c417) 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/lib')
-rw-r--r--scripts/lib/build_perf/html/report.html60
-rw-r--r--scripts/lib/buildstats.py8
2 files changed, 66 insertions, 2 deletions
diff --git a/scripts/lib/build_perf/html/report.html b/scripts/lib/build_perf/html/report.html
index f983a4a09c..e56186c958 100644
--- a/scripts/lib/build_perf/html/report.html
+++ b/scripts/lib/build_perf/html/report.html
@@ -53,9 +53,11 @@ summary th, .meta-table td {
53 border-collapse: collapse; 53 border-collapse: collapse;
54} 54}
55.details th { 55.details th {
56 font-weight: normal;
57 padding-right: 8px; 56 padding-right: 8px;
58} 57}
58.details.plain th {
59 font-weight: normal;
60}
59.preformatted { 61.preformatted {
60 font-family: monospace; 62 font-family: monospace;
61 white-space: pre-wrap; 63 white-space: pre-wrap;
@@ -168,6 +170,7 @@ h3 {
168 {{ measurement.absdiff_str }} ({{measurement.reldiff}}) 170 {{ measurement.absdiff_str }} ({{measurement.reldiff}})
169 </span></span> 171 </span></span>
170 </div> 172 </div>
173 {# Table for trendchart and the statistics #}
171 <table style="width: 100%"> 174 <table style="width: 100%">
172 <tr> 175 <tr>
173 <td style="width: 75%"> 176 <td style="width: 75%">
@@ -176,7 +179,7 @@ h3 {
176 </td> 179 </td>
177 <td> 180 <td>
178 {# Measurement statistics #} 181 {# Measurement statistics #}
179 <table class="details"> 182 <table class="details plain">
180 <tr> 183 <tr>
181 <th>Test runs</th><td>{{ measurement.value.sample_cnt }}</td> 184 <th>Test runs</th><td>{{ measurement.value.sample_cnt }}</td>
182 </tr><tr> 185 </tr><tr>
@@ -195,6 +198,59 @@ h3 {
195 </td> 198 </td>
196 </tr> 199 </tr>
197 </table> 200 </table>
201
202 {# Task and recipe summary from buildstats #}
203 {% if 'buildstats' in measurement %}
204 Task resource usage
205 <table class="details" style="width:100%">
206 <tr>
207 <th>Number of tasks</th>
208 <th>Top consumers of cputime</th>
209 </tr>
210 <tr>
211 <td style="vertical-align: top">{{ measurement.buildstats.tasks.count }} ({{ measurement.buildstats.tasks.change }})</td>
212 {# Table of most resource-hungry tasks #}
213 <td>
214 <table class="details plain">
215 {% for diff in measurement.buildstats.top_consumer|reverse %}
216 <tr>
217 <th>{{ diff.pkg }}.{{ diff.task }}</th>
218 <td>{{ '%0.0f' % diff.value2 }} s</td>
219 </tr>
220 {% endfor %}
221 </table>
222 </td>
223 </tr>
224 <tr>
225 <th>Biggest increase in cputime</th>
226 <th>Biggest decrease in cputime</th>
227 </tr>
228 <tr>
229 {# Table biggest increase in resource usage #}
230 <td>
231 <table class="details plain">
232 {% for diff in measurement.buildstats.top_increase|reverse %}
233 <tr>
234 <th>{{ diff.pkg }}.{{ diff.task }}</th>
235 <td>{{ '%+0.0f' % diff.absdiff }} s</td>
236 </tr>
237 {% endfor %}
238 </table>
239 </td>
240 {# Table biggest decrease in resource usage #}
241 <td>
242 <table class="details plain">
243 {% for diff in measurement.buildstats.top_decrease %}
244 <tr>
245 <th>{{ diff.pkg }}.{{ diff.task }}</th>
246 <td>{{ '%+0.0f' % diff.absdiff }} s</td>
247 </tr>
248 {% endfor %}
249 </table>
250 </td>
251 </tr>
252 </table>
253 {% endif %}
198 </div> 254 </div>
199 {% endfor %} 255 {% endfor %}
200 {# Unsuccessful test #} 256 {# Unsuccessful test #}
diff --git a/scripts/lib/buildstats.py b/scripts/lib/buildstats.py
index 9eb60b1c69..bd6332176a 100644
--- a/scripts/lib/buildstats.py
+++ b/scripts/lib/buildstats.py
@@ -180,6 +180,14 @@ class BSRecipe(object):
180class BuildStats(dict): 180class BuildStats(dict):
181 """Class representing buildstats of one build""" 181 """Class representing buildstats of one build"""
182 182
183 @property
184 def num_tasks(self):
185 """Get number of tasks"""
186 num = 0
187 for recipe in self.values():
188 num += len(recipe.tasks)
189 return num
190
183 @classmethod 191 @classmethod
184 def from_json(cls, bs_json): 192 def from_json(cls, bs_json):
185 """Create new BuildStats object from JSON object""" 193 """Create new BuildStats object from JSON object"""