summaryrefslogtreecommitdiffstats
path: root/bitbake/lib
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-16 10:31:40 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-09-17 07:26:23 +0100
commit6b520611235673c9223609676a70d3cf5f6d4744 (patch)
treefc2b797813b89a763683b85e9f3d0c5762d501fe /bitbake/lib
parent4437754142f6d0e8f3cf9ffbb51c61321b8c5600 (diff)
downloadpoky-6b520611235673c9223609676a70d3cf5f6d4744.tar.gz
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: ed7e2da88bf4b7bfc7ebfc12b9bd6c0fb7d8c1aa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib')
-rw-r--r--bitbake/lib/bb/runqueue.py21
-rw-r--r--bitbake/lib/bb/ui/knotty.py2
-rw-r--r--bitbake/lib/bb/ui/uihelper.py2
3 files changed, 20 insertions, 5 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 6ce0ce80f6..10511a09dc 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -85,15 +85,19 @@ class RunQueueStats:
85 """ 85 """
86 Holds statistics on the tasks handled by the associated runQueue 86 Holds statistics on the tasks handled by the associated runQueue
87 """ 87 """
88 def __init__(self, total): 88 def __init__(self, total, setscene_total):
89 self.completed = 0 89 self.completed = 0
90 self.skipped = 0 90 self.skipped = 0
91 self.failed = 0 91 self.failed = 0
92 self.active = 0 92 self.active = 0
93 self.setscene_active = 0
94 self.setscene_covered = 0
95 self.setscene_notcovered = 0
96 self.setscene_total = setscene_total
93 self.total = total 97 self.total = total
94 98
95 def copy(self): 99 def copy(self):
96 obj = self.__class__(self.total) 100 obj = self.__class__(self.total, self.setscene_total)
97 obj.__dict__.update(self.__dict__) 101 obj.__dict__.update(self.__dict__)
98 return obj 102 return obj
99 103
@@ -112,6 +116,13 @@ class RunQueueStats:
112 def taskActive(self): 116 def taskActive(self):
113 self.active = self.active + 1 117 self.active = self.active + 1
114 118
119 def updateCovered(self, covered, notcovered):
120 self.setscene_covered = covered
121 self.setscene_notcovered = notcovered
122
123 def updateActiveSetscene(self, active):
124 self.setscene_active = active
125
115# These values indicate the next step due to be run in the 126# These values indicate the next step due to be run in the
116# runQueue state machine 127# runQueue state machine
117runQueuePrepare = 2 128runQueuePrepare = 2
@@ -1735,7 +1746,7 @@ class RunQueueExecute:
1735 self.holdoff_need_update = True 1746 self.holdoff_need_update = True
1736 self.sqdone = False 1747 self.sqdone = False
1737 1748
1738 self.stats = RunQueueStats(len(self.rqdata.runtaskentries)) 1749 self.stats = RunQueueStats(len(self.rqdata.runtaskentries), len(self.rqdata.runq_setscene_tids))
1739 1750
1740 for mc in rq.worker: 1751 for mc in rq.worker:
1741 rq.worker[mc].pipe.setrunqueueexec(self) 1752 rq.worker[mc].pipe.setrunqueueexec(self)
@@ -1786,6 +1797,7 @@ class RunQueueExecute:
1786 else: 1797 else:
1787 self.sq_task_complete(task) 1798 self.sq_task_complete(task)
1788 self.sq_live.remove(task) 1799 self.sq_live.remove(task)
1800 self.stats.updateActiveSetscene(len(self.sq_live))
1789 else: 1801 else:
1790 if status != 0: 1802 if status != 0:
1791 self.task_fail(task, status, fakerootlog=fakerootlog) 1803 self.task_fail(task, status, fakerootlog=fakerootlog)
@@ -2087,6 +2099,7 @@ class RunQueueExecute:
2087 self.build_stamps2.append(self.build_stamps[task]) 2099 self.build_stamps2.append(self.build_stamps[task])
2088 self.sq_running.add(task) 2100 self.sq_running.add(task)
2089 self.sq_live.add(task) 2101 self.sq_live.add(task)
2102 self.stats.updateActiveSetscene(len(self.sq_live))
2090 if self.can_start_task(): 2103 if self.can_start_task():
2091 return True 2104 return True
2092 2105
@@ -2462,6 +2475,7 @@ class RunQueueExecute:
2462 self.sq_task_failoutright(tid) 2475 self.sq_task_failoutright(tid)
2463 2476
2464 if changed: 2477 if changed:
2478 self.stats.updateCovered(len(self.scenequeue_covered), len(self.scenequeue_notcovered))
2465 self.holdoff_need_update = True 2479 self.holdoff_need_update = True
2466 2480
2467 def scenequeue_updatecounters(self, task, fail=False): 2481 def scenequeue_updatecounters(self, task, fail=False):
@@ -2495,6 +2509,7 @@ class RunQueueExecute:
2495 new.add(dep) 2509 new.add(dep)
2496 next = new 2510 next = new
2497 2511
2512 self.stats.updateCovered(len(self.scenequeue_covered), len(self.scenequeue_notcovered))
2498 self.holdoff_need_update = True 2513 self.holdoff_need_update = True
2499 2514
2500 def sq_task_completeoutright(self, task): 2515 def sq_task_completeoutright(self, task):
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 65ff2727dc..8df745d130 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -753,7 +753,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
753 continue 753 continue
754 754
755 if isinstance(event, bb.runqueue.sceneQueueTaskStarted): 755 if isinstance(event, bb.runqueue.sceneQueueTaskStarted):
756 logger.info("Running setscene task %d of %d (%s)" % (event.stats.completed + event.stats.active + event.stats.failed + 1, event.stats.total, event.taskstring)) 756 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))
757 continue 757 continue
758 758
759 if isinstance(event, bb.runqueue.runQueueTaskStarted): 759 if isinstance(event, bb.runqueue.runQueueTaskStarted):
diff --git a/bitbake/lib/bb/ui/uihelper.py b/bitbake/lib/bb/ui/uihelper.py
index 40c7c5a5ef..52fdae3fec 100644
--- a/bitbake/lib/bb/ui/uihelper.py
+++ b/bitbake/lib/bb/ui/uihelper.py
@@ -50,7 +50,7 @@ class BBUIHelper:
50 removetid(event.pid, tid) 50 removetid(event.pid, tid)
51 self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)}) 51 self.failed_tasks.append( { 'title' : "%s %s" % (event._package, event._task)})
52 elif isinstance(event, bb.runqueue.runQueueTaskStarted) or isinstance(event, bb.runqueue.sceneQueueTaskStarted): 52 elif isinstance(event, bb.runqueue.runQueueTaskStarted) or isinstance(event, bb.runqueue.sceneQueueTaskStarted):
53 self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + 1 53 self.tasknumber_current = event.stats.completed + event.stats.active + event.stats.failed + event.stats.setscene_active + 1
54 self.tasknumber_total = event.stats.total 54 self.tasknumber_total = event.stats.total
55 self.needUpdate = True 55 self.needUpdate = True
56 elif isinstance(event, bb.build.TaskProgress): 56 elif isinstance(event, bb.build.TaskProgress):