summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-03-19 17:39:25 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-25 11:17:34 +0000
commit1d20fc44ea74696a85bd86e42a1f1a11f474fb55 (patch)
tree5f16e8c235ba8a84627b7e60b248b207d169ff3b /bitbake/lib/bb
parenta6c3cb705d1a86e9959c6953735057077b4a92c7 (diff)
downloadpoky-1d20fc44ea74696a85bd86e42a1f1a11f474fb55.tar.gz
bitbake: 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. (Bitbake rev: e855031410daf2b99a6ca40b70956fe67c96f71c) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r--bitbake/lib/bb/ui/buildinfohelper.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py
index 30c9b92395..71b2ff508a 100644
--- a/bitbake/lib/bb/ui/buildinfohelper.py
+++ b/bitbake/lib/bb/ui/buildinfohelper.py
@@ -678,20 +678,18 @@ class BuildInfoHelper(object):
678 678
679 679
680 def store_tasks_stats(self, event): 680 def store_tasks_stats(self, event):
681 for (taskfile, taskname, taskstats) in event.data: 681 for (taskfile, taskname, taskstats, recipename) in event.data:
682 localfilepath = taskfile.split(":")[-1] 682 localfilepath = taskfile.split(":")[-1]
683 assert localfilepath.startswith("/") 683 assert localfilepath.startswith("/")
684 684
685 recipe_information = self._get_recipe_information_from_taskfile(taskfile) 685 recipe_information = self._get_recipe_information_from_taskfile(taskfile)
686 try: 686 recipe_object = Recipe.objects.get(layer_version = recipe_information['layer_version'],
687 recipe = self.orm_wrapper.get_update_recipe_object(recipe_information, True) 687 file_path__endswith = recipe_information['file_path'],
688 except NotExisting: 688 name = recipename)
689 recipe = Recipe.objects.get(layer_version = recipe_information['layer_version'],
690 file_path__endswith = recipe_information['file_path'])
691 689
692 task_information = {} 690 task_information = {}
693 task_information['build'] = self.internal_state['build'] 691 task_information['build'] = self.internal_state['build']
694 task_information['recipe'] = recipe 692 task_information['recipe'] = recipe_object
695 task_information['task_name'] = taskname 693 task_information['task_name'] = taskname
696 task_information['cpu_usage'] = taskstats['cpu_usage'] 694 task_information['cpu_usage'] = taskstats['cpu_usage']
697 task_information['disk_io'] = taskstats['disk_io'] 695 task_information['disk_io'] = taskstats['disk_io']
@@ -756,11 +754,15 @@ class BuildInfoHelper(object):
756 # for all image targets 754 # for all image targets
757 for target in self.internal_state['targets']: 755 for target in self.internal_state['targets']:
758 if target.is_image: 756 if target.is_image:
759 pkgdata = event.data['pkgdata'] 757 try:
760 imgdata = event.data['imgdata'][target.target] 758 pkgdata = event.data['pkgdata']
761 self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes']) 759 imgdata = event.data['imgdata'][target.target]
762 filedata = event.data['filedata'][target.target] 760 self.orm_wrapper.save_target_package_information(self.internal_state['build'], target, imgdata, pkgdata, self.internal_state['recipes'])
763 self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata) 761 filedata = event.data['filedata'][target.target]
762 self.orm_wrapper.save_target_file_information(self.internal_state['build'], target, filedata)
763 except KeyError:
764 # we must have not got the data for this image, nothing to save
765 pass
764 766
765 767
766 768