[oe-commits] [bitbake] 01/01: runqueue: Possible tid handling optimisation
git at git.openembedded.org
git at git.openembedded.org
Sat Feb 15 10:29:22 UTC 2020
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit 44f8fca9539e87675b3df3de66da334902e1480d
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Fri Dec 13 16:16:58 2019 +0000
runqueue: Possible tid handling optimisation
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/runqueue.py | 19 ++++++++++++++++---
1 file changed, 16 insertions(+), 3 deletions(-)
diff --git a/lib/bb/runqueue.py b/lib/bb/runqueue.py
index 71108ee..2e4f8cd 100644
--- a/lib/bb/runqueue.py
+++ b/lib/bb/runqueue.py
@@ -24,12 +24,16 @@ import pickle
from multiprocessing import Process
import shlex
import pprint
+from collections import namedtuple
bblogger = logging.getLogger("BitBake")
logger = logging.getLogger("BitBake.RunQueue")
__find_sha256__ = re.compile( r'(?i)(?<![a-z0-9])[a-f0-9]{64}(?![a-z0-9])' )
+tidcache = {}
+TID = namedtuple('TID', 'mc fn taskname mcfn')
+
def fn_from_tid(tid):
return tid.rsplit(":", 1)[0]
@@ -42,10 +46,17 @@ def mc_from_tid(tid):
return ""
def split_tid(tid):
+ if tid in tidcache:
+ entry = tidcache[tid]
+ return (entry.mc, entry.fn, entry.taskname)
(mc, fn, taskname, _) = split_tid_mcfn(tid)
return (mc, fn, taskname)
def split_tid_mcfn(tid):
+ if tid in tidcache:
+ entry = tidcache[tid]
+ return (entry.mc, entry.fn, entry.taskname, entry.mcfn)
+
if tid.startswith('mc:'):
elems = tid.split(':')
mc = elems[1]
@@ -53,12 +64,14 @@ def split_tid_mcfn(tid):
taskname = elems[-1]
mcfn = "mc:" + mc + ":" + fn
else:
- tid = tid.rsplit(":", 1)
+ tid2 = tid.rsplit(":", 1)
mc = ""
- fn = tid[0]
- taskname = tid[1]
+ fn = tid2[0]
+ taskname = tid2[1]
mcfn = fn
+ tidcache[tid] = TID(mc, fn, taskname, mcfn)
+
return (mc, fn, taskname, mcfn)
def build_tid(mc, fn, taskname):
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list