summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-14 12:51:24 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-12-15 09:10:46 +0000
commit58726c4a560df2407aa307f20e0d6e6e2a547b31 (patch)
tree0def147f623b8314e42664c8ec72cd9cccc1897b
parent6d738f4a6eb0cfc604d24657277a9b280604915b (diff)
downloadpoky-58726c4a560df2407aa307f20e0d6e6e2a547b31.tar.gz
sstatesig: Optimise get_taskhash for hashequiv
With hashequiv the get_taskhash function is called much more regularly and contains expensive operations. This these don't change based upon hash in a given build, improve the caching within the function to reduce overhead. (From OE-Core rev: de98cfe3cde4b8d5f4b163b5fba3f129651ef06a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/sstatesig.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index c566ce5a0c..8d009bfdc6 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -142,6 +142,13 @@ class SignatureGeneratorOEBasicHashMixIn(object):
142 142
143 def get_taskhash(self, tid, deps, dataCache): 143 def get_taskhash(self, tid, deps, dataCache):
144 h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache) 144 h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache)
145 if tid in self.lockedhashes:
146 if self.lockedhashes[tid]:
147 return self.lockedhashes[tid]
148 else:
149 return h
150
151 h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache)
145 152
146 (mc, _, task, fn) = bb.runqueue.split_tid_mcfn(tid) 153 (mc, _, task, fn) = bb.runqueue.split_tid_mcfn(tid)
147 154
@@ -178,17 +185,19 @@ class SignatureGeneratorOEBasicHashMixIn(object):
178 % (recipename, task, h, h_locked, var)) 185 % (recipename, task, h, h_locked, var))
179 186
180 return h_locked 187 return h_locked
188
189 self.lockedhashes[tid] = False
181 #bb.warn("%s %s %s" % (recipename, task, h)) 190 #bb.warn("%s %s %s" % (recipename, task, h))
182 return h 191 return h
183 192
184 def get_unihash(self, tid): 193 def get_unihash(self, tid):
185 if tid in self.lockedhashes: 194 if tid in self.lockedhashes and self.lockedhashes[tid]:
186 return self.lockedhashes[tid] 195 return self.lockedhashes[tid]
187 return super().get_unihash(tid) 196 return super().get_unihash(tid)
188 197
189 def dump_sigtask(self, fn, task, stampbase, runtime): 198 def dump_sigtask(self, fn, task, stampbase, runtime):
190 tid = fn + ":" + task 199 tid = fn + ":" + task
191 if tid in self.lockedhashes: 200 if tid in self.lockedhashes and self.lockedhashes[tid]:
192 return 201 return
193 super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime) 202 super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime)
194 203