summaryrefslogtreecommitdiffstats
path: root/bitbake/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:54 +0100
commit25e410b743be45f7ed57457c1d3cd2066652085b (patch)
tree51035c334025e08e2500912026e97014e81803cd /bitbake/lib/bb/msg.py
parent9f0f799c461fb67e7c03304216253ca9bf899680 (diff)
downloadpoky-25e410b743be45f7ed57457c1d3cd2066652085b.tar.gz
bitbake: 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. (Bitbake rev: 1bf0e88f57ba0bca62532e81d0d62cf88e2abcbb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/msg.py')
-rw-r--r--bitbake/lib/bb/msg.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bitbake/lib/bb/msg.py b/bitbake/lib/bb/msg.py
index e70daee92f..59769707e0 100644
--- a/bitbake/lib/bb/msg.py
+++ b/bitbake/lib/bb/msg.py
@@ -146,8 +146,7 @@ def init_msgconfig(verbose, debug, debug_domains = []):
146 bb.msg.loggerVerboseLogs = True 146 bb.msg.loggerVerboseLogs = True
147 bb.msg.loggerDefaultDomains = debug_domains 147 bb.msg.loggerDefaultDomains = debug_domains
148 148
149def addDefaultlogFilter(handler): 149def constructLogOptions():
150
151 debug = loggerDefaultDebugLevel 150 debug = loggerDefaultDebugLevel
152 verbose = loggerDefaultVerbose 151 verbose = loggerDefaultVerbose
153 domains = loggerDefaultDomains 152 domains = loggerDefaultDomains
@@ -163,6 +162,10 @@ def addDefaultlogFilter(handler):
163 for (domainarg, iterator) in groupby(domains): 162 for (domainarg, iterator) in groupby(domains):
164 dlevel = len(tuple(iterator)) 163 dlevel = len(tuple(iterator))
165 debug_domains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1 164 debug_domains["BitBake.%s" % domainarg] = logging.DEBUG - dlevel + 1
165 return level, debug_domains
166
167def addDefaultlogFilter(handler):
168 level, debug_domains = constructLogOptions()
166 169
167 BBLogFilter(handler, level, debug_domains) 170 BBLogFilter(handler, level, debug_domains)
168 171