diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-18 16:21:27 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-18 17:08:08 +0000 |
commit | 848961e6245ffb8a0ace231032b1eac98ef88c33 (patch) | |
tree | 165b916595e4b81c6726d003a50fb8235be8025a /bitbake | |
parent | 52ef6c210c9bdf245b250934a9d697cf7042b816 (diff) | |
download | poky-848961e6245ffb8a0ace231032b1eac98ef88c33.tar.gz |
bitbake: runqueue: Add output for -S option for listing the changepoints compared with an sstate cache
Its useful to understand where the delta starts against an existing sstate cache
for a given target. Adding this to the output of the -S option seems like a
natural fit.
We use the hashvalidate function to figure this out and assume it can find siginfo
files for more than just the setscene tasks.
(Bitbake rev: c18b8450640ebfd55a2b35b112959f9ea3e0a700)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 428cff1c80..b7a602b2e2 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -1039,6 +1039,7 @@ class RunQueue: | |||
1039 | 1039 | ||
1040 | if self.state is runQueueSceneInit: | 1040 | if self.state is runQueueSceneInit: |
1041 | if self.cooker.configuration.dump_signatures: | 1041 | if self.cooker.configuration.dump_signatures: |
1042 | self.print_diffscenetasks() | ||
1042 | self.dump_signatures() | 1043 | self.dump_signatures() |
1043 | else: | 1044 | else: |
1044 | self.start_worker() | 1045 | self.start_worker() |
@@ -1123,6 +1124,82 @@ class RunQueue: | |||
1123 | 1124 | ||
1124 | return | 1125 | return |
1125 | 1126 | ||
1127 | def print_diffscenetasks(self): | ||
1128 | |||
1129 | valid = [] | ||
1130 | sq_hash = [] | ||
1131 | sq_hashfn = [] | ||
1132 | sq_fn = [] | ||
1133 | sq_taskname = [] | ||
1134 | sq_task = [] | ||
1135 | noexec = [] | ||
1136 | stamppresent = [] | ||
1137 | valid_new = set() | ||
1138 | |||
1139 | for task in xrange(len(self.rqdata.runq_fnid)): | ||
1140 | fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]] | ||
1141 | taskname = self.rqdata.runq_task[task] | ||
1142 | taskdep = self.rqdata.dataCache.task_deps[fn] | ||
1143 | |||
1144 | if 'noexec' in taskdep and taskname in taskdep['noexec']: | ||
1145 | noexec.append(task) | ||
1146 | continue | ||
1147 | |||
1148 | sq_fn.append(fn) | ||
1149 | sq_hashfn.append(self.rqdata.dataCache.hashfn[fn]) | ||
1150 | sq_hash.append(self.rqdata.runq_hash[task]) | ||
1151 | sq_taskname.append(taskname) | ||
1152 | sq_task.append(task) | ||
1153 | call = self.hashvalidate + "(sq_fn, sq_task, sq_hash, sq_hashfn, d)" | ||
1154 | locs = { "sq_fn" : sq_fn, "sq_task" : sq_taskname, "sq_hash" : sq_hash, "sq_hashfn" : sq_hashfn, "d" : self.cooker.data } | ||
1155 | valid = bb.utils.better_eval(call, locs) | ||
1156 | for v in valid: | ||
1157 | valid_new.add(sq_task[v]) | ||
1158 | |||
1159 | # Tasks which are both setscene and noexec never care about dependencies | ||
1160 | # We therefore find tasks which are setscene and noexec and mark their | ||
1161 | # unique dependencies as valid. | ||
1162 | for task in noexec: | ||
1163 | if task not in self.rqdata.runq_setscene: | ||
1164 | continue | ||
1165 | for dep in self.rqdata.runq_depends[task]: | ||
1166 | hasnoexecparents = True | ||
1167 | for dep2 in self.rqdata.runq_revdeps[dep]: | ||
1168 | if dep2 in self.rqdata.runq_setscene and dep2 in noexec: | ||
1169 | continue | ||
1170 | hasnoexecparents = False | ||
1171 | break | ||
1172 | if hasnoexecparents: | ||
1173 | valid_new.add(dep) | ||
1174 | |||
1175 | invalidtasks = set() | ||
1176 | for task in xrange(len(self.rqdata.runq_fnid)): | ||
1177 | if task not in valid_new and task not in noexec: | ||
1178 | invalidtasks.add(task) | ||
1179 | |||
1180 | found = set() | ||
1181 | processed = set() | ||
1182 | for task in invalidtasks: | ||
1183 | toprocess = set([task]) | ||
1184 | while toprocess: | ||
1185 | next = set() | ||
1186 | for t in toprocess: | ||
1187 | for dep in self.rqdata.runq_depends[t]: | ||
1188 | if dep in invalidtasks: | ||
1189 | found.add(task) | ||
1190 | if dep not in processed: | ||
1191 | processed.add(dep) | ||
1192 | next.add(dep) | ||
1193 | toprocess = next | ||
1194 | if task in found: | ||
1195 | toprocess = set() | ||
1196 | |||
1197 | tasklist = [] | ||
1198 | for task in invalidtasks.difference(found): | ||
1199 | tasklist.append(self.rqdata.get_user_idstring(task)) | ||
1200 | |||
1201 | if tasklist: | ||
1202 | bb.plain("The differences between the current build and any cached tasks start at the following tasks:\n" + "\n".join(tasklist)) | ||
1126 | 1203 | ||
1127 | class RunQueueExecute: | 1204 | class RunQueueExecute: |
1128 | 1205 | ||