summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-11-29 17:47:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-12-07 10:42:22 +0000
commit083365143e844827599d9b0a78204b3a05df460c (patch)
tree5862275136012a1f932cee8644f67fbdcd2971c6 /bitbake/lib/bb/ui
parent1b32c6ed025745cb06b7c28ca0fe9e416ce7abfa (diff)
downloadpoky-083365143e844827599d9b0a78204b3a05df460c.tar.gz
bitbake: cooker process: fire heartbeat event at regular time intervals
The intended usage is for recording current system statistics from /proc in buildstats.bbclass during a build and for improving the BB_DISKMON_DIRS implementation. All other existing hooks are less suitable because they trigger at unpredictable rates: too often can be handled by doing rate-limiting in the event handler, but not often enough (for example, when there is only one long-running task) cannot because the handler does not get called at all. The implementation of the new heartbeat event hooks into the cooker process event queue. The process already wakes up every 0.1s, which is often enough for the intentionally coarse 1s delay between heartbeats. That value was chosen to keep the overhead low while still being frequent enough for the intended usage. If necessary, BB_HEARTBEAT_EVENT can be set to a float specifying the delay in seconds between these heartbeat events. (Bitbake rev: 7cf22ea057d28c54bd98dc1ab7a43402a29ff1f5) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui')
-rw-r--r--bitbake/lib/bb/ui/knotty.py1
-rw-r--r--bitbake/lib/bb/ui/toasterui.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/knotty.py b/bitbake/lib/bb/ui/knotty.py
index 948f52769d..48e1223c6b 100644
--- a/bitbake/lib/bb/ui/knotty.py
+++ b/bitbake/lib/bb/ui/knotty.py
@@ -647,6 +647,7 @@ def main(server, eventHandler, params, tf = TerminalFilter):
647 bb.event.OperationCompleted, 647 bb.event.OperationCompleted,
648 bb.event.OperationProgress, 648 bb.event.OperationProgress,
649 bb.event.DiskFull, 649 bb.event.DiskFull,
650 bb.event.HeartbeatEvent,
650 bb.build.TaskProgress)): 651 bb.build.TaskProgress)):
651 continue 652 continue
652 653
diff --git a/bitbake/lib/bb/ui/toasterui.py b/bitbake/lib/bb/ui/toasterui.py
index b1b3684a82..17299026ab 100644
--- a/bitbake/lib/bb/ui/toasterui.py
+++ b/bitbake/lib/bb/ui/toasterui.py
@@ -236,6 +236,9 @@ def main(server, eventHandler, params):
236 # pylint: disable=protected-access 236 # pylint: disable=protected-access
237 # the code will look into the protected variables of the event; no easy way around this 237 # the code will look into the protected variables of the event; no easy way around this
238 238
239 if isinstance(event, bb.event.HeartbeatEvent):
240 continue
241
239 if isinstance(event, bb.event.ParseStarted): 242 if isinstance(event, bb.event.ParseStarted):
240 if not (build_log and build_log_file_path): 243 if not (build_log and build_log_file_path):
241 build_log, build_log_file_path = _open_build_log(log_dir) 244 build_log, build_log_file_path = _open_build_log(log_dir)