Lines Matching refs:tid
35 def fn_from_tid(tid): argument
36 return tid.rsplit(":", 1)[0]
38 def taskname_from_tid(tid): argument
39 return tid.rsplit(":", 1)[1]
41 def mc_from_tid(tid): argument
42 if tid.startswith('mc:') and tid.count(':') >= 2:
43 return tid.split(':')[1]
46 def split_tid(tid): argument
47 (mc, fn, taskname, _) = split_tid_mcfn(tid)
56 def split_tid_mcfn(tid): argument
57 if tid.startswith('mc:') and tid.count(':') >= 2:
58 elems = tid.split(':')
64 tid = tid.rsplit(":", 1)
66 fn = tid[0]
67 taskname = tid[1]
79 def pending_hash_index(tid, rqdata): argument
80 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
82 h = rqdata.runtaskentries[tid].unihash
156 for tid in self.rqdata.runtaskentries:
157 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
158 … self.stamps[tid] = bb.build.stampfile(taskname, self.rqdata.dataCaches[mc], taskfn, noextra=True)
159 if tid in self.rq.runq_buildable:
160 self.buildable.append(tid)
245 tid = buildable.pop()
246 taskname = taskname_from_tid(tid)
249 stamp = self.stamps[tid]
251 return tid
255 for tid in self.rqdata.runtaskentries:
256 self.rev_prio_map[tid] = self.prio_map.index(tid)
260 for tid in buildable:
261 taskname = taskname_from_tid(tid)
264 prio = self.rev_prio_map[tid]
266 stamp = self.stamps[tid]
270 best = tid
313 for tid in self.rqdata.runtaskentries:
314 weight = self.rqdata.runtaskentries[tid].weight
317 weights[weight].append(tid)
464 def get_task_hash(self, tid): argument
465 return self.runtaskentries[tid].hash
467 def get_task_unihash(self, tid): argument
468 return self.runtaskentries[tid].unihash
470 def get_user_idstring(self, tid, task_name_suffix = ""): argument
471 return tid + task_name_suffix
526 def find_chains(tid, prev_chain): argument
527 prev_chain.append(tid)
529 total_deps.extend(self.runtaskentries[tid].revdeps)
530 for revdep in self.runtaskentries[tid].revdeps:
562 explored_deps[tid] = total_deps
586 for tid in self.runtaskentries:
587 task_done[tid] = False
588 weight[tid] = 1
589 deps_left[tid] = len(self.runtaskentries[tid].revdeps)
591 for tid in endpoints:
592 weight[tid] = 10
593 task_done[tid] = True
597 for tid in endpoints:
598 for revdep in self.runtaskentries[tid].depends:
599 weight[revdep] = weight[revdep] + weight[tid]
610 for tid in self.runtaskentries:
611 if task_done[tid] is False or deps_left[tid] != 0:
612 problem_tasks.append(tid)
613 logger.debug2("Task %s is not buildable", tid)
614 …mplete marker was %s and the remaining dependency count was %s)\n", task_done[tid], deps_left[tid])
615 self.runtaskentries[tid].weight = weight[tid]
693 def add_mc_dependencies(mc, tid): argument
704 taskData[mc].taskentries[tid].tdepends.append(newdep)
707 for tid in taskData[mc].taskentries:
709 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
717 self.runtaskentries[tid] = RunTaskEntry()
724 add_mc_dependencies(mc, tid)
729 for t in taskData[mc].taskentries[tid].tdepends:
753 idepends = taskData[mc].taskentries[tid].idepends
763 irdepends = taskData[mc].taskentries[tid].irdepends
783 recursivetasks[tid] = tasknames
787 recursivetasksselfref.add(tid)
790 recursiveitasks[tid] = []
793 recursiveitasks[tid].append(newdep)
795 self.runtaskentries[tid].depends = depends
797 self.runtaskentries[tid].depends.discard(tid)
820 for tid in self.runtaskentries:
821 deps[tid] = set(self.runtaskentries[tid].depends)
822 revdeps[tid] = set()
823 cumulativedeps[tid] = set()
825 for tid in self.runtaskentries:
826 for dep in self.runtaskentries[tid].depends:
827 revdeps[dep].add(tid)
830 for tid in self.runtaskentries:
831 if not deps[tid]:
832 endpoints.add(tid)
836 for tid in endpoints:
837 for dep in revdeps[tid]:
838 cumulativedeps[dep].add(fn_from_tid(tid))
839 cumulativedeps[dep].update(cumulativedeps[tid])
840 if tid in deps[dep]:
841 deps[dep].remove(tid)
854 for tid in recursivetasks:
855 tasknames = recursivetasks[tid]
857 totaldeps = set(self.runtaskentries[tid].depends)
858 if tid in recursiveitasks:
859 totaldeps.update(recursiveitasks[tid])
860 for dep in recursiveitasks[tid]:
873 if newtid == tid:
875 … if newtid in self.runtaskentries and newtid not in self.runtaskentries[tid].depends:
877 self.runtaskentries[tid].depends.add(newtid)
881 for dep in self.runtaskentries[tid].depends.intersection(recursivetasks):
882 … deps.update(self.runtaskentries[dep].depends.difference(self.runtaskentries[tid].depends))
889 self.runtaskentries[tid].depends.add(newtid)
894 for tid in recursivetasksselfref:
895 self.runtaskentries[tid].depends.difference_update(recursivetasksselfref)
909 def mark_active(tid, depth): argument
915 if tid in runq_build:
918 runq_build[tid] = 1
920 depends = self.runtaskentries[tid].depends
924 def invalidate_task(tid, error_nostamp): argument
925 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
956 tid = fn + ":" + task
957 self.target_tids.append(tid)
958 if tid not in taskData[mc].taskentries:
969 …b.msg.fatal("RunQueue", "Task %s does not exist for target %s (%s)%s" % (task, target, tid, extra))
973 for i in self.runtaskentries[tid].depends:
976 mark_active(tid, 1)
988 for tid in list(self.runtaskentries.keys()):
989 if tid not in runq_build:
990 reduced_tasklist.remove(tid)
997 for tid in reduced_tasklist:
998 wanttid = "{0}:{1}".format(fn_from_tid(tid), task)
1002 for tid in list(runall_tids):
1003 mark_active(tid, 1)
1005 invalidate_task(tid, False)
1008 for tid in list(self.runtaskentries.keys()):
1009 if tid not in runq_build:
1010 delcount.add(tid)
1011 del self.runtaskentries[tid]
1029 for tid in runonly_tids:
1030 mark_active(tid, 1)
1032 invalidate_task(tid, False)
1034 for tid in list(self.runtaskentries.keys()):
1035 if tid not in runq_build:
1036 delcount.add(tid)
1037 del self.runtaskentries[tid]
1060 for tid in self.runtaskentries:
1061 for dep in self.runtaskentries[tid].depends:
1062 self.runtaskentries[dep].revdeps.add(tid)
1069 for tid in self.runtaskentries:
1070 revdeps = self.runtaskentries[tid].revdeps
1072 endpoints.append(tid)
1074 if dep in self.runtaskentries[tid].depends:
1075 bb.msg.fatal("RunQueue", "Task %s has circular dependency on %s" % (tid, dep))
1092 for tid in self.runtaskentries:
1093 (tidmc, fn, taskname, taskfn) = split_tid_mcfn(tid)
1127 for tid in self.runtaskentries:
1128 fn = fn_from_tid(tid)
1131 for dep in self.runtaskentries[tid].revdeps:
1191 for tid in self.runtaskentries:
1192 (mc, fn, taskname, _) = split_tid_mcfn(tid)
1193 setscenetid = tid + "_setscene"
1196 self.runq_setscene_tids.add(tid)
1202 for tid in self.target_tids:
1203 invalidate_task(tid, False)
1207 for tid in self.target_tids:
1208 fn = fn_from_tid(tid)
1234 for tid in todeal.copy():
1235 if not (self.runtaskentries[tid].depends - dealtwith):
1236 dealtwith.add(tid)
1237 todeal.remove(tid)
1238 self.prepare_task_hash(tid)
1245 def prepare_task_hash(self, tid): argument
1246 dc = bb.parse.siggen.get_data_caches(self.dataCaches, mc_from_tid(tid))
1247 bb.parse.siggen.prep_taskhash(tid, self.runtaskentries[tid].depends, dc)
1248 …self.runtaskentries[tid].hash = bb.parse.siggen.get_taskhash(tid, self.runtaskentries[tid].depends…
1249 self.runtaskentries[tid].unihash = bb.parse.siggen.get_unihash(tid)
1256 for tid in self.runtaskentries:
1257 logger.debug3(" %s: %s Deps %s RevDeps %s", tid,
1258 self.runtaskentries[tid].weight,
1259 self.runtaskentries[tid].depends,
1260 self.runtaskentries[tid].revdeps)
1389 def check_stamp_task(self, tid, taskname = None, recurse = False, cache = None): argument
1398 (mc, fn, tn, taskfn) = split_tid_mcfn(tid)
1422 for dep in self.rqdata.runtaskentries[tid].depends:
1451 cache[tid] = iscurrent
1461 for tid in tocheck:
1462 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
1463 sq_data['hash'][tid] = self.rqdata.runtaskentries[tid].hash
1464 sq_data['hashfn'][tid] = self.rqdata.dataCaches[mc].hashfn[taskfn]
1465 sq_data['unihash'][tid] = self.rqdata.runtaskentries[tid].unihash
1538 for tid in self.rqdata.runtaskentries:
1539 if not self.rqdata.runtaskentries[tid].depends:
1540 self.rqexe.setbuildable(tid)
1541 self.rqexe.tasks_notcovered.add(tid)
1624 for tid in self.rqdata.runtaskentries:
1625 fn = fn_from_tid(tid)
1653 for tid in self.rqdata.runtaskentries:
1654 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
1658 noexec.append(tid)
1661 tocheck.add(tid)
1668 for tid in noexec:
1669 if tid not in self.rqdata.runq_setscene_tids:
1671 for dep in self.rqdata.runtaskentries[tid].depends:
1682 for tid in self.rqdata.runtaskentries:
1683 if tid not in valid_new and tid not in noexec:
1684 invalidtasks.add(tid)
1688 for tid in invalidtasks:
1689 toprocess = set([tid])
1695 found.add(tid)
1700 if tid in found:
1704 for tid in invalidtasks.difference(found):
1705 tasklist.append(tid)
1729 for tid in invalidtasks:
1730 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
1732 h = self.rqdata.runtaskentries[tid].hash
2041 for tid in self.scenequeue_covered.intersection(self.scenequeue_notcovered):
2043 logger.error("Setscene task %s in both covered and notcovered." % tid)
2045 for tid in self.rqdata.runq_setscene_tids:
2046 if tid not in self.scenequeue_covered and tid not in self.scenequeue_notcovered:
2048 logger.error("Setscene Task %s was never marked as covered or not covered" % tid)
2049 if tid not in self.sq_buildable:
2051 logger.error("Setscene Task %s was never marked as buildable" % tid)
2052 if tid not in self.sq_running:
2054 logger.error("Setscene Task %s was never marked as running" % tid)
2329 for tid in self.scenequeue_notcovered:
2330 notcovered |= self.sqdata.sq_covered_tasks[tid]
2335 for tid in self.scenequeue_covered:
2336 covered |= self.sqdata.sq_covered_tasks[tid]
2340 for tid in notcovered | covered:
2341 if not self.rqdata.runtaskentries[tid].depends:
2342 self.setbuildable(tid)
2343 elif self.rqdata.runtaskentries[tid].depends.issubset(self.runq_complete):
2344 self.setbuildable(tid)
2351 for tid in self.rqdata.runq_setscene_tids:
2352 if tid not in self.scenequeue_covered and tid not in self.scenequeue_notcovered:
2353 self.holdoff_tasks.add(tid)
2355 for tid in self.holdoff_tasks.copy():
2356 for dep in self.sqdata.sq_covered_tasks[tid]:
2366 for tid, unihash in self.updated_taskhash_queue.copy():
2367 if tid in self.runq_running and tid not in self.runq_complete:
2370 self.updated_taskhash_queue.remove((tid, unihash))
2372 if unihash != self.rqdata.runtaskentries[tid].unihash:
2374 torehash = [tid]
2376 if self.sq_deferred[deftid] == tid:
2412 for tid in current:
2413 …if self.rqdata.runtaskentries[p].depends and not self.rqdata.runtaskentries[tid].depends.isdisjoin…
2415 orighash = self.rqdata.runtaskentries[tid].hash
2416 dc = bb.parse.siggen.get_data_caches(self.rqdata.dataCaches, mc_from_tid(tid))
2417 … newhash = bb.parse.siggen.get_taskhash(tid, self.rqdata.runtaskentries[tid].depends, dc)
2418 origuni = self.rqdata.runtaskentries[tid].unihash
2419 newuni = bb.parse.siggen.get_unihash(tid)
2425 elif tid in self.scenequeue_covered or tid in self.sq_live:
2427 … bb.parse.siggen.report_unihash_equiv(tid, newhash, origuni, newuni, self.rqdata.dataCaches)
2428 … hashequiv_logger.verbose("Already covered setscene for %s so ignoring rehash (remap)" % (tid))
2433 self.rqdata.runtaskentries[tid].hash = newhash
2434 self.rqdata.runtaskentries[tid].unihash = newuni
2435 changed.add(tid)
2437 next |= self.rqdata.runtaskentries[tid].revdeps
2438 total.remove(tid)
2449 for tid in changed:
2450 if tid not in self.rqdata.runq_setscene_tids:
2452 if tid not in self.pending_migrations:
2453 self.pending_migrations.add(tid)
2456 for tid in self.pending_migrations.copy():
2457 if tid in self.runq_running or tid in self.sq_live:
2459 self.pending_migrations.remove(tid)
2464 for dep in self.sqdata.sq_covered_tasks[tid]:
2466 …ashequiv_logger.debug2("Task %s is running which blocks setscene for %s from running" % (dep, tid))
2472 self.pending_migrations.remove(tid)
2475 if tid in self.tasks_scenequeue_done:
2476 self.tasks_scenequeue_done.remove(tid)
2477 for dep in self.sqdata.sq_covered_tasks[tid]:
2480 self.failed_tids.append(tid)
2488 if tid in self.sq_buildable:
2489 self.sq_buildable.remove(tid)
2490 if tid in self.sq_running:
2491 self.sq_running.remove(tid)
2492 if tid in self.sqdata.outrightfail:
2493 self.sqdata.outrightfail.remove(tid)
2494 if tid in self.scenequeue_notcovered:
2495 self.scenequeue_notcovered.remove(tid)
2496 if tid in self.scenequeue_covered:
2497 self.scenequeue_covered.remove(tid)
2498 if tid in self.scenequeue_notneeded:
2499 self.scenequeue_notneeded.remove(tid)
2501 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
2502 …self.sqdata.stamps[tid] = bb.build.stampfile(taskname + "_setscene", self.rqdata.dataCaches[mc], t…
2504 if tid in self.stampcache:
2505 del self.stampcache[tid]
2507 if tid in self.build_stamps:
2508 del self.build_stamps[tid]
2510 update_tasks.append(tid)
2513 for tid in update_tasks:
2516 if tid in self.sqdata.sq_harddeps[t] and t in self.scenequeue_notcovered:
2519 …if not harddepfail and self.sqdata.sq_revdeps[tid].issubset(self.scenequeue_covered | self.scenequ…
2520 if tid not in self.sq_buildable:
2521 self.sq_buildable.add(tid)
2522 if not self.sqdata.sq_revdeps[tid]:
2523 self.sq_buildable.add(tid)
2525 update_tasks2.append((tid, harddepfail, tid in self.sqdata.valid))
2530 for tid in sorted([t[0] for t in update_tasks2]):
2531 if mc_from_tid(tid) != mc:
2533 h = pending_hash_index(tid, self.rqdata)
2534 if h in self.sqdata.hashes and tid != self.sqdata.hashes[h]:
2535 self.sq_deferred[tid] = self.sqdata.hashes[h]
2536 bb.note("Deferring %s after %s" % (tid, self.sqdata.hashes[h]))
2539 for (tid, harddepfail, origvalid) in update_tasks2:
2540 if tid in self.sqdata.valid and not origvalid:
2541 hashequiv_logger.verbose("Setscene task %s became valid" % tid)
2543 self.sq_task_failoutright(tid)
2625 def getsetscenedeps(tid): argument
2627 (mc, fn, taskname, _) = split_tid_mcfn(tid)
2628 realtid = tid + "_setscene"
2662 def check_setscene_ignore_tasks(self, tid): argument
2664 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
2666 if tid in self.tasks_covered:
2669 if self.rq.check_stamp_task(tid, taskname, cache=self.stampcache):
2678 if tid in self.rqdata.runq_setscene_tids:
2721 for tid in rqdata.runtaskentries:
2722 sq_revdeps[tid] = copy.copy(rqdata.runtaskentries[tid].revdeps)
2723 sq_revdeps_squash[tid] = set()
2724 if not sq_revdeps[tid] and tid not in rqdata.runq_setscene_tids:
2726 endpoints[tid] = set()
2731 for tid in rqdata.runq_setscene_tids:
2732 sq_collated_deps[tid] = set()
2734 for dep in rqdata.runtaskentries[tid].depends:
2735 if tid in sq_revdeps[dep]:
2736 sq_revdeps[dep].remove(tid)
2740 endpoints[dep].add(tid)
2777 for tid in rqdata.runtaskentries:
2778 if not rqdata.runtaskentries[tid].revdeps:
2779 sqdata.unskippable.add(tid)
2784 for tid in sorted(orig, reverse=True):
2785 if tid in rqdata.runq_setscene_tids:
2787 if not rqdata.runtaskentries[tid].depends:
2789 sqrq.setbuildable(tid)
2790 sqdata.unskippable |= rqdata.runtaskentries[tid].depends
2799 for taskcounter, tid in enumerate(rqdata.runtaskentries):
2800 if tid in rqdata.runq_setscene_tids:
2802 elif sq_revdeps_squash[tid]:
2805 del sq_revdeps_squash[tid]
2813 for tid in rqdata.runq_setscene_tids:
2814 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
2815 realtid = tid + "_setscene"
2817 …sqdata.stamps[tid] = bb.build.stampfile(taskname + "_setscene", rqdata.dataCaches[mc], taskfn, noe…
2832 sqdata.sq_harddeps[deptid].add(tid)
2834 sq_revdeps_squash[tid].add(deptid)
2856 for tid in sqdata.sq_revdeps:
2857 sqdata.sq_deps[tid] = set()
2858 for tid in sqdata.sq_revdeps:
2859 for dep in sqdata.sq_revdeps[tid]:
2860 sqdata.sq_deps[dep].add(tid)
2865 for tid in sqdata.sq_revdeps:
2866 sqdata.multiconfigs.add(mc_from_tid(tid))
2867 if not sqdata.sq_revdeps[tid]:
2868 sqrq.sq_buildable.add(tid)
2879 for tid in sorted(sqdata.sq_revdeps):
2880 if mc_from_tid(tid) != mc:
2882 h = pending_hash_index(tid, rqdata)
2884 sqdata.hashes[h] = tid
2886 sqrq.sq_deferred[tid] = sqdata.hashes[h]
2887 bb.note("Deferring %s after %s" % (tid, sqdata.hashes[h]))
2894 for tid in rqdata.runq_setscene_tids:
2895 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
2900 found[mc][tid] = stamps
2905 def check_setscene_stamps(tid, rqdata, rq, stampcache, noexecstamp=False): argument
2907 (mc, fn, taskname, taskfn) = split_tid_mcfn(tid)
2915 if rq.check_stamp_task(tid, taskname + "_setscene", cache=stampcache):
2916 logger.debug2('Setscene stamp current for task %s', tid)
2919 if rq.check_stamp_task(tid, taskname, recurse = True, cache=stampcache):
2920 logger.debug2('Normal stamp current for task %s', tid)
2929 for tid in sorted(tids):
2930 if tid in sqdata.stamppresent:
2931 sqdata.stamppresent.remove(tid)
2932 if tid in sqdata.valid:
2933 sqdata.valid.remove(tid)
2934 if tid in sqdata.outrightfail:
2935 sqdata.outrightfail.remove(tid)
2937 noexec, stamppresent = check_setscene_stamps(tid, rqdata, rq, stampcache, noexecstamp=True)
2940 sqdata.noexec.add(tid)
2941 sqrq.sq_task_skip(tid)
2945 sqdata.stamppresent.add(tid)
2946 sqrq.sq_task_skip(tid)
2949 tocheck.add(tid)
2953 for tid in tids:
2954 if tid in sqdata.stamppresent:
2956 if tid in sqdata.valid:
2958 if tid in sqdata.noexec:
2960 if tid in sqrq.scenequeue_covered:
2962 if tid in sqrq.scenequeue_notcovered:
2964 if tid in sqrq.sq_deferred:
2966 sqdata.outrightfail.add(tid)