diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-01 11:25:32 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-01 18:02:12 +0000 |
commit | 758f18167f2ed50576265a0bab7ec529c69656fa (patch) | |
tree | 792419f4d330faca2cf67c65a4297f2066b55b70 /meta/classes/sstate.bbclass | |
parent | ec3d83f9a90288403b96be25da855fa280aadd8d (diff) | |
download | poky-758f18167f2ed50576265a0bab7ec529c69656fa.tar.gz |
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.
(From OE-Core rev: 3b0af8dc0f796345d1f1ba77ea35bbd090a5feb3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r-- | meta/classes/sstate.bbclass | 14 |
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): | |||
909 | 909 | ||
910 | BB_SETSCENE_DEPVALID = "setscene_depvalid" | 910 | BB_SETSCENE_DEPVALID = "setscene_depvalid" |
911 | 911 | ||
912 | def setscene_depvalid(task, taskdependees, notneeded, d): | 912 | def setscene_depvalid(task, taskdependees, notneeded, d, log=None): |
913 | # taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME] | 913 | # taskdependees is a dict of tasks which depend on task, each being a 3 item list of [PN, TASKNAME, FILENAME] |
914 | # task is included in taskdependees too | 914 | # task is included in taskdependees too |
915 | # Return - False - We need this dependency | 915 | # Return - False - We need this dependency |
916 | # - True - We can skip this dependency | 916 | # - True - We can skip this dependency |
917 | 917 | ||
918 | bb.debug(2, "Considering setscene task: %s" % (str(taskdependees[task]))) | 918 | def logit(msg, log): |
919 | if log is not None: | ||
920 | log.append(msg) | ||
921 | else: | ||
922 | bb.debug(2, msg) | ||
923 | |||
924 | logit("Considering setscene task: %s" % (str(taskdependees[task])), log) | ||
919 | 925 | ||
920 | def isNativeCross(x): | 926 | def isNativeCross(x): |
921 | return x.endswith("-native") or "-cross-" in x or "-crosssdk" in x or x.endswith("-cross") | 927 | 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): | |||
933 | return True | 939 | return True |
934 | 940 | ||
935 | for dep in taskdependees: | 941 | for dep in taskdependees: |
936 | bb.debug(2, " considering dependency: %s" % (str(taskdependees[dep]))) | 942 | logit(" considering dependency: %s" % (str(taskdependees[dep])), log) |
937 | if task == dep: | 943 | if task == dep: |
938 | continue | 944 | continue |
939 | if dep in notneeded: | 945 | if dep in notneeded: |
@@ -987,7 +993,7 @@ def setscene_depvalid(task, taskdependees, notneeded, d): | |||
987 | 993 | ||
988 | 994 | ||
989 | # Safe fallthrough default | 995 | # Safe fallthrough default |
990 | bb.debug(2, " Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep]))) | 996 | logit(" Default setscene dependency fall through due to dependency: %s" % (str(taskdependees[dep])), log) |
991 | return False | 997 | return False |
992 | return True | 998 | return True |
993 | 999 | ||