summaryrefslogtreecommitdiff
path: root/meta/classes/sstate.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-01 11:25:32 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-01 18:02:07 +0000
commit3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3 (patch)
tree084c54d7e5a503d074a77bcca7408f2836fbe752 /meta/classes/sstate.bbclass
parent1a1e70304932cce5ad194e0a7ebb495da7b24c2e (diff)
downloadopenembedded-core-3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3.tar.gz
openembedded-core-3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3.tar.bz2
openembedded-core-3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3.zip
sstate/staging: Batch log messages for performance
According to profile data, repeated calls to bb.debug and bb.note in the extend_recipe_sysroot() codepath were accounting for 75% of the time (1.5s) in calls from tasks like do_image_complete. This batches up the log messages into one call into the logging system which gives similar behaviour to disabling the logging but retains the debug information. Since setscene_depvalid is also called from bitbake's setscene code, we have to be a little creative with the function parameters and leave the other debug output mechanism in place. This should hopefully speed up recipe specific sysroots. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r--meta/classes/sstate.bbclass14
1 files changed, 10 insertions, 4 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index aeb7466d35..ada6fe5986 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -909,13 +909,19 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
BB_SETSCENE_DEPVALID = "setscene_depvalid"
-def setscene_depvalid(task, taskdependees, notneeded, d):
+def setscene_depvalid(task, taskdependees, notneeded, d, log=None):
# taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME]
# task is included in taskdependees too
# Return - False - We need this dependency
# - True - We can skip this dependency
- bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task])))
+ def logit(msg, log):
+ if log is not None:
+ log.append(msg)
+ else:
+ bb.debug(2, msg)
+
+ logit("Considering setscene task: %s" % (str(taskdependees[task])), log)
def isNativeCross(x):
return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x or x.endswith("-cross")
@@ -933,7 +939,7 @@ def setscene_depvalid(task, taskdependees, notneeded, d):
return True
for dep in taskdependees:
- bb.debug(2, " considering dependency: %s" % (str(taskdependees[dep])))
+ logit(" considering dependency: %s" % (str(taskdependees[dep])), log)
if task == dep:
continue
if dep in notneeded:
@@ -987,7 +993,7 @@ def setscene_depvalid(task, taskdependees, notneeded, d):
# Safe fallthrough default
- bb.debug(2, " Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])))
+ logit(" Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])), log)
return False
return True