Patchwork [1/1] toaster.bbclass: update buildstats event data

login
register
mail settings
Submitter Alexandru DAMIAN
Date March 24, 2014, 6:28 p.m.
Message ID <1395685702-30537-1-git-send-email-alexandru.damian@intel.com>
Download mbox | patch
Permalink /patch/69077/
State New
Headers show

Comments

Alexandru DAMIAN - March 24, 2014, 6:28 p.m.
From: Alexandru DAMIAN <alexandru.damian@intel.com>

We add the PN to the buildstats event data in order to
proper select database task when multiple similar tasks
are executed for the same recipe file.

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>

Patch

diff --git a/meta/classes/toaster.bbclass b/meta/classes/toaster.bbclass
index 563b1f7..f55a4d7 100644
--- a/meta/classes/toaster.bbclass
+++ b/meta/classes/toaster.bbclass
@@ -179,7 +179,7 @@  python toaster_collect_task_stats() {
             bn = get_bn(e)
             bsdir = os.path.join(e.data.getVar('BUILDSTATS_BASE', True), bn)
             taskdir = os.path.join(bsdir, e.data.expand("${PF}"))
-            fout.write("%s:%s:%s\n" % (e.taskfile, e.taskname, os.path.join(taskdir, e.task)))
+            fout.write("%s:%s:%s:%s\n" % (e.taskfile, e.taskname, os.path.join(taskdir, e.task), e.data.expand("${PN}")))
 
         bb.utils.unlockfile(lock)
 
@@ -222,8 +222,8 @@  python toaster_collect_task_stats() {
         events = []
         with open(os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist"), "r") as fin:
             for line in fin:
-                (taskfile, taskname, filename) = line.strip().split(":")
-                events.append((taskfile, taskname, _read_stats(filename)))
+                (taskfile, taskname, filename, recipename) = line.strip().split(":")
+                events.append((taskfile, taskname, _read_stats(filename), recipename))
         bb.event.fire(bb.event.MetadataEvent("BuildStatsList", events), e.data)
         os.unlink(os.path.join(e.data.getVar('BUILDSTATS_BASE', True), "toasterstatlist"))
 }