diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-03 16:11:02 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-15 10:28:12 +0100 |
commit | cfb7312b72b7bfaec05ca6b6ed0735473b2724a7 (patch) | |
tree | 3f77f44b3e83aa717848027bef23d493e28ba558 /bitbake/lib/bb | |
parent | dd7f09f471f19b8a03d62ff3a9a48a3173c2458f (diff) | |
download | poky-cfb7312b72b7bfaec05ca6b6ed0735473b2724a7.tar.gz |
bitbake: runqueue: Merge stats handling together for setscene/real tasks
Use a seperate stats class for scenequeue tasks and move the setup
into the base class. Update references accordingly.
(Bitbake rev: 32f39bbd5d3b7394689da9ba05be2c15b4523b27)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 5832db4ae5..3cc804de45 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1748,6 +1748,9 @@ class RunQueueExecute: | |||
1748 | 1748 | ||
1749 | self.stampcache = {} | 1749 | self.stampcache = {} |
1750 | 1750 | ||
1751 | self.stats = RunQueueStats(len(self.rqdata.runtaskentries)) | ||
1752 | self.sq_stats = RunQueueStats(len(self.rqdata.runq_setscene_tids)) | ||
1753 | |||
1751 | for mc in rq.worker: | 1754 | for mc in rq.worker: |
1752 | rq.worker[mc].pipe.setrunqueueexec(self) | 1755 | rq.worker[mc].pipe.setrunqueueexec(self) |
1753 | for mc in rq.fakeworker: | 1756 | for mc in rq.fakeworker: |
@@ -1802,8 +1805,9 @@ class RunQueueExecute: | |||
1802 | def finish(self): | 1805 | def finish(self): |
1803 | self.rq.state = runQueueCleanUp | 1806 | self.rq.state = runQueueCleanUp |
1804 | 1807 | ||
1805 | if self.stats.active > 0: | 1808 | active = self.stats.active + self.sq_stats.active |
1806 | bb.event.fire(runQueueExitWait(self.stats.active), self.cfgData) | 1809 | if active > 0: |
1810 | bb.event.fire(runQueueExitWait(active), self.cfgData) | ||
1807 | self.rq.read_workers() | 1811 | self.rq.read_workers() |
1808 | return self.rq.active_fds() | 1812 | return self.rq.active_fds() |
1809 | 1813 | ||
@@ -1831,7 +1835,8 @@ class RunQueueExecute: | |||
1831 | return valid | 1835 | return valid |
1832 | 1836 | ||
1833 | def can_start_task(self): | 1837 | def can_start_task(self): |
1834 | can_start = self.stats.active < self.number_tasks | 1838 | active = self.stats.active + self.sq_stats.active |
1839 | can_start = active < self.number_tasks | ||
1835 | return can_start | 1840 | return can_start |
1836 | 1841 | ||
1837 | class RunQueueExecuteDummy(RunQueueExecute): | 1842 | class RunQueueExecuteDummy(RunQueueExecute): |
@@ -1847,8 +1852,6 @@ class RunQueueExecuteTasks(RunQueueExecute): | |||
1847 | def __init__(self, rq): | 1852 | def __init__(self, rq): |
1848 | RunQueueExecute.__init__(self, rq) | 1853 | RunQueueExecute.__init__(self, rq) |
1849 | 1854 | ||
1850 | self.stats = RunQueueStats(len(self.rqdata.runtaskentries)) | ||
1851 | |||
1852 | self.stampcache = {} | 1855 | self.stampcache = {} |
1853 | 1856 | ||
1854 | # Mark initial buildable tasks | 1857 | # Mark initial buildable tasks |
@@ -2358,8 +2361,6 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2358 | rq.state = runQueueRunInit | 2361 | rq.state = runQueueRunInit |
2359 | return | 2362 | return |
2360 | 2363 | ||
2361 | self.stats = RunQueueStats(len(self.rqdata.runq_setscene_tids)) | ||
2362 | |||
2363 | self.sqdata = SQData() | 2364 | self.sqdata = SQData() |
2364 | build_scenequeue_data(self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self) | 2365 | build_scenequeue_data(self.sqdata, self.rqdata, self.rq, self.cooker, self.stampcache, self) |
2365 | 2366 | ||
@@ -2401,13 +2402,13 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2401 | self.rq.state = runQueueCleanUp | 2402 | self.rq.state = runQueueCleanUp |
2402 | 2403 | ||
2403 | def sq_task_complete(self, task): | 2404 | def sq_task_complete(self, task): |
2404 | self.stats.taskCompleted() | 2405 | self.sq_stats.taskCompleted() |
2405 | bb.event.fire(sceneQueueTaskCompleted(task, self.stats, self.rq), self.cfgData) | 2406 | bb.event.fire(sceneQueueTaskCompleted(task, self.sq_stats, self.rq), self.cfgData) |
2406 | self.sq_task_completeoutright(task) | 2407 | self.sq_task_completeoutright(task) |
2407 | 2408 | ||
2408 | def sq_task_fail(self, task, result): | 2409 | def sq_task_fail(self, task, result): |
2409 | self.stats.taskFailed() | 2410 | self.sq_stats.taskFailed() |
2410 | bb.event.fire(sceneQueueTaskFailed(task, self.stats, result, self), self.cfgData) | 2411 | bb.event.fire(sceneQueueTaskFailed(task, self.sq_stats, result, self), self.cfgData) |
2411 | self.scenequeue_notcovered.add(task) | 2412 | self.scenequeue_notcovered.add(task) |
2412 | self.scenequeue_updatecounters(task, True) | 2413 | self.scenequeue_updatecounters(task, True) |
2413 | self.sq_check_taskfail(task) | 2414 | self.sq_check_taskfail(task) |
@@ -2415,8 +2416,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2415 | def sq_task_failoutright(self, task): | 2416 | def sq_task_failoutright(self, task): |
2416 | self.sq_running.add(task) | 2417 | self.sq_running.add(task) |
2417 | self.sq_buildable.add(task) | 2418 | self.sq_buildable.add(task) |
2418 | self.stats.taskSkipped() | 2419 | self.sq_stats.taskSkipped() |
2419 | self.stats.taskCompleted() | 2420 | self.sq_stats.taskCompleted() |
2420 | self.scenequeue_notcovered.add(task) | 2421 | self.scenequeue_notcovered.add(task) |
2421 | self.scenequeue_updatecounters(task, True) | 2422 | self.scenequeue_updatecounters(task, True) |
2422 | 2423 | ||
@@ -2424,8 +2425,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2424 | self.sq_running.add(task) | 2425 | self.sq_running.add(task) |
2425 | self.sq_buildable.add(task) | 2426 | self.sq_buildable.add(task) |
2426 | self.sq_task_completeoutright(task) | 2427 | self.sq_task_completeoutright(task) |
2427 | self.stats.taskSkipped() | 2428 | self.sq_stats.taskSkipped() |
2428 | self.stats.taskCompleted() | 2429 | self.sq_stats.taskCompleted() |
2429 | 2430 | ||
2430 | def sq_execute(self): | 2431 | def sq_execute(self): |
2431 | """ | 2432 | """ |
@@ -2480,7 +2481,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2480 | self.sq_task_failoutright(task) | 2481 | self.sq_task_failoutright(task) |
2481 | return True | 2482 | return True |
2482 | 2483 | ||
2483 | startevent = sceneQueueTaskStarted(task, self.stats, self.rq) | 2484 | startevent = sceneQueueTaskStarted(task, self.sq_stats, self.rq) |
2484 | bb.event.fire(startevent, self.cfgData) | 2485 | bb.event.fire(startevent, self.cfgData) |
2485 | 2486 | ||
2486 | taskdepdata = self.sq_build_taskdepdata(task) | 2487 | taskdepdata = self.sq_build_taskdepdata(task) |
@@ -2501,11 +2502,11 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2501 | self.build_stamps2.append(self.build_stamps[task]) | 2502 | self.build_stamps2.append(self.build_stamps[task]) |
2502 | self.sq_running.add(task) | 2503 | self.sq_running.add(task) |
2503 | self.sq_live.add(task) | 2504 | self.sq_live.add(task) |
2504 | self.stats.taskActive() | 2505 | self.sq_stats.taskActive() |
2505 | if self.can_start_task(): | 2506 | if self.can_start_task(): |
2506 | return True | 2507 | return True |
2507 | 2508 | ||
2508 | if self.stats.active > 0: | 2509 | if self.sq_stats.active > 0: |
2509 | self.rq.read_workers() | 2510 | self.rq.read_workers() |
2510 | return self.rq.active_fds() | 2511 | return self.rq.active_fds() |
2511 | 2512 | ||
@@ -2522,7 +2523,7 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2522 | 2523 | ||
2523 | self.rq.state = runQueueRunInit | 2524 | self.rq.state = runQueueRunInit |
2524 | 2525 | ||
2525 | completeevent = sceneQueueComplete(self.stats, self.rq) | 2526 | completeevent = sceneQueueComplete(self.sq_stats, self.rq) |
2526 | bb.event.fire(completeevent, self.cfgData) | 2527 | bb.event.fire(completeevent, self.cfgData) |
2527 | 2528 | ||
2528 | return True | 2529 | return True |