[oe-commits] [bitbake] 06/07: lib/bb: Optimise out debug messages from cooker

git at git.openembedded.org git at git.openembedded.org
Sun Dec 15 22:50:02 UTC 2019


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit ea35332f95b5d5a6220732a9fc86de8f68b97c8a
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sun Dec 15 17:45:20 2019 +0000

    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 at linuxfoundation.org>
---
 lib/bb/__init__.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/bb/__init__.py b/lib/bb/__init__.py
index b9d8bfa..88641e2 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):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list