diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-13 10:24:50 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-02 13:32:49 +0100 |
commit | 45c9f45b85df9c73e00dc653a99b49360889cbba (patch) | |
tree | 7549e69e54fa3ed52f978c7890b9205e7c4c96c5 /meta/lib | |
parent | 1cd36a832e2927027635478e9f3aa6e5a0642773 (diff) | |
download | poky-45c9f45b85df9c73e00dc653a99b49360889cbba.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)
(From OE-Core rev: 4c7e12ee42ff6ab228c2d8aa23a8153ff0debd4b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Mark Hatle <mark.hatle@kernel.crashing.org>
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oe/sstatesig.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index b2316b12b8..f1abff0c45 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py | |||
@@ -151,6 +151,13 @@ class SignatureGeneratorOEBasicHashMixIn(object): | |||
151 | 151 | ||
152 | def get_taskhash(self, tid, deps, dataCache): | 152 | def get_taskhash(self, tid, deps, dataCache): |
153 | h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache) | 153 | h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache) |
154 | if tid in self.lockedhashes: | ||
155 | if self.lockedhashes[tid]: | ||
156 | return self.lockedhashes[tid] | ||
157 | else: | ||
158 | return h | ||
159 | |||
160 | h = super(bb.siggen.SignatureGeneratorBasicHash, self).get_taskhash(tid, deps, dataCache) | ||
154 | 161 | ||
155 | (mc, _, task, fn) = bb.runqueue.split_tid_mcfn(tid) | 162 | (mc, _, task, fn) = bb.runqueue.split_tid_mcfn(tid) |
156 | 163 | ||
@@ -187,17 +194,19 @@ class SignatureGeneratorOEBasicHashMixIn(object): | |||
187 | % (recipename, task, h, h_locked, var)) | 194 | % (recipename, task, h, h_locked, var)) |
188 | 195 | ||
189 | return h_locked | 196 | return h_locked |
197 | |||
198 | self.lockedhashes[tid] = False | ||
190 | #bb.warn("%s %s %s" % (recipename, task, h)) | 199 | #bb.warn("%s %s %s" % (recipename, task, h)) |
191 | return h | 200 | return h |
192 | 201 | ||
193 | def get_unihash(self, tid): | 202 | def get_unihash(self, tid): |
194 | if tid in self.lockedhashes: | 203 | if tid in self.lockedhashes and self.lockedhashes[tid]: |
195 | return self.lockedhashes[tid] | 204 | return self.lockedhashes[tid] |
196 | return super().get_unihash(tid) | 205 | return super().get_unihash(tid) |
197 | 206 | ||
198 | def dump_sigtask(self, fn, task, stampbase, runtime): | 207 | def dump_sigtask(self, fn, task, stampbase, runtime): |
199 | tid = fn + ":" + task | 208 | tid = fn + ":" + task |
200 | if tid in self.lockedhashes: | 209 | if tid in self.lockedhashes and self.lockedhashes[tid]: |
201 | return | 210 | return |
202 | super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime) | 211 | super(bb.siggen.SignatureGeneratorBasicHash, self).dump_sigtask(fn, task, stampbase, runtime) |
203 | 212 | ||