mirror of
https://git.yoctoproject.org/git/poky
synced 2026-01-01 13:58:04 +00:00
bitbake: knotty, uihelper: Remove running_pids and lastpids
* lastpids has not been used for almost 10 years. * There is no longer any need to use running_pids to keep track of the order the pids in running_tasks were added as dicts are guaranteed to remember the insertion order since Python 3.7. (Bitbake rev: 562b5bf0be2883144391e7030a9dce6a233802ac) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
b203f9146e
commit
4a1f38dd8d
|
|
@ -169,7 +169,6 @@ class TerminalFilter(object):
|
|||
self.stdinbackup = None
|
||||
self.interactive = sys.stdout.isatty()
|
||||
self.footer_present = False
|
||||
self.lastpids = []
|
||||
self.lasttime = time.time()
|
||||
self.quiet = quiet
|
||||
|
||||
|
|
@ -254,7 +253,6 @@ class TerminalFilter(object):
|
|||
return
|
||||
activetasks = self.helper.running_tasks
|
||||
failedtasks = self.helper.failed_tasks
|
||||
runningpids = self.helper.running_pids
|
||||
currenttime = time.time()
|
||||
deltatime = currenttime - self.lasttime
|
||||
|
||||
|
|
@ -283,7 +281,7 @@ class TerminalFilter(object):
|
|||
self._footer_buf.seek(0)
|
||||
|
||||
tasks = []
|
||||
for t in runningpids:
|
||||
for t in activetasks.keys():
|
||||
start_time = activetasks[t].get("starttime", None)
|
||||
if start_time:
|
||||
msg = "%s - %s (pid %s)" % (activetasks[t]["title"], self.elapsed(currenttime - start_time), activetasks[t]["pid"])
|
||||
|
|
@ -358,7 +356,6 @@ class TerminalFilter(object):
|
|||
content = "%s: %s" % (tasknum, task)
|
||||
print(content, file=self._footer_buf)
|
||||
lines = lines + self.getlines(content)
|
||||
self.lastpids = runningpids[:]
|
||||
self.lastcount = self.helper.tasknumber_current
|
||||
|
||||
# Clear footer and Print buffer.
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ class BBUIHelper:
|
|||
self.needUpdate = False
|
||||
self.running_tasks = {}
|
||||
# Running PIDs preserves the order tasks were executed in
|
||||
self.running_pids = []
|
||||
self.failed_tasks = []
|
||||
self.pidmap = {}
|
||||
self.tasknumber_current = 0
|
||||
|
|
@ -23,7 +22,6 @@ class BBUIHelper:
|
|||
# PIDs are a bad idea as they can be reused before we process all UI events.
|
||||
# We maintain a 'fuzzy' match for TaskProgress since there is no other way to match
|
||||
def removetid(pid, tid):
|
||||
self.running_pids.remove(tid)
|
||||
del self.running_tasks[tid]
|
||||
if self.pidmap[pid] == tid:
|
||||
del self.pidmap[pid]
|
||||
|
|
@ -35,7 +33,6 @@ class BBUIHelper:
|
|||
self.running_tasks[tid] = { 'title' : "mc:%s:%s %s" % (event._mc, event._package, event._task), 'starttime' : time.time(), 'pid' : event.pid }
|
||||
else:
|
||||
self.running_tasks[tid] = { 'title' : "%s %s" % (event._package, event._task), 'starttime' : time.time(), 'pid' : event.pid }
|
||||
self.running_pids.append(tid)
|
||||
self.pidmap[event.pid] = tid
|
||||
self.needUpdate = True
|
||||
elif isinstance(event, bb.build.TaskSucceeded):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user