diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2018-05-14 10:21:38 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-06-15 17:57:30 +0100 |
commit | 27101e647f6323a783a17391b57fe4145fa5dec5 (patch) | |
tree | 485821a1354f8b86f9632f8221103625fb6e585e /bitbake/lib/bb/runqueue.py | |
parent | 783829427157b82dd021be345fe00afdf4d84a68 (diff) | |
download | poky-27101e647f6323a783a17391b57fe4145fa5dec5.tar.gz |
bitbake: runqueue.py: Minor cleanup for RunQueueStats and users
The RunQueueStats:taskCompleted and RunQueueStats:taskSkipped can take
multiple arguments. However, nowehere in bitbake are multiple arguments used.
Change this to match the behavior of the other APIs where it needs to be
called once for each task.
Additionally, these two functions were usually called in tandem, however in
the wrong order. It really doesn't matter as there is no specific preemption
point between the calls. But the taskSkipped should be called first to
increment the 'active' count, and then taskCompleted called to decrement it.
(Bitbake rev: 26d5ea9bb892bd6a2e1fd29a9023e0b0644edc16)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index f2e52cf758..a937a0ba76 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -94,13 +94,13 @@ class RunQueueStats: | |||
94 | self.active = self.active - 1 | 94 | self.active = self.active - 1 |
95 | self.failed = self.failed + 1 | 95 | self.failed = self.failed + 1 |
96 | 96 | ||
97 | def taskCompleted(self, number = 1): | 97 | def taskCompleted(self): |
98 | self.active = self.active - number | 98 | self.active = self.active - 1 |
99 | self.completed = self.completed + number | 99 | self.completed = self.completed + 1 |
100 | 100 | ||
101 | def taskSkipped(self, number = 1): | 101 | def taskSkipped(self): |
102 | self.active = self.active + number | 102 | self.active = self.active + 1 |
103 | self.skipped = self.skipped + number | 103 | self.skipped = self.skipped + 1 |
104 | 104 | ||
105 | def taskActive(self): | 105 | def taskActive(self): |
106 | self.active = self.active + 1 | 106 | self.active = self.active + 1 |
@@ -1896,8 +1896,8 @@ class RunQueueExecuteTasks(RunQueueExecute): | |||
1896 | self.setbuildable(task) | 1896 | self.setbuildable(task) |
1897 | bb.event.fire(runQueueTaskSkipped(task, self.stats, self.rq, reason), self.cfgData) | 1897 | bb.event.fire(runQueueTaskSkipped(task, self.stats, self.rq, reason), self.cfgData) |
1898 | self.task_completeoutright(task) | 1898 | self.task_completeoutright(task) |
1899 | self.stats.taskCompleted() | ||
1900 | self.stats.taskSkipped() | 1899 | self.stats.taskSkipped() |
1900 | self.stats.taskCompleted() | ||
1901 | 1901 | ||
1902 | def execute(self): | 1902 | def execute(self): |
1903 | """ | 1903 | """ |
@@ -2342,8 +2342,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2342 | def task_failoutright(self, task): | 2342 | def task_failoutright(self, task): |
2343 | self.runq_running.add(task) | 2343 | self.runq_running.add(task) |
2344 | self.runq_buildable.add(task) | 2344 | self.runq_buildable.add(task) |
2345 | self.stats.taskCompleted() | ||
2346 | self.stats.taskSkipped() | 2345 | self.stats.taskSkipped() |
2346 | self.stats.taskCompleted() | ||
2347 | self.scenequeue_notcovered.add(task) | 2347 | self.scenequeue_notcovered.add(task) |
2348 | self.scenequeue_updatecounters(task, True) | 2348 | self.scenequeue_updatecounters(task, True) |
2349 | 2349 | ||
@@ -2351,8 +2351,8 @@ class RunQueueExecuteScenequeue(RunQueueExecute): | |||
2351 | self.runq_running.add(task) | 2351 | self.runq_running.add(task) |
2352 | self.runq_buildable.add(task) | 2352 | self.runq_buildable.add(task) |
2353 | self.task_completeoutright(task) | 2353 | self.task_completeoutright(task) |
2354 | self.stats.taskCompleted() | ||
2355 | self.stats.taskSkipped() | 2354 | self.stats.taskSkipped() |
2355 | self.stats.taskCompleted() | ||
2356 | 2356 | ||
2357 | def execute(self): | 2357 | def execute(self): |
2358 | """ | 2358 | """ |