mirror of
https://git.yoctoproject.org/poky
synced 2026-04-18 21:32:12 +02:00
bitbake: runqueue/knotty: Improve UI handling of setscene task counting
The recent fixes to merge setscene and normal task accounting in runqueue fixed some display issues but broke the task numbering of setscene tasks. Add new accounting methods to the stats structure specifically designed for setscene. This accounts for the fact that setscene tasks can rerun multiple times in the build. Then use the new data in the UI to correctly display the numbers the user wants to see to understand progress. (Bitbake rev: 7d938703d9321cde5a32e4dff005f07e8821b704) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit ed7e2da88bf4b7bfc7ebfc12b9bd6c0fb7d8c1aa) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -85,15 +85,19 @@ class RunQueueStats:
|
||||
"""
|
||||
Holds statistics on the tasks handled by the associated runQueue
|
||||
"""
|
||||
def __init__(self, total):
|
||||
def __init__(self, total, setscene_total):
|
||||
self.completed = 0
|
||||
self.skipped = 0
|
||||
self.failed = 0
|
||||
self.active = 0
|
||||
self.setscene_active = 0
|
||||
self.setscene_covered = 0
|
||||
self.setscene_notcovered = 0
|
||||
self.setscene_total = setscene_total
|
||||
self.total = total
|
||||
|
||||
def copy(self):
|
||||
obj = self.__class__(self.total)
|
||||
obj = self.__class__(self.total, self.setscene_total)
|
||||
obj.__dict__.update(self.__dict__)
|
||||
return obj
|
||||
|
||||
@@ -112,6 +116,13 @@ class RunQueueStats:
|
||||
def taskActive(self):
|
||||
self.active = self.active + 1
|
||||
|
||||
def updateCovered(self, covered, notcovered):
|
||||
self.setscene_covered = covered
|
||||
self.setscene_notcovered = notcovered
|
||||
|
||||
def updateActiveSetscene(self, active):
|
||||
self.setscene_active = active
|
||||
|
||||
# These values indicate the next step due to be run in the
|
||||
# runQueue state machine
|
||||
runQueuePrepare = 2
|
||||
@@ -1735,7 +1746,7 @@ class RunQueueExecute:
|
||||
self.holdoff_need_update = True
|
||||
self.sqdone = False
|
||||
|
||||
self.stats = RunQueueStats(len(self.rqdata.runtaskentries))
|
||||
self.stats = RunQueueStats(len(self.rqdata.runtaskentries), len(self.rqdata.runq_setscene_tids))
|
||||
|
||||
for mc in rq.worker:
|
||||
rq.worker[mc].pipe.setrunqueueexec(self)
|
||||
@@ -1786,6 +1797,7 @@ class RunQueueExecute:
|
||||
else:
|
||||
self.sq_task_complete(task)
|
||||
self.sq_live.remove(task)
|
||||
self.stats.updateActiveSetscene(len(self.sq_live))
|
||||
else:
|
||||
if status != 0:
|
||||
self.task_fail(task, status, fakerootlog=fakerootlog)
|
||||
@@ -2087,6 +2099,7 @@ class RunQueueExecute:
|
||||
self.build_stamps2.append(self.build_stamps[task])
|
||||
self.sq_running.add(task)
|
||||
self.sq_live.add(task)
|
||||
self.stats.updateActiveSetscene(len(self.sq_live))
|
||||
if self.can_start_task():
|
||||
return True
|
||||
|
||||
@@ -2462,6 +2475,7 @@ class RunQueueExecute:
|
||||
self.sq_task_failoutright(tid)
|
||||
|
||||
if changed:
|
||||
self.stats.updateCovered(len(self.scenequeue_covered), len(self.scenequeue_notcovered))
|
||||
self.holdoff_need_update = True
|
||||
|
||||
def scenequeue_updatecounters(self, task, fail=False):
|
||||
@@ -2495,6 +2509,7 @@ class RunQueueExecute:
|
||||
new.add(dep)
|
||||
next = new
|
||||
|
||||
self.stats.updateCovered(len(self.scenequeue_covered), len(self.scenequeue_notcovered))
|
||||
self.holdoff_need_update = True
|
||||
|
||||
def sq_task_completeoutright(self, task):
|
||||
|
||||
@@ -745,7 +745,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
|
||||
continue
|
||||
|
||||
if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
|
||||
logger.info("Running setscene task %d of %d (%s)" % (event.stats.completed + event.stats.active + event.stats.failed + 1, event.stats.total, event.taskstring))
|
||||
logger.info("Running setscene task %d of %d (%s)" % (event.stats.setscene_covered + event.stats.setscene_active + event.stats.setscene_notcovered + 1, event.stats.setscene_total, event.taskstring))
|
||||
continue
|
||||
|
||||
if isinstance(event, bb.runqueue.runQueueTaskStarted):
|
||||
|
||||
@@ -50,7 +50,7 @@ class BBUIHelper:
|
||||
removetid(event.pid, tid)
|
||||
self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
|
||||
elif isinstance(event, bb.runqueue.runQueueTaskStarted) or isinstance(event, bb.runqueue.sceneQueueTaskStarted):
|
||||
self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1
|
||||
self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + event.stats.setscene_active + 1
|
||||
self.tasknumber_total = event.stats.total
|
||||
self.needUpdate = True
|
||||
elif isinstance(event, bb.build.TaskProgress):
|
||||
|
||||
Reference in New Issue
Block a user