summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-27 11:04:06 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-06-28 16:32:57 +0100
commitedfb2ba32c5075e2df338a549021c634659f3225 (patch)
treed70d1d5e36362ae3c14ca7e05f86df11e67b5a73 /bitbake
parentd498bd6bf34c6dd65e24ec32d425742f42152cae (diff)
downloadpoky-edfb2ba32c5075e2df338a549021c634659f3225.tar.gz
poky-edfb2ba32c5075e2df338a549021c634659f3225.tar.bz2
poky-edfb2ba32c5075e2df338a549021c634659f3225.zip
bitbake: taskdata: Add gettask_id_fromfnid helper function
This is like gettask_id but doesn't require translation of fnid -> fn first which the function then translates back. This gives a sizeable performance improvement since a significant number of lookups are avoided. (Bitbake rev: 3190cb83e2af195a464f669c5aa8aedbf795160e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/runqueue.py12
-rw-r--r--bitbake/lib/bb/taskdata.py10
2 files changed, 14 insertions, 8 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
index 03766adfea..e09e8c8080 100644
--- a/bitbake/lib/bb/runqueue.py
+++ b/bitbake/lib/bb/runqueue.py
@@ -406,9 +406,8 @@ class RunQueueData:
depdata = taskData.build_targets[depid][0]
if depdata is None:
continue
- dep = taskData.fn_index[depdata]
for taskname in tasknames:
- taskid = taskData.gettask_id(dep, taskname, False)
+ taskid = taskData.gettask_id_fromfnid(depdata, taskname)
if taskid is not None:
depends.append(taskid)
@@ -419,9 +418,8 @@ class RunQueueData:
depdata = taskData.run_targets[depid][0]
if depdata is None:
continue
- dep = taskData.fn_index[depdata]
for taskname in tasknames:
- taskid = taskData.gettask_id(dep, taskname, False)
+ taskid = taskData.gettask_id_fromfnid(depdata, taskname)
if taskid is not None:
depends.append(taskid)
@@ -469,8 +467,7 @@ class RunQueueData:
# Won't be in build_targets if ASSUME_PROVIDED
depdata = taskData.build_targets[depid][0]
if depdata is not None:
- dep = taskData.fn_index[depdata]
- taskid = taskData.gettask_id(dep, idependtask, False)
+ taskid = taskData.gettask_id_fromfnid(depdata, idependtask)
if taskid is None:
bb.msg.fatal("RunQueue", "Task %s in %s depends upon non-existent task %s in %s" % (taskData.tasks_name[task], fn, idependtask, dep))
depends.append(taskid)
@@ -482,8 +479,7 @@ class RunQueueData:
# Won't be in run_targets if ASSUME_PROVIDED
depdata = taskData.run_targets[depid][0]
if depdata is not None:
- dep = taskData.fn_index[depdata]
- taskid = taskData.gettask_id(dep, idependtask, False)
+ taskid = taskData.gettask_id_fromfnid(depdata, idependtask)
if taskid is None:
bb.msg.fatal("RunQueue", "Task %s in %s rdepends upon non-existent task %s in %s" % (taskData.tasks_name[task], fn, idependtask, dep))
depends.append(taskid)
diff --git a/bitbake/lib/bb/taskdata.py b/bitbake/lib/bb/taskdata.py
index 8bc447c11c..55cdde553b 100644
--- a/bitbake/lib/bb/taskdata.py
+++ b/bitbake/lib/bb/taskdata.py
@@ -116,6 +116,16 @@ class TaskData:
ids.append(self.tasks_lookup[fnid][task])
return ids
+ def gettask_id_fromfnid(self, fnid, task):
+ """
+ Return an ID number for the task matching fnid and task.
+ """
+ if fnid in self.tasks_lookup:
+ if task in self.tasks_lookup[fnid]:
+ return self.tasks_lookup[fnid][task]
+
+ return None
+
def gettask_id(self, fn, task, create = True):
"""
Return an ID number for the task matching fn and task.