[bitbake-devel] [PATCH] ui/knotty: give out start time of task

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Wed Aug 22 17:09:13 UTC 2012


For long running tasks like compiling qt it might be interesting to know
when the task has been started.  Patch prints this information by using
the %X modifier (locale dependent presentation of time without date).

Signed-off-by: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>
---
 lib/bb/ui/knotty.py   | 3 ++-
 lib/bb/ui/uihelper.py | 4 +++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/bb/ui/knotty.py b/lib/bb/ui/knotty.py
index 858cacf..60d5886 100644
--- a/lib/bb/ui/knotty.py
+++ b/lib/bb/ui/knotty.py
@@ -190,7 +190,8 @@ class TerminalFilter(object):
             return
         tasks = []
         for t in runningpids:
-            tasks.append("%s (pid %s)" % (activetasks[t]["title"], t))
+            tasks.append("%s - %s (pid %s)" %
+                         (activetasks[t]["started_str"], activetasks[t]["title"], t))
 
         if self.main.shutdown:
             content = "Waiting for %s running tasks to finish:" % len(activetasks)
diff --git a/lib/bb/ui/uihelper.py b/lib/bb/ui/uihelper.py
index e408b04..ae97c78 100644
--- a/lib/bb/ui/uihelper.py
+++ b/lib/bb/ui/uihelper.py
@@ -18,6 +18,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 import bb.build
+import time
 
 class BBUIHelper:
     def __init__(self):
@@ -31,7 +32,8 @@ class BBUIHelper:
 
     def eventHandler(self, event):
         if isinstance(event, bb.build.TaskStarted):
-            self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task) }
+            self.running_tasks[event.pid] = { 'title' : "%s %s" % (event._package, event._task),
+                                              'started_str' : time.strftime("%X") }
             self.running_pids.append(event.pid)
             self.needUpdate = True
         if isinstance(event, bb.build.TaskSucceeded):
-- 
1.7.11.4





More information about the bitbake-devel mailing list