mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
bitbake: data_smart: Improve performance for VariableHistory
Fixed: - BBMULTICONFIG = "qemux86-64 qemuarm64" and more than 70 layers in BBLAYERS $ bitbake -p -P Check profile.log.processed, the record() cost more than 20 seconds, it is less than 1 second when multiconfig is not enabled, and there would be the following error when more muticonfigs are enabled: Timeout while waiting for a reply from the bitbake server Don't change the type of loginfo['detail'] or re-assign it can make record() back to less than 1 second, this won't affect COW since loginfo is a mutable type. The time mainly affected by two factors: 1) The number of enabled layers, nearly 1 second added per layer when the number is larger than 50. 2) The global var such as USER_CLASSES, about 1 ~ 2 seconds added per layer when the layers number is larger than 50. (Bitbake rev: d251668d9a7a8dd25bd8767efb30d6d9ff8b1ad3) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0596aa0d5b0e4ed3db11b5bd560f1d3439963a41) Signed-off-by: Steve Sakoman <steve@sakoman.com>
This commit is contained in:
committed by
Steve Sakoman
parent
a39380d9c9
commit
5bfb7594c4
@@ -272,12 +272,9 @@ class VariableHistory(object):
|
|||||||
return
|
return
|
||||||
if 'op' not in loginfo or not loginfo['op']:
|
if 'op' not in loginfo or not loginfo['op']:
|
||||||
loginfo['op'] = 'set'
|
loginfo['op'] = 'set'
|
||||||
if 'detail' in loginfo:
|
|
||||||
loginfo['detail'] = str(loginfo['detail'])
|
|
||||||
if 'variable' not in loginfo or 'file' not in loginfo:
|
if 'variable' not in loginfo or 'file' not in loginfo:
|
||||||
raise ValueError("record() missing variable or file.")
|
raise ValueError("record() missing variable or file.")
|
||||||
var = loginfo['variable']
|
var = loginfo['variable']
|
||||||
|
|
||||||
if var not in self.variables:
|
if var not in self.variables:
|
||||||
self.variables[var] = []
|
self.variables[var] = []
|
||||||
if not isinstance(self.variables[var], list):
|
if not isinstance(self.variables[var], list):
|
||||||
@@ -336,7 +333,8 @@ class VariableHistory(object):
|
|||||||
flag = '[%s] ' % (event['flag'])
|
flag = '[%s] ' % (event['flag'])
|
||||||
else:
|
else:
|
||||||
flag = ''
|
flag = ''
|
||||||
o.write("# %s %s:%s%s\n# %s\"%s\"\n" % (event['op'], event['file'], event['line'], display_func, flag, re.sub('\n', '\n# ', event['detail'])))
|
o.write("# %s %s:%s%s\n# %s\"%s\"\n" % \
|
||||||
|
(event['op'], event['file'], event['line'], display_func, flag, re.sub('\n', '\n# ', str(event['detail']))))
|
||||||
if len(history) > 1:
|
if len(history) > 1:
|
||||||
o.write("# pre-expansion value:\n")
|
o.write("# pre-expansion value:\n")
|
||||||
o.write('# "%s"\n' % (commentVal))
|
o.write('# "%s"\n' % (commentVal))
|
||||||
@@ -390,7 +388,7 @@ class VariableHistory(object):
|
|||||||
if isset and event['op'] == 'set?':
|
if isset and event['op'] == 'set?':
|
||||||
continue
|
continue
|
||||||
isset = True
|
isset = True
|
||||||
items = d.expand(event['detail']).split()
|
items = d.expand(str(event['detail'])).split()
|
||||||
for item in items:
|
for item in items:
|
||||||
# This is a little crude but is belt-and-braces to avoid us
|
# This is a little crude but is belt-and-braces to avoid us
|
||||||
# having to handle every possible operation type specifically
|
# having to handle every possible operation type specifically
|
||||||
|
|||||||
Reference in New Issue
Block a user