From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Alex DAMIAN <alexandru.damian@intel.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 3/7] bitbake: runqueue: add runQueueTaskSkipped event
Date: Mon, 16 Sep 2013 15:24:28 +0100 [thread overview]
Message-ID: <1379341468.3484.313.camel@ted> (raw)
In-Reply-To: <8a649ee0aa5cd852e54078b3d980b99d37ecad7b.1379338189.git.alexandru.damian@intel.com>
On Mon, 2013-09-16 at 14:33 +0100, Alex DAMIAN wrote:
> From: Alexandru DAMIAN <alexandru.damian@intel.com>
>
> Adding a runQueueTaskSkipped to notify all listeners
> about the tasks that are not run either because they
> are set-scened or they don't need an update (timestamps
> are ok)
>
> Adds RunQueueData functions to get the task name and task
> file for usage with the runQueue* events.
>
> Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
> ---
> bitbake/lib/bb/build.py | 3 +++
> bitbake/lib/bb/runqueue.py | 27 ++++++++++++++++++++++++---
> 2 files changed, 27 insertions(+), 3 deletions(-)
>
> diff --git a/bitbake/lib/bb/build.py b/bitbake/lib/bb/build.py
> index a53aba9..1265bdc 100644
> --- a/bitbake/lib/bb/build.py
> +++ b/bitbake/lib/bb/build.py
> @@ -72,6 +72,9 @@ class TaskBase(event.Event):
> def __init__(self, t, d ):
> self._task = t
> self._package = d.getVar("PF", True)
> + self._file = d.getVar("FILE", True)
> + self.taskfile = self._file
> + self.taskname = self._task
> event.Event.__init__(self)
> self._message = "recipe %s: task %s: %s" % (d.getVar("PF", True), t, self.getDisplayName())
>
> diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py
> index aa2f147..2ab4405 100644
> --- a/bitbake/lib/bb/runqueue.py
> +++ b/bitbake/lib/bb/runqueue.py
> @@ -217,6 +217,12 @@ class RunQueueData:
> ret.extend([nam])
> return ret
>
> + def get_task_name(self, task):
> + return self.runq_task[task]
> +
> + def get_task_file(self, task):
> + return self.taskData.fn_index[self.runq_fnid[task]]
> +
> def get_user_idstring(self, task, task_name_suffix = ""):
> fn = self.taskData.fn_index[self.runq_fnid[task]]
> taskname = self.runq_task[task] + task_name_suffix
> @@ -1328,9 +1334,10 @@ class RunQueueExecuteTasks(RunQueueExecute):
> if self.rqdata.taskData.abort:
> self.rq.state = runQueueCleanUp
>
> - def task_skip(self, task):
> + def task_skip(self, task, skip_reason = ""):
> self.runq_running[task] = 1
> self.runq_buildable[task] = 1
> + bb.event.fire(runQueueTaskSkipped(task, self.stats, self.rq, skip_reason), self.cfgData)
> self.task_completeoutright(task)
> self.stats.taskCompleted()
> self.stats.taskSkipped()
> @@ -1355,13 +1362,13 @@ class RunQueueExecuteTasks(RunQueueExecute):
> if task in self.rq.scenequeue_covered:
> logger.debug(2, "Setscene covered task %s (%s)", task,
> self.rqdata.get_user_idstring(task))
> - self.task_skip(task)
> + self.task_skip(task, "covered")
> return True
>
> if self.rq.check_stamp_task(task, taskname, cache=self.stampcache):
> logger.debug(2, "Stamp current task %s (%s)", task,
> self.rqdata.get_user_idstring(task))
> - self.task_skip(task)
> + self.task_skip(task, "existing")
> return True
>
> taskdep = self.rqdata.dataCache.task_deps[fn]
> @@ -1783,6 +1790,8 @@ class runQueueEvent(bb.event.Event):
> def __init__(self, task, stats, rq):
> self.taskid = task
> self.taskstring = rq.rqdata.get_user_idstring(task)
> + self.taskname = rq.rqdata.get_task_name(task)
> + self.taskfile = rq.rqdata.get_task_file(task)
> self.stats = stats.copy()
> bb.event.Event.__init__(self)
>
> @@ -1794,6 +1803,8 @@ class sceneQueueEvent(runQueueEvent):
> runQueueEvent.__init__(self, task, stats, rq)
> realtask = rq.rqdata.runq_setscene[task]
> self.taskstring = rq.rqdata.get_user_idstring(realtask, "_setscene")
> + self.taskname = rq.rqdata.get_task_name(realtask) + "_setscene"
> + self.taskfile = rq.rqdata.get_task_file(realtask)
>
> class runQueueTaskStarted(runQueueEvent):
> """
> @@ -1837,6 +1848,16 @@ class sceneQueueTaskCompleted(sceneQueueEvent):
> Event notifing a setscene task completed
> """
>
> +class runQueueTaskSkipped(runQueueEvent):
> + """
> + Event notifing a task was skipped
> + """
> + def __init__(self, task, stats, rq, skip_reason):
> + runQueueEvent.__init__(self, task, stats, rq)
> + self._file = rq.rqdata.get_task_file(task)
> + self._task = rq.rqdata.get_task_name(task)
> + self._skip = skip_reason
> +
> class runQueuePipe():
> """
> Abstraction for a pipe between a worker thread and the server
Please rebase this one off
http://git.yoctoproject.org/cgit.cgi/poky/commit/?h=master-next&id=39c70d0ad00afa05d343dc19aa557a092db7c963
since we should do one thing in a commit, not three. I renamed _skip ->
reason since its not internal and its a skip event, we know this, the
field is the reason.
You need to separate out the runQueueEvent changes from the TaskBase
changes.
Why add self._file to TaskBase? Surely just taskfile would be enough?
The _ is meant to indicate internal use only and aren't the above events
inconsistent with each other?
Cheers,
Richard
next prev parent reply other threads:[~2013-09-16 14:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-16 13:32 [PATCH v3 0/7] webhob related changes in bitbake, version 3 Alex DAMIAN
2013-09-16 13:33 ` [PATCH 1/7] bitbake: cooker: clean up code and avoid duplication Alex DAMIAN
2013-09-16 13:33 ` [PATCH 2/7] bitbake: event: send the task dependency tree to UI Alex DAMIAN
2013-09-16 15:32 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 3/7] bitbake: runqueue: add runQueueTaskSkipped event Alex DAMIAN
2013-09-16 14:24 ` Richard Purdie [this message]
2013-09-16 14:32 ` Damian, Alexandru
2013-09-16 15:23 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 4/7] bitbake: cooker: add extra recipe information Alex DAMIAN
2013-09-16 14:10 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 5/7] bitbake: cooker, command: add a command to return global data Alex DAMIAN
2013-09-16 13:54 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 6/7] bitbake: event: adding events to allow bbclasses to push custom info Alex DAMIAN
2013-09-16 13:46 ` Richard Purdie
2013-09-16 13:56 ` Damian, Alexandru
2013-09-16 15:20 ` Richard Purdie
2013-09-16 13:33 ` [PATCH 7/7] bitbake: runqueue: add task hash to Queue events Alex DAMIAN
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=1379341468.3484.313.camel@ted \
--to=richard.purdie@linuxfoundation.org \
--cc=alexandru.damian@intel.com \
--cc=bitbake-devel@lists.openembedded.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.