<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Sep 16, 2013 at 3:24 PM, Richard Purdie <span dir="ltr">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Mon, 2013-09-16 at 14:33 +0100, Alex DAMIAN wrote:<br>
&gt; From: Alexandru DAMIAN &lt;<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>&gt;<br>
&gt;<br>
&gt; Adding a runQueueTaskSkipped to notify all listeners<br>
&gt; about the tasks that are not run either because they<br>
&gt; are set-scened or they don&#39;t need an update (timestamps<br>
&gt; are ok)<br>
&gt;<br>
&gt; Adds RunQueueData functions to get the task name and task<br>
&gt; file for usage with the runQueue* events.<br>
&gt;<br>
&gt; Signed-off-by: Alexandru DAMIAN &lt;<a href="mailto:alexandru.damian@intel.com">alexandru.damian@intel.com</a>&gt;<br>
&gt; ---<br>
&gt;  bitbake/lib/bb/build.py    |  3 +++<br>
&gt;  bitbake/lib/bb/runqueue.py | 27 ++++++++++++++++++++++++---<br>
&gt;  2 files changed, 27 insertions(+), 3 deletions(-)<br>
&gt;<br>
&gt; diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py<br>
&gt; index a53aba9..1265bdc 100644<br>
&gt; --- a/bitbake/lib/bb/build.py<br>
&gt; +++ b/bitbake/lib/bb/build.py<br>
&gt; @@ -72,6 +72,9 @@ class TaskBase(event.Event):<br>
&gt;      def __init__(self, t, d ):<br>
&gt;          self._task = t<br>
&gt;          self._package = d.getVar(&quot;PF&quot;, True)<br>
&gt; +        self._file = d.getVar(&quot;FILE&quot;, True)<br>
&gt; +        self.taskfile = self._file<br>
&gt; +        self.taskname = self._task<br>
&gt;          event.Event.__init__(self)<br>
&gt;          self._message = &quot;recipe %s: task %s: %s&quot; % (d.getVar(&quot;PF&quot;, True), t, self.getDisplayName())<br>
&gt;<br>
&gt; diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py<br>
&gt; index aa2f147..2ab4405 100644<br>
&gt; --- a/bitbake/lib/bb/runqueue.py<br>
&gt; +++ b/bitbake/lib/bb/runqueue.py<br>
&gt; @@ -217,6 +217,12 @@ class RunQueueData:<br>
&gt;              ret.extend([nam])<br>
&gt;          return ret<br>
&gt;<br>
&gt; +    def get_task_name(self, task):<br>
&gt; +        return self.runq_task[task]<br>
&gt; +<br>
&gt; +    def get_task_file(self, task):<br>
&gt; +        return self.taskData.fn_index[self.runq_fnid[task]]<br>
&gt; +<br>
&gt;      def get_user_idstring(self, task, task_name_suffix = &quot;&quot;):<br>
&gt;          fn = self.taskData.fn_index[self.runq_fnid[task]]<br>
&gt;          taskname = self.runq_task[task] + task_name_suffix<br>
&gt; @@ -1328,9 +1334,10 @@ class RunQueueExecuteTasks(RunQueueExecute):<br>
&gt;          if self.rqdata.taskData.abort:<br>
&gt;              self.rq.state = runQueueCleanUp<br>
&gt;<br>
&gt; -    def task_skip(self, task):<br>
&gt; +    def task_skip(self, task, skip_reason = &quot;&quot;):<br>
&gt;          self.runq_running[task] = 1<br>
&gt;          self.runq_buildable[task] = 1<br>
&gt; +        bb.event.fire(runQueueTaskSkipped(task, self.stats, self.rq, skip_reason), self.cfgData)<br>
&gt;          self.task_completeoutright(task)<br>
&gt;          self.stats.taskCompleted()<br>
&gt;          self.stats.taskSkipped()<br>
&gt; @@ -1355,13 +1362,13 @@ class RunQueueExecuteTasks(RunQueueExecute):<br>
&gt;              if task in self.rq.scenequeue_covered:<br>
&gt;                  logger.debug(2, &quot;Setscene covered task %s (%s)&quot;, task,<br>
&gt;                                  self.rqdata.get_user_idstring(task))<br>
&gt; -                self.task_skip(task)<br>
&gt; +                self.task_skip(task, &quot;covered&quot;)<br>
&gt;                  return True<br>
&gt;<br>
&gt;              if self.rq.check_stamp_task(task, taskname, cache=self.stampcache):<br>
&gt;                  logger.debug(2, &quot;Stamp current task %s (%s)&quot;, task,<br>
&gt;                                  self.rqdata.get_user_idstring(task))<br>
&gt; -                self.task_skip(task)<br>
&gt; +                self.task_skip(task, &quot;existing&quot;)<br>
&gt;                  return True<br>
&gt;<br>
&gt;              taskdep = self.rqdata.dataCache.task_deps[fn]<br>
&gt; @@ -1783,6 +1790,8 @@ class runQueueEvent(bb.event.Event):<br>
&gt;      def __init__(self, task, stats, rq):<br>
&gt;          self.taskid = task<br>
&gt;          self.taskstring = rq.rqdata.get_user_idstring(task)<br>
&gt; +        self.taskname = rq.rqdata.get_task_name(task)<br>
&gt; +        self.taskfile = rq.rqdata.get_task_file(task)<br>
&gt;          self.stats = stats.copy()<br>
&gt;          bb.event.Event.__init__(self)<br>
&gt;<br>
&gt; @@ -1794,6 +1803,8 @@ class sceneQueueEvent(runQueueEvent):<br>
&gt;          runQueueEvent.__init__(self, task, stats, rq)<br>
&gt;          realtask = rq.rqdata.runq_setscene[task]<br>
&gt;          self.taskstring = rq.rqdata.get_user_idstring(realtask, &quot;_setscene&quot;)<br>
&gt; +        self.taskname = rq.rqdata.get_task_name(realtask) + &quot;_setscene&quot;<br>
&gt; +        self.taskfile = rq.rqdata.get_task_file(realtask)<br>
&gt;<br>
&gt;  class runQueueTaskStarted(runQueueEvent):<br>
&gt;      &quot;&quot;&quot;<br>
&gt; @@ -1837,6 +1848,16 @@ class sceneQueueTaskCompleted(sceneQueueEvent):<br>
&gt;      Event notifing a setscene task completed<br>
&gt;      &quot;&quot;&quot;<br>
&gt;<br>
&gt; +class runQueueTaskSkipped(runQueueEvent):<br>
&gt; +    &quot;&quot;&quot;<br>
&gt; +    Event notifing a task was skipped<br>
&gt; +    &quot;&quot;&quot;<br>
&gt; +    def __init__(self, task, stats, rq, skip_reason):<br>
&gt; +        runQueueEvent.__init__(self, task, stats, rq)<br>
&gt; +        self._file = rq.rqdata.get_task_file(task)<br>
&gt; +        self._task = rq.rqdata.get_task_name(task)<br>
&gt; +        self._skip = skip_reason<br>
&gt; +<br>
&gt;  class runQueuePipe():<br>
&gt;      &quot;&quot;&quot;<br>
&gt;      Abstraction for a pipe between a worker thread and the server<br>
<br>
<br>
</div></div>Please rebase this one off<br>
<a href="http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master-next&amp;id=39c70d0ad00afa05d343dc19aa557a092db7c963" target="_blank">http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master-next&amp;id=39c70d0ad00afa05d343dc19aa557a092db7c963</a><br>


<br>
since we should do one thing in a commit, not three. I renamed _skip -&gt;<br>
reason since its not internal and its a skip event, we know this, the<br>
field is the reason.<br>
<br>
You need to separate out the runQueueEvent changes from the TaskBase<br>
changes.<br>
<br>
Why add self._file to TaskBase? Surely just taskfile would be enough?<br>
The _ is meant to indicate internal use only and aren&#39;t the above events<br>
inconsistent with each other?<br></blockquote><div><br></div><div>[Alex] This is the idea - I actually tried to make TaskBase-derived events consistent with runQueueEvents in terms of class fields, so the code that reads them is easier to follow - I just have to look up for the same named field regardless of the event type.</div>

<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
<br>
Richard<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Alex Damian<div>Yocto Project<br></div><div>SSG / OTC </div></div>
</div></div>