bitbake: cooker: Add some timing debug messages to the server startup

We're seeing slow startup in bitbake, add some timeing debug messages so
the logs are more useful for debugging when its slow.

(Bitbake rev: 8d1fc115b8a176009f1f3a8ce840b422e7e0b45e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2018-12-07 12:28:32 +00:00
parent 55197b853d
commit 89e2d2835d

View File

@@ -175,18 +175,31 @@ class BBCooker:
self.configuration = configuration self.configuration = configuration
bb.debug(1, "BBCooker starting %s" % time.time())
sys.stdout.flush()
self.configwatcher = pyinotify.WatchManager() self.configwatcher = pyinotify.WatchManager()
bb.debug(1, "BBCooker pyinotify1 %s" % time.time())
sys.stdout.flush()
self.configwatcher.bbseen = [] self.configwatcher.bbseen = []
self.configwatcher.bbwatchedfiles = [] self.configwatcher.bbwatchedfiles = []
self.confignotifier = pyinotify.Notifier(self.configwatcher, self.config_notifications) self.confignotifier = pyinotify.Notifier(self.configwatcher, self.config_notifications)
bb.debug(1, "BBCooker pyinotify2 %s" % time.time())
sys.stdout.flush()
self.watchmask = pyinotify.IN_CLOSE_WRITE | pyinotify.IN_CREATE | pyinotify.IN_DELETE | \ self.watchmask = pyinotify.IN_CLOSE_WRITE | pyinotify.IN_CREATE | pyinotify.IN_DELETE | \
pyinotify.IN_DELETE_SELF | pyinotify.IN_MODIFY | pyinotify.IN_MOVE_SELF | \ pyinotify.IN_DELETE_SELF | pyinotify.IN_MODIFY | pyinotify.IN_MOVE_SELF | \
pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO
self.watcher = pyinotify.WatchManager() self.watcher = pyinotify.WatchManager()
bb.debug(1, "BBCooker pyinotify3 %s" % time.time())
sys.stdout.flush()
self.watcher.bbseen = [] self.watcher.bbseen = []
self.watcher.bbwatchedfiles = [] self.watcher.bbwatchedfiles = []
self.notifier = pyinotify.Notifier(self.watcher, self.notifications) self.notifier = pyinotify.Notifier(self.watcher, self.notifications)
bb.debug(1, "BBCooker pyinotify complete %s" % time.time())
sys.stdout.flush()
# If being called by something like tinfoil, we need to clean cached data # If being called by something like tinfoil, we need to clean cached data
# which may now be invalid # which may now be invalid
bb.parse.clear_cache() bb.parse.clear_cache()
@@ -196,6 +209,9 @@ class BBCooker:
self.initConfigurationData() self.initConfigurationData()
bb.debug(1, "BBCooker parsed base configuration %s" % time.time())
sys.stdout.flush()
# we log all events to a file if so directed # we log all events to a file if so directed
if self.configuration.writeeventlog: if self.configuration.writeeventlog:
# register the log file writer as UI Handler # register the log file writer as UI Handler
@@ -233,6 +249,9 @@ class BBCooker:
# Let SIGHUP exit as SIGTERM # Let SIGHUP exit as SIGTERM
signal.signal(signal.SIGHUP, self.sigterm_exception) signal.signal(signal.SIGHUP, self.sigterm_exception)
bb.debug(1, "BBCooker startup complete %s" % time.time())
sys.stdout.flush()
def process_inotify_updates(self): def process_inotify_updates(self):
for n in [self.confignotifier, self.notifier]: for n in [self.confignotifier, self.notifier]:
if n.check_events(timeout=0): if n.check_events(timeout=0):