diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-06-23 22:59:12 +1200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-08 09:57:27 +0100 |
commit | 1b930b41a5e677eea0adae3d247f43b77d1945f6 (patch) | |
tree | e3d3c0099efb6820c3bdc403d8842db4b4d73200 /bitbake/lib/bb/progress.py | |
parent | f3b62c1c2e47968084342d1fe2a9af596a3ba93c (diff) | |
download | poky-1b930b41a5e677eea0adae3d247f43b77d1945f6.tar.gz |
bitbake: runqueue: report progress for "Preparing RunQueue" step
When "Preparing RunQueue" shows up you can expect to wait up to 30
seconds while it works - which is a bit long to leave the user waiting
without any kind of output. Since the work being carried out during this
time is divided into stages such that it's practical to determine
internally how it's progressing, replace the message with a progress
bar.
Actually what happens during this time is two major steps rather than
just one - the runqueue preparation itself, followed by the
initialisation prior to running setscene tasks. I elected to have the
progress bar cover both as one (there doesn't appear to be much point in
doing otherwise from a user perspective). I did however describe it as
"initialising tasks".
(Bitbake rev: 591e9741e108487ff437e77cb439ef2dbca42e03)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/progress.py')
-rw-r--r-- | bitbake/lib/bb/progress.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bitbake/lib/bb/progress.py b/bitbake/lib/bb/progress.py index 93e42dfcdb..49417761bb 100644 --- a/bitbake/lib/bb/progress.py +++ b/bitbake/lib/bb/progress.py | |||
@@ -195,3 +195,45 @@ class MultiStageProgressReporter(object): | |||
195 | else: | 195 | else: |
196 | out.append('Up to finish: %d' % stage_weight) | 196 | out.append('Up to finish: %d' % stage_weight) |
197 | bb.warn('Stage times:\n %s' % '\n '.join(out)) | 197 | bb.warn('Stage times:\n %s' % '\n '.join(out)) |
198 | |||
199 | class MultiStageProcessProgressReporter(MultiStageProgressReporter): | ||
200 | """ | ||
201 | Version of MultiStageProgressReporter intended for use with | ||
202 | standalone processes (such as preparing the runqueue) | ||
203 | """ | ||
204 | def __init__(self, d, processname, stage_weights, debug=False): | ||
205 | self._processname = processname | ||
206 | MultiStageProgressReporter.__init__(self, d, stage_weights, debug) | ||
207 | |||
208 | def start(self): | ||
209 | bb.event.fire(bb.event.ProcessStarted(self._processname, 100), self._data) | ||
210 | |||
211 | def _fire_progress(self, taskprogress): | ||
212 | bb.event.fire(bb.event.ProcessProgress(self._processname, taskprogress), self._data) | ||
213 | |||
214 | def finish(self): | ||
215 | MultiStageProgressReporter.finish(self) | ||
216 | bb.event.fire(bb.event.ProcessFinished(self._processname), self._data) | ||
217 | |||
218 | class DummyMultiStageProcessProgressReporter(MultiStageProgressReporter): | ||
219 | """ | ||
220 | MultiStageProcessProgressReporter that takes the calls and does nothing | ||
221 | with them (to avoid a bunch of "if progress_reporter:" checks) | ||
222 | """ | ||
223 | def __init__(self): | ||
224 | MultiStageProcessProgressReporter.__init__(self, "", None, []) | ||
225 | |||
226 | def _fire_progress(self, taskprogress, rate=None): | ||
227 | pass | ||
228 | |||
229 | def start(self): | ||
230 | pass | ||
231 | |||
232 | def next_stage(self, stage_total=None): | ||
233 | pass | ||
234 | |||
235 | def update(self, stage_progress): | ||
236 | pass | ||
237 | |||
238 | def finish(self): | ||
239 | pass | ||