summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/build.py
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-03-17 15:28:46 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-21 14:47:52 +0000
commitf191ab0198e383cda37b0bfdfb6365d85499e36b (patch)
treeff96d3e1f23f12540e2af1bc5ed85614fd41f30e /bitbake/lib/bb/build.py
parent888683de7a25dc2f058b62bf4cad3c4b8e93d56e (diff)
downloadpoky-f191ab0198e383cda37b0bfdfb6365d85499e36b.tar.gz
bitbake: toaster: measure task duration with server-side timestamps
The buildstats and toaster use separate time markers to measure the duration of task execution. This causes a mismatch in the time measured by buildstats class and the time measured in toaster. The solution implemented here is to timestamp the creation of every TaskBase event on the bitbake server side and calculate the execution duration as the difference between creation time of TaskSucceeded and TaskStarted events. Based on an original patch by Marius Avram. [YOCTO #5485] (Bitbake rev: 7a08282c074c264f414cf7665dc873f51245072c) Signed-off-by: Marius Avram <marius.avram@intel.com> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/build.py')
-rw-r--r--bitbake/lib/bb/build.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
index 52e41493c1..5cb4c06a88 100644
--- a/bitbake/lib/bb/build.py
+++ b/bitbake/lib/bb/build.py
@@ -30,6 +30,7 @@ import sys
30import logging 30import logging
31import shlex 31import shlex
32import glob 32import glob
33import time
33import bb 34import bb
34import bb.msg 35import bb.msg
35import bb.process 36import bb.process
@@ -75,6 +76,7 @@ class TaskBase(event.Event):
75 self.taskfile = d.getVar("FILE", True) 76 self.taskfile = d.getVar("FILE", True)
76 self.taskname = self._task 77 self.taskname = self._task
77 self.logfile = logfile 78 self.logfile = logfile
79 self.time = time.time()
78 event.Event.__init__(self) 80 event.Event.__init__(self)
79 self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName()) 81 self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName())
80 82