diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/ui/buildinfohelper.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index 2084aab96c..08d9fcf8b3 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/lib/bb/ui/buildinfohelper.py | |||
@@ -134,8 +134,8 @@ class ORMWrapper(object): | |||
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 and a current time | 136 | # mark down duration if we have a start time and a current time |
137 | if 'start_time' in task_information.keys() and 'time' in vars(event): | 137 | if 'start_time' in task_information.keys() and 'end_time' in task_information.keys(): |
138 | duration = event.time - task_information['start_time'] | 138 | duration = task_information['end_time'] - task_information['start_time'] |
139 | task_object.elapsed_time = duration | 139 | task_object.elapsed_time = duration |
140 | 140 | ||
141 | task_object.save() | 141 | task_object.save() |
@@ -672,7 +672,6 @@ class BuildInfoHelper(object): | |||
672 | task_obj = self.orm_wrapper.get_update_task_object(task_information) | 672 | task_obj = self.orm_wrapper.get_update_task_object(task_information) |
673 | 673 | ||
674 | self.internal_state['taskdata'][identifier] = { | 674 | self.internal_state['taskdata'][identifier] = { |
675 | 'start_time': datetime.datetime.now(), | ||
676 | 'outcome': task_information['outcome'], | 675 | 'outcome': task_information['outcome'], |
677 | } | 676 | } |
678 | 677 | ||
@@ -717,10 +716,13 @@ class BuildInfoHelper(object): | |||
717 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True) | 716 | recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True) |
718 | task_information = self._get_task_information(event,recipe) | 717 | task_information = self._get_task_information(event,recipe) |
719 | 718 | ||
720 | if 'time' in vars(event) and isinstance(event, bb.build.TaskStarted): | 719 | if 'time' in vars(event): |
721 | self.internal_state['taskdata'][identifier]['start_time'] = event.time | 720 | if not 'start_time' in self.internal_state['taskdata'][identifier]: |
721 | self.internal_state['taskdata'][identifier]['start_time'] = event.time | ||
722 | else: | ||
723 | task_information['end_time'] = event.time | ||
724 | task_information['start_time'] = self.internal_state['taskdata'][identifier]['start_time'] | ||
722 | 725 | ||
723 | task_information['start_time'] = self.internal_state['taskdata'][identifier]['start_time'] | ||
724 | task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome'] | 726 | task_information['outcome'] = self.internal_state['taskdata'][identifier]['outcome'] |
725 | 727 | ||
726 | if 'logfile' in vars(event): | 728 | if 'logfile' in vars(event): |