aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-03-19 17:39:25 +0000
committerAlexandru DAMIAN <alexandru.damian@intel.com>2014-03-24 18:32:19 +0000
commite855031410daf2b99a6ca40b70956fe67c96f71c (patch)
treeda2d63105f3297ab1b86d03a67273500a2fd55aa /lib
parent77e6cc952e73dec4a6e5149e52f87000709d2152 (diff)
downloadbitbake-e855031410daf2b99a6ca40b70956fe67c96f71c.tar.gz
toaster: select recipe based on PN name
When saving task stats, if there were multiple tasks executed based on the same recipe file, we might have saved the stats to the wrong task by selecting another recipe. This patch takes the PN into account to properly select the file stats. A check is also made to make sure we don't fail saving data due to interrupted builds. Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/bb/ui/buildinfohelper.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index 30c9b9239..71b2ff508 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -678,20 +678,18 @@ class BuildInfoHelper(object):
def store_tasks_stats(self, event):
- for (taskfile, taskname, taskstats) in event.data:
+ for (taskfile, taskname, taskstats, recipename) in event.data:
localfilepath = taskfile.split(":")[-1]
assert localfilepath.startswith("/")
recipe_information = self._get_recipe_information_from_taskfile(taskfile)
- try:
- recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True)
- except NotExisting:
- recipe = Recipe.objects.get(layer_version = recipe_information['layer_version'],
- file_path__endswith = recipe_information['file_path'])
+ recipe_object = Recipe.objects.get(layer_version = recipe_information['layer_version'],
+ file_path__endswith = recipe_information['file_path'],
+ name = recipename)
task_information = {}
task_information['build'] = self.internal_state['build']
- task_information['recipe'] = recipe
+ task_information['recipe'] = recipe_object
task_information['task_name'] = taskname
task_information['cpu_usage'] = taskstats['cpu_usage']
task_information['disk_io'] = taskstats['disk_io']
@@ -756,11 +754,15 @@ class BuildInfoHelper(object):
# for all image targets
for target in self.internal_state['targets']:
if target.is_image:
- pkgdata = event.data['pkgdata']
- imgdata = event.data['imgdata'][target.target]
- self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes'])
- filedata = event.data['filedata'][target.target]
- self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
+ try:
+ pkgdata = event.data['pkgdata']
+ imgdata = event.data['imgdata'][target.target]
+ self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes'])
+ filedata = event.data['filedata'][target.target]
+ self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
+ except KeyError:
+ # we must have not got the data for this image, nothing to save
+ pass