All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ed Bartosh <ed.bartosh@linux.intel.com>
To: toaster@yoctoproject.org
Subject: [PATCH 2/6] event: add new parameter to Build* event APIs
Date: Tue, 29 Sep 2015 10:55:29 +0300	[thread overview]
Message-ID: <2816c40e7f06e5f12f534e40e6ff1eb55001580a.1443513126.git.ed.bartosh@linux.intel.com> (raw)
In-Reply-To: <cover.1443513126.git.ed.bartosh@linux.intel.com>
In-Reply-To: <cover.1443513126.git.ed.bartosh@linux.intel.com>

Added 't'(task) parameter to BuildStarted and BuildCompleted
event APIs. Modified existing calls of above mentioned APIs:
passed bitbake task name as a parameter.

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
---
 bitbake/lib/bb/cooker.py |  8 ++++----
 bitbake/lib/bb/event.py  | 12 ++++++------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index a0d7d59..ef81c3a 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1313,7 +1313,7 @@ class BBCooker:
         taskdata.add_provider(self.data, self.recipecache, item)
 
         buildname = self.data.getVar("BUILDNAME", True)
-        bb.event.fire(bb.event.BuildStarted(buildname, [item]), self.expanded_data)
+        bb.event.fire(bb.event.BuildStarted(buildname, [item], task), self.expanded_data)
 
         # Execute the runqueue
         if not task.startswith("do_"):
@@ -1345,7 +1345,7 @@ class BBCooker:
                 return False
 
             if not retval:
-                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, failures, interrupted), self.expanded_data)
+                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, item, task, failures, interrupted), self.expanded_data)
                 self.command.finishAsyncCommand(msg)
                 return False
             if retval is True:
@@ -1381,7 +1381,7 @@ class BBCooker:
                 return False
 
             if not retval:
-                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, failures, interrupted), self.data)
+                bb.event.fire(bb.event.BuildCompleted(len(rq.rqdata.runq_fnid), buildname, targets, task, failures, interrupted), self.data)
                 self.command.finishAsyncCommand(msg)
                 return False
             if retval is True:
@@ -1394,7 +1394,7 @@ class BBCooker:
         taskdata, runlist, fulltargetlist = self.buildTaskData(targets, task, self.configuration.abort)
 
         buildname = self.data.getVar("BUILDNAME", False)
-        bb.event.fire(bb.event.BuildStarted(buildname, fulltargetlist), self.data)
+        bb.event.fire(bb.event.BuildStarted(buildname, fulltargetlist, task), self.data)
 
         rq = bb.runqueue.RunQueue(self, self.data, self.recipecache, taskdata, runlist)
         if 'universe' in targets:
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 68496e5..bf67ee9 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -328,10 +328,10 @@ class StampUpdate(Event):
 class BuildBase(Event):
     """Base class for bbmake run events"""
 
-    def __init__(self, n, p, failures = 0):
+    def __init__(self, n, p, t, failures = 0):
         self._name = n
         self._pkgs = p
-        self._task = None
+        self._task = t
         Event.__init__(self)
         self._failures = failures
 
@@ -376,19 +376,19 @@ class BuildBase(Event):
 
 class BuildStarted(BuildBase, OperationStarted):
     """bbmake build run started"""
-    def __init__(self, n, p, failures = 0):
+    def __init__(self, n, p, t, failures = 0):
         OperationStarted.__init__(self, "Building Started")
-        BuildBase.__init__(self, n, p, failures)
+        BuildBase.__init__(self, n, p, t, failures)
 
 class BuildCompleted(BuildBase, OperationCompleted):
     """bbmake build run completed"""
-    def __init__(self, total, n, p, failures=0, interrupted=0):
+    def __init__(self, total, n, p, t, failures=0, interrupted=0):
         if not failures:
             OperationCompleted.__init__(self, total, "Building Succeeded")
         else:
             OperationCompleted.__init__(self, total, "Building Failed")
         self._interrupted = interrupted
-        BuildBase.__init__(self, n, p, failures)
+        BuildBase.__init__(self, n, p, t, failures)
 
 class DiskFull(Event):
     """Disk full case build aborted"""
-- 
2.1.4



  parent reply	other threads:[~2015-09-29  7:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29  7:55 [PATCH v3 0/6] Fixes for toastergui Ed Bartosh
2015-09-29  7:55 ` [PATCH 1/6] event: add new property to BuildBase class Ed Bartosh
2015-09-29  7:55 ` Ed Bartosh [this message]
2015-09-29  7:55 ` [PATCH 3/6] toaster: add task to the target_information Ed Bartosh
2015-09-29  7:55 ` [PATCH 4/6] toaster: add get_or_create_targets API Ed Bartosh
2015-09-29  7:55 ` [PATCH 5/6] toaster: ignore ReachableStamps event Ed Bartosh
2015-09-29  7:55 ` [PATCH 6/6] toaster: use meaningful logging levels Ed Bartosh
2015-09-29 12:50 ` [PATCH v3 0/6] Fixes for toastergui Barros Pena, Belen
2015-09-30 12:46   ` Ed Bartosh
2015-09-30  9:57 ` Smith, Elliot
2015-09-30 10:00   ` Barros Pena, Belen
  -- strict thread matches above, loose matches on Subject: below --
2015-10-05  9:43 [PATCH 1/6] event: add new property to BuildBase class Elliot Smith
2015-10-05  9:43 ` [PATCH 0/6] Fixes for toastergui Elliot Smith
2015-10-05  9:43   ` [PATCH 2/6] event: add new parameter to Build* event APIs Elliot Smith
2015-09-30 13:30 [PATCH v4 0/6] Fixes for toastergui Ed Bartosh
2015-09-30 13:30 ` [PATCH 2/6] event: add new parameter to Build* event APIs Ed Bartosh
2015-09-28 15:44 [PATCH v2 0/6] Fixes for toastergui Ed Bartosh
2015-09-28 15:44 ` [PATCH 2/6] event: add new parameter to Build* event APIs Ed Bartosh
2015-09-28  8:56 [PATCH 0/6] Fixes for toastergui Ed Bartosh
2015-09-28  8:57 ` [PATCH 2/6] event: add new parameter to Build* event APIs Ed Bartosh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2816c40e7f06e5f12f534e40e6ff1eb55001580a.1443513126.git.ed.bartosh@linux.intel.com \
    --to=ed.bartosh@linux.intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.