summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/ui/buildinfohelper.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/ui/buildinfohelper.py')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 15bc069b8f..2084aab96c 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -133,10 +133,10 @@ class ORMWrapper(object):
133 elif outcome_task_setscene == Task.OUTCOME_FAILED: 133 elif outcome_task_setscene == Task.OUTCOME_FAILED:
134 task_object.sstate_result = Task.SSTATE_FAILED 134 task_object.sstate_result = Task.SSTATE_FAILED
135 135
136 # mark down duration if we have a start time 136 # mark down duration if we have a start time and a current time
137 if 'start_time' in task_information.keys(): 137 if 'start_time' in task_information.keys() and 'time' in vars(event):
138 duration = datetime.datetime.now() - task_information['start_time'] 138 duration = event.time - task_information['start_time']
139 task_object.elapsed_time = duration.total_seconds() 139 task_object.elapsed_time = duration
140 140
141 task_object.save() 141 task_object.save()
142 return task_object 142 return task_object
@@ -717,6 +717,9 @@ class BuildInfoHelper(object):
717 recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True) 717 recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True)
718 task_information = self._get_task_information(event,recipe) 718 task_information = self._get_task_information(event,recipe)
719 719
720 if 'time' in vars(event) and isinstance(event, bb.build.TaskStarted):
721 self.internal_state['taskdata'][identifier]['start_time'] = event.time
722
720 task_information['start_time'] = self.internal_state['taskdata'][identifier]['start_time'] 723 task_information['start_time'] = self.internal_state['taskdata'][identifier]['start_time']
721 task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome'] 724 task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome']
722 725