diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-15 17:45:20 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-12-16 23:27:14 +0000 |
commit | a96403c6254e74c7939748f0917f0d6d606eda49 (patch) | |
tree | 34e20493f6aee2c0b671b92cd297e466090417bb /bitbake/lib/bb/__init__.py | |
parent | ec3897d9c052ad129e3291fc76b5e5613f30df8a (diff) | |
download | poky-a96403c6254e74c7939748f0917f0d6d606eda49.tar.gz |
bitbake: 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.
(Bitbake rev: f04cd931091fb0508badf3e002d70a6952700495)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/__init__.py')
-rw-r--r-- | bitbake/lib/bb/__init__.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/__init__.py b/bitbake/lib/bb/__init__.py index b9d8bfa769..88641e280b 100644 --- a/bitbake/lib/bb/__init__.py +++ b/bitbake/lib/bb/__init__.py | |||
@@ -43,6 +43,11 @@ class BBLogger(Logger): | |||
43 | Logger.__init__(self, name) | 43 | Logger.__init__(self, name) |
44 | 44 | ||
45 | def bbdebug(self, level, msg, *args, **kwargs): | 45 | def bbdebug(self, level, msg, *args, **kwargs): |
46 | if not bb.event.worker_pid: | ||
47 | if self.name in bb.msg.loggerDefaultDomains and level > (bb.msg.loggerDefaultDomains[self.name]): | ||
48 | return | ||
49 | if level > (bb.msg.loggerDefaultDebugLevel): | ||
50 | return | ||
46 | return self.log(logging.DEBUG - level + 1, msg, *args, **kwargs) | 51 | return self.log(logging.DEBUG - level + 1, msg, *args, **kwargs) |
47 | 52 | ||
48 | def plain(self, msg, *args, **kwargs): | 53 | def plain(self, msg, *args, **kwargs): |