summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-15 17:45:20 +0000
committerArmin Kuster <akuster808@gmail.com>2019-12-17 22:14:47 -0800
commitf224201b5003b89367d688b1f08a062754fce13a (patch)
tree84d2a125e8b23df4699468c97ab99723706fa062
parent53a3cba93401c902d1d214cafe0bc036e1b101e5 (diff)
downloadbitbake-f224201b5003b89367d688b1f08a062754fce13a.tar.gz
lib/bb: Optimise out debug messages from cooker
We have bb.debug(2, xxx) messages in cooker which are useful for debugging but have really bad effects on performance, 640,000 calls on recent profile graphs taking tens of seconds. Rather than commenting out debug which can be useful for debugging, don't create events for debug log messages from cooker which would never be seen. We already stop the messages hitting the IPC but this avoids the overhead of creating the log messages too, which has been shown to be signficiant on the profiles. This allows the code to perform whilst allowing debug messages to be availble when wanted/enabled. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit f04cd931091fb0508badf3e002d70a6952700495)
-rw-r--r--lib/bb/__init__.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index c144311be..ce519ba39 100644
--- a/lib/bb/__init__.py
+++ b/lib/bb/__init__.py
@@ -43,6 +43,11 @@ class BBLogger(Logger):
Logger.__init__(self, name)
def bbdebug(self, level, msg, *args, **kwargs):
+ if not bb.event.worker_pid:
+ if self.name in bb.msg.loggerDefaultDomains and level > (bb.msg.loggerDefaultDomains[self.name]):
+ return
+ if level > (bb.msg.loggerDefaultDebugLevel):
+ return
return self.log(logging.DEBUG - level + 1, msg, *args, **kwargs)
def plain(self, msg, *args, **kwargs):