diff options
author | Elliot Smith <elliot.smith@intel.com> | 2016-03-08 11:32:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-09 22:45:16 +0000 |
commit | 0dcab0258e6e638db8b78fa3c7c7e485280712d4 (patch) | |
tree | 1d5fe7bafd6c45b8f935f0f516cc4d0309469eac /bitbake/lib/toaster/toastergui | |
parent | cc74a8ae26a7728828a3442ba441b1676bc2c8a1 (diff) | |
download | poky-0dcab0258e6e638db8b78fa3c7c7e485280712d4.tar.gz |
bitbake: toaster: rework task buildstats storage and display
The data available from buildstats is now more fine grained than
previously, so take advantage of that to enrich the data we save
against tasks:
* Store the CPU usage for user and system separately, and display
them separately.
* Disk IO is now measured in bytes, not ms. Also store the
read/write bytes separately.
* Store started and ended times, as well as elapsed_time. This
will enable future features such as showing which tasks were
running at a particular point in the build.
There was also a problem with how we were looking up the Task
object, which meant that the buildstats were being added to
new tasks which weren't correctly associated with the build. Fix
how we look up the Task (only looking for tasks which match the
build, and the task and recipe names in the build stats data) so
the build stats are associated with the correct task.
[YOCTO #8842]
(Bitbake rev: efa6f915566b979bdbad233ae195b413cef1b8da)
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui')
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/basebuildpage.html | 4 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/task.html | 23 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/templates/tasks.html | 20 | ||||
-rw-r--r-- | bitbake/lib/toaster/toastergui/urls.py | 2 | ||||
-rwxr-xr-x | bitbake/lib/toaster/toastergui/views.py | 55 |
5 files changed, 66 insertions, 38 deletions
diff --git a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html index 0dc71f5e5e..ff9433eee7 100644 --- a/bitbake/lib/toaster/toastergui/templates/basebuildpage.html +++ b/bitbake/lib/toaster/toastergui/templates/basebuildpage.html | |||
@@ -67,8 +67,8 @@ | |||
67 | {% block nav-buildtime %} | 67 | {% block nav-buildtime %} |
68 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> | 68 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> |
69 | {% endblock %} | 69 | {% endblock %} |
70 | {% block nav-cpuusage %} | 70 | {% block nav-cputime %} |
71 | <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li> | 71 | <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li> |
72 | {% endblock %} | 72 | {% endblock %} |
73 | {% block nav-diskio %} | 73 | {% block nav-diskio %} |
74 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> | 74 | <li><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> |
diff --git a/bitbake/lib/toaster/toastergui/templates/task.html b/bitbake/lib/toaster/toastergui/templates/task.html index ef628d9f9b..5768262432 100644 --- a/bitbake/lib/toaster/toastergui/templates/task.html +++ b/bitbake/lib/toaster/toastergui/templates/task.html | |||
@@ -238,7 +238,7 @@ | |||
238 | </dl> | 238 | </dl> |
239 | 239 | ||
240 | {# Performance section - shown only for executed tasks #} | 240 | {# Performance section - shown only for executed tasks #} |
241 | {%if task.elapsed_time or task.cpu_usage or task.disk_io %} | 241 | {%if task.elapsed_time or task.cpu_time_user or task.cpu_time_system or task.disk_io %} |
242 | <h2 class="details">Performance</h2> | 242 | <h2 class="details">Performance</h2> |
243 | {% endif %} | 243 | {% endif %} |
244 | <dl class="dl-horizontal"> | 244 | <dl class="dl-horizontal"> |
@@ -249,19 +249,26 @@ | |||
249 | </dt> | 249 | </dt> |
250 | <dd>{{task.elapsed_time|format_none_and_zero|floatformat:2}}</dd> | 250 | <dd>{{task.elapsed_time|format_none_and_zero|floatformat:2}}</dd> |
251 | {% endif %} | 251 | {% endif %} |
252 | {% if task.cpu_usage > 0 %} | 252 | {% if task.cpu_time_user > 0 %} |
253 | <dt> | 253 | <dt> |
254 | <i class="icon-question-sign get-help" title="The percentage of task CPU utilization"></i> | 254 | <i class="icon-question-sign get-help" title="Total amount of time spent executing in user mode, in seconds. Note that this time can be greater than the task time due to parallel execution."></i> |
255 | CPU usage | 255 | User CPU time (secs) |
256 | </dt> | 256 | </dt> |
257 | <dd>{{task.cpu_usage|format_none_and_zero|floatformat:2}}%</dd> | 257 | <dd>{{task.cpu_time_user|format_none_and_zero|floatformat:2}}</dd> |
258 | {% endif %} | ||
259 | {% if task.cpu_time_system > 0 %} | ||
260 | <dt> | ||
261 | <i class="icon-question-sign get-help" title="Total amount of time spent executing in kernel mode, in seconds. Note that this time can be greater than the task time due to parallel execution."></i> | ||
262 | System CPU time (secs) | ||
263 | </dt> | ||
264 | <dd>{{task.cpu_time_system|format_none_and_zero|floatformat:2}}</dd> | ||
258 | {% endif %} | 265 | {% endif %} |
259 | {% if task.disk_io > 0 %} | 266 | {% if task.disk_io > 0 %} |
260 | <dt> | 267 | <dt> |
261 | <i class="icon-question-sign get-help" title="Number of miliseconds the task spent doing disk input and output"></i> | 268 | <i class="icon-question-sign get-help" title="Number of bytes written to and read from the disk during the task"></i> |
262 | Disk I/O (ms) | 269 | Disk I/O (bytes) |
263 | </dt> | 270 | </dt> |
264 | <dd>{{task.disk_io|format_none_and_zero}}</dd> | 271 | <dd>{{task.disk_io|format_none_and_zero|intcomma}}</dd> |
265 | {% endif %} | 272 | {% endif %} |
266 | </dl> | 273 | </dl> |
267 | 274 | ||
diff --git a/bitbake/lib/toaster/toastergui/templates/tasks.html b/bitbake/lib/toaster/toastergui/templates/tasks.html index 353410f92a..23eb957567 100644 --- a/bitbake/lib/toaster/toastergui/templates/tasks.html +++ b/bitbake/lib/toaster/toastergui/templates/tasks.html | |||
@@ -1,4 +1,5 @@ | |||
1 | {% extends "basebuildpage.html" %} | 1 | {% extends "basebuildpage.html" %} |
2 | {% load humanize %} | ||
2 | {% load projecttags %} | 3 | {% load projecttags %} |
3 | 4 | ||
4 | {% block title %} {{mainheading}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster{% endblock %} | 5 | {% block title %} {{mainheading}} - {{build.target_set.all|dictsort:"target"|join:", "}} {{build.machine}} - {{build.project.name}} - Toaster{% endblock %} |
@@ -20,13 +21,15 @@ | |||
20 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> | 21 | <li><a href="{% url 'buildtime' build.pk %}">Time</a></li> |
21 | {% endif %} | 22 | {% endif %} |
22 | {% endblock %} | 23 | {% endblock %} |
23 | {% block nav-cpuusage %} | 24 | |
24 | {% if 'CPU usage' == mainheading %} | 25 | {% block nav-cputime %} |
25 | <li class="active"><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li> | 26 | {% if 'CPU time' == mainheading %} |
27 | <li class="active"><a href="{% url 'cputime' build.pk %}">CPU time</a></li> | ||
26 | {% else %} | 28 | {% else %} |
27 | <li><a href="{% url 'cpuusage' build.pk %}">CPU usage</a></li> | 29 | <li><a href="{% url 'cputime' build.pk %}">CPU time</a></li> |
28 | {% endif %} | 30 | {% endif %} |
29 | {% endblock %} | 31 | {% endblock %} |
32 | |||
30 | {% block nav-diskio %} | 33 | {% block nav-diskio %} |
31 | {% if 'Disk I/O' == mainheading %} | 34 | {% if 'Disk I/O' == mainheading %} |
32 | <li class="active"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> | 35 | <li class="active"><a href="{% url 'diskio' build.pk %}">Disk I/O</a></li> |
@@ -107,11 +110,14 @@ | |||
107 | <td class="time_taken"> | 110 | <td class="time_taken"> |
108 | {{task.elapsed_time|format_none_and_zero|floatformat:2}} | 111 | {{task.elapsed_time|format_none_and_zero|floatformat:2}} |
109 | </td> | 112 | </td> |
110 | <td class="cpu_used"> | 113 | <td class="cpu_time_system"> |
111 | {{task.cpu_usage|format_none_and_zero|floatformat:2}}{% if task.cpu_usage %}%{% endif %} | 114 | {{task.cpu_time_system|format_none_and_zero|floatformat:2}} |
115 | </td> | ||
116 | <td class="cpu_time_user"> | ||
117 | {{task.cpu_time_user|format_none_and_zero|floatformat:2}} | ||
112 | </td> | 118 | </td> |
113 | <td class="disk_io"> | 119 | <td class="disk_io"> |
114 | {{task.disk_io|format_none_and_zero}} | 120 | {{task.disk_io|format_none_and_zero|intcomma}} |
115 | </td> | 121 | </td> |
116 | 122 | ||
117 | </tr> | 123 | </tr> |
diff --git a/bitbake/lib/toaster/toastergui/urls.py b/bitbake/lib/toaster/toastergui/urls.py index 4aa64887b7..400580a235 100644 --- a/bitbake/lib/toaster/toastergui/urls.py +++ b/bitbake/lib/toaster/toastergui/urls.py | |||
@@ -64,7 +64,7 @@ urlpatterns = patterns('toastergui.views', | |||
64 | url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'), | 64 | url(r'^build/(?P<build_id>\d+)/configuration$', 'configuration', name='configuration'), |
65 | url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'), | 65 | url(r'^build/(?P<build_id>\d+)/configvars$', 'configvars', name='configvars'), |
66 | url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'), | 66 | url(r'^build/(?P<build_id>\d+)/buildtime$', 'buildtime', name='buildtime'), |
67 | url(r'^build/(?P<build_id>\d+)/cpuusage$', 'cpuusage', name='cpuusage'), | 67 | url(r'^build/(?P<build_id>\d+)/cputime$', 'cputime', name='cputime'), |
68 | url(r'^build/(?P<build_id>\d+)/diskio$', 'diskio', name='diskio'), | 68 | url(r'^build/(?P<build_id>\d+)/diskio$', 'diskio', name='diskio'), |
69 | 69 | ||
70 | # image information dir | 70 | # image information dir |
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py index bd118920ab..85ca9be716 100755 --- a/bitbake/lib/toaster/toastergui/views.py +++ b/bitbake/lib/toaster/toastergui/views.py | |||
@@ -1005,11 +1005,11 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
1005 | object_search_display="disk I/O data" | 1005 | object_search_display="disk I/O data" |
1006 | filter_search_display="tasks" | 1006 | filter_search_display="tasks" |
1007 | (pagesize, orderby) = _get_parameters_values(request, 25, 'disk_io:-') | 1007 | (pagesize, orderby) = _get_parameters_values(request, 25, 'disk_io:-') |
1008 | elif 'cpuusage' == variant: | 1008 | elif 'cputime' == variant: |
1009 | title_variant='CPU usage' | 1009 | title_variant='CPU time' |
1010 | object_search_display="CPU usage data" | 1010 | object_search_display="CPU time data" |
1011 | filter_search_display="tasks" | 1011 | filter_search_display="tasks" |
1012 | (pagesize, orderby) = _get_parameters_values(request, 25, 'cpu_usage:-') | 1012 | (pagesize, orderby) = _get_parameters_values(request, 25, 'cpu_time_system:-') |
1013 | else : | 1013 | else : |
1014 | title_variant='Tasks' | 1014 | title_variant='Tasks' |
1015 | object_search_display="tasks" | 1015 | object_search_display="tasks" |
@@ -1161,23 +1161,38 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
1161 | del tc_time['clclass'] | 1161 | del tc_time['clclass'] |
1162 | tc_cache['hidden']='1' | 1162 | tc_cache['hidden']='1' |
1163 | 1163 | ||
1164 | tc_cpu={ | 1164 | tc_cpu_time_system={ |
1165 | 'name':'CPU usage', | 1165 | 'name':'System CPU time (secs)', |
1166 | 'qhelp':'The percentage of task CPU utilization', | 1166 | 'qhelp':'Total amount of time spent executing in kernel mode, in ' + |
1167 | 'orderfield': _get_toggle_order(request, "cpu_usage", True), | 1167 | 'seconds. Note that this time can be greater than the task ' + |
1168 | 'ordericon':_get_toggle_order_icon(request, "cpu_usage"), | 1168 | 'time due to parallel execution.', |
1169 | 'orderkey' : 'cpu_usage', | 1169 | 'orderfield': _get_toggle_order(request, "cpu_time_system", True), |
1170 | 'clclass': 'cpu_used', 'hidden' : 1, | 1170 | 'ordericon':_get_toggle_order_icon(request, "cpu_time_system"), |
1171 | 'orderkey' : 'cpu_time_system', | ||
1172 | 'clclass': 'cpu_time_system', 'hidden' : 1, | ||
1171 | } | 1173 | } |
1172 | 1174 | ||
1173 | if 'cpuusage' == variant: | 1175 | tc_cpu_time_user={ |
1174 | tc_cpu['hidden']='0' | 1176 | 'name':'User CPU time (secs)', |
1175 | del tc_cpu['clclass'] | 1177 | 'qhelp':'Total amount of time spent executing in user mode, in seconds. ' + |
1178 | 'Note that this time can be greater than the task time due to ' + | ||
1179 | 'parallel execution.', | ||
1180 | 'orderfield': _get_toggle_order(request, "cpu_time_user", True), | ||
1181 | 'ordericon':_get_toggle_order_icon(request, "cpu_time_user"), | ||
1182 | 'orderkey' : 'cpu_time_user', | ||
1183 | 'clclass': 'cpu_time_user', 'hidden' : 1, | ||
1184 | } | ||
1185 | |||
1186 | if 'cputime' == variant: | ||
1187 | tc_cpu_time_system['hidden']='0' | ||
1188 | tc_cpu_time_user['hidden']='0' | ||
1189 | del tc_cpu_time_system['clclass'] | ||
1190 | del tc_cpu_time_user['clclass'] | ||
1176 | tc_cache['hidden']='1' | 1191 | tc_cache['hidden']='1' |
1177 | 1192 | ||
1178 | tc_diskio={ | 1193 | tc_diskio={ |
1179 | 'name':'Disk I/O (ms)', | 1194 | 'name':'Disk I/O (bytes)', |
1180 | 'qhelp':'Number of miliseconds the task spent doing disk input and output', | 1195 | 'qhelp':'Number of bytes written to and read from the disk during the task', |
1181 | 'orderfield': _get_toggle_order(request, "disk_io", True), | 1196 | 'orderfield': _get_toggle_order(request, "disk_io", True), |
1182 | 'ordericon':_get_toggle_order_icon(request, "disk_io"), | 1197 | 'ordericon':_get_toggle_order_icon(request, "disk_io"), |
1183 | 'orderkey' : 'disk_io', | 1198 | 'orderkey' : 'disk_io', |
@@ -1208,7 +1223,8 @@ def tasks_common(request, build_id, variant, task_anchor): | |||
1208 | tc_outcome, | 1223 | tc_outcome, |
1209 | tc_cache, | 1224 | tc_cache, |
1210 | tc_time, | 1225 | tc_time, |
1211 | tc_cpu, | 1226 | tc_cpu_time_system, |
1227 | tc_cpu_time_user, | ||
1212 | tc_diskio, | 1228 | tc_diskio, |
1213 | ]} | 1229 | ]} |
1214 | 1230 | ||
@@ -1229,9 +1245,8 @@ def buildtime(request, build_id): | |||
1229 | def diskio(request, build_id): | 1245 | def diskio(request, build_id): |
1230 | return tasks_common(request, build_id, 'diskio', '') | 1246 | return tasks_common(request, build_id, 'diskio', '') |
1231 | 1247 | ||
1232 | def cpuusage(request, build_id): | 1248 | def cputime(request, build_id): |
1233 | return tasks_common(request, build_id, 'cpuusage', '') | 1249 | return tasks_common(request, build_id, 'cputime', '') |
1234 | |||
1235 | 1250 | ||
1236 | def recipes(request, build_id): | 1251 | def recipes(request, build_id): |
1237 | template = 'recipes.html' | 1252 | template = 'recipes.html' |