aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/msg.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-23 15:55:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-23 17:29:26 +0100
commit1bf0e88f57ba0bca62532e81d0d62cf88e2abcbb (patch)
tree6b2f3a7b86da1da181c0686a93a212cadf6363b0 /lib/bb/msg.py
parenta672b39c5d529ba85d72eee8fef4c4273eaa5397 (diff)
downloadbitbake-1bf0e88f57ba0bca62532e81d0d62cf88e2abcbb.tar.gz
event/msg: Add primitive server side UI log record filtering
Currently one of the bigger bottlenecks in bitbake is passing all the log messages over IPC to the UI. This is worthwhile if the UI is going to use them, pointless otherwise. The memory resident bitbake suffers from this performance issue particularly badly. This patch filters the log events on the server side with the global log levels and hence reduces the traffic. This speeds up parsing (18.5s down to 17s) and bitbake general command overhead is reduced (7.3s for a NOP to 6.2s). What isn't added here is general event filtering or the ability to change the log levels once set. Provision is made for adding this in a follow up patch though. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/msg.py')
-rw-r--r--lib/bb/msg.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index e70daee92..59769707e 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -146,8 +146,7 @@ def init_msgconfig(verbose, debug, debug_domains = []):
bb.msg.loggerVerboseLogs = True
bb.msg.loggerDefaultDomains = debug_domains
-def addDefaultlogFilter(handler):
-
+def constructLogOptions():
debug = loggerDefaultDebugLevel
verbose = loggerDefaultVerbose
domains = loggerDefaultDomains
@@ -163,6 +162,10 @@ def addDefaultlogFilter(handler):
for (domainarg, iterator) in groupby(domains):
dlevel = len(tuple(iterator))
debug_domains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1
+ return level, debug_domains
+
+def addDefaultlogFilter(handler):
+ level, debug_domains = constructLogOptions()
BBLogFilter(handler, level, debug_domains)