aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-30 22:19:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-01-26 21:50:33 +0000
commite681802d657079e37e314f51ddd9366b5785447e (patch)
tree2d98abfb9e4614f050c107b5516f7c9e729eef0a
parentc19035e8e71c419c5688a86bfc9c946c96f638e8 (diff)
downloadbitbake-master-next.tar.gz
add debugmaster-next
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/command.py9
-rw-r--r--lib/bb/cooker.py3
-rw-r--r--lib/bb/server/process.py12
3 files changed, 19 insertions, 5 deletions
diff --git a/lib/bb/command.py b/lib/bb/command.py
index 9e2cdc5c..bc4e5927 100644
--- a/lib/bb/command.py
+++ b/lib/bb/command.py
@@ -60,6 +60,7 @@ class Command:
self.process_server = process_server
# Access with locking using process_server.{get/set/clear}_async_cmd()
self.currentAsyncCommand = None
+ self.lastEvent = None
def runCommand(self, commandline, process_server, ro_only=False):
command = commandline.pop(0)
@@ -145,11 +146,13 @@ class Command:
def finishAsyncCommand(self, msg=None, code=None):
if msg or msg == "":
- bb.event.fire(CommandFailed(msg), self.cooker.data)
+ event = CommandFailed(msg)
elif code:
- bb.event.fire(CommandExit(code), self.cooker.data)
+ event = CommandExit(code)
else:
- bb.event.fire(CommandCompleted(), self.cooker.data)
+ event = CommandCompleted()
+ bb.event.fire(event, self.cooker.data)
+ self.lastEvent = event
self.cooker.finishcommand()
self.process_server.clear_async_cmd()
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index c5e9fa29..042cec71 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -2196,6 +2196,7 @@ class CookerParser(object):
self.results = self.load_cached()
self.processes = []
if self.toparse:
+ bb.server.process.serverlog("Parsing started")
bb.event.fire(bb.event.ParseStarted(self.toparse), self.cfgdata)
self.parser_quit = multiprocessing.Event()
@@ -2220,6 +2221,8 @@ class CookerParser(object):
return
self.haveshutdown = True
+ bb.server.process.serverlog("Parsing cleaning up")
+
if clean:
event = bb.event.ParseCompleted(self.cached, self.parsed,
self.skipped, self.masked,
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 916ee0a0..01ce916a 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -115,7 +115,8 @@ class ProcessServer():
assert hasattr(function, '__call__')
with bb.utils.lock_timeout(self._idlefuncsLock):
self._idlefuns[function] = data
- serverlog("Registering idle function %s" % str(function))
+ handlers = len(self._idlefuns)
+ serverlog("Registering idle function %s (%s handlers)" % (str(function), str(handlers)))
def run(self):
@@ -401,6 +402,7 @@ class ProcessServer():
del self._idlefuns[function]
self.idle_cond.notify_all()
+ lastdebug = time.time()
while not self.quit:
nextsleep = 0.1
fds = []
@@ -414,7 +416,7 @@ class ProcessServer():
try:
retval = function(self, data, False)
if isinstance(retval, idleFinish):
- serverlog("Removing idle function %s at idleFinish" % str(function))
+ serverlog("Removing idle function %s at idleFinish (%s)" % (str(function), str(retval.msg)))
remove_idle_func(function)
self.cooker.command.finishAsyncCommand(retval.msg)
nextsleep = None
@@ -462,6 +464,12 @@ class ProcessServer():
# the heartbeat.
nextsleep = self.next_heartbeat - now
+ if time.time() > (lastdebug + 60):
+ lastdebug = time.time()
+ with bb.utils.lock_timeout(self._idlefuncsLock):
+ num_funcs = len(self._idlefuns)
+ serverlog("Current command %s, idle functions %s, last exit event %s, state %s" % (self.get_async_cmd(), num_funcs, self.cooker.command.lastEvent, self.cooker.state))
+
if nextsleep is not None:
select.select(fds,[],[],nextsleep)[0]