All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: brian avery <avery.brian@gmail.com>,
	Ed Bartosh <ed.bartosh@linux.intel.com>
Cc: bitbake-devel@lists.openembedded.org
Subject: Re: [PATCH 28/30] command: add CommandStarted event
Date: Mon, 07 Dec 2015 17:36:57 +0000	[thread overview]
Message-ID: <1449509817.19730.8.camel@linuxfoundation.org> (raw)
In-Reply-To: <3bf6fe429855eb5b4d44e28c7bf832423d2f72cb.1449078919.git.avery.brian@gmail.com>

Hi Ed,

On Wed, 2015-12-02 at 10:03 -0800, brian avery wrote:
> From: Ed Bartosh <ed.bartosh@linux.intel.com>
> 
> This event will be used by toasterui to set BRBE build parameter
> as soon as it's provided to bitbake server by Toaster.
> 
> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
> Signed-off-by: brian avery <avery.brian@gmail.com>
> ---
>  lib/bb/command.py | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/lib/bb/command.py b/lib/bb/command.py
> index 74106d1..78ce03a 100644
> --- a/lib/bb/command.py
> +++ b/lib/bb/command.py
> @@ -31,6 +31,11 @@ Commands are queued in a CommandQueue
>  import bb.event
>  import bb.cooker
>  
> +class CommandStarted(bb.event.Event):
> +    def  __init__(self, commandline):
> +        bb.event.Event.__init__(self)
> +        self.commandline = commandline
> +
>  class CommandCompleted(bb.event.Event):
>      pass
>  
> @@ -60,6 +65,7 @@ class Command:
>          self.currentAsyncCommand = None
>  
>      def runCommand(self, commandline, ro_only = False):
> +        bb.event.fire(CommandStarted(commandline), self.cooker.expanded_data)
>          command = commandline.pop(0)
>          if hasattr(CommandsSync, command):
>              # Can run synchronous commands straight away

I'm not sure I like the idea of this, particularly after I've seen what
you're using it to do. Just from a performance standpoint, adding in an
event per command execution adds in round trips and will increase the
time something simple like "bitbake -p" takes to do nothing when the
cache is hot.

I note in a later patch you use this to check for a command coming from
elsewhere to modify the data store and I worry that we'll end up with
unstructured code if we encourage people to do that too.

I did briefly talk to Brian and he mentioned you needed a way to
differentiate between events from different builds. I'd suggest you can
could do this if you markup the events as they come through your event
receiver, since events for a specific build should come through a
specific socket. Worst case I'd prefer doing this internally to bitbake
rather than the command interception above but adding data to every
event being sent over IPC is something I'd prefer to avoid if we can
too.

Would you be able to see if there is a different way we could handle
this?

Cheers,

Richard





  reply	other threads:[~2015-12-07 17:37 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-02 18:02 [PATCH 00/30] toaster: Merge analysis and managed modes brian avery
2015-12-02 18:02 ` [PATCH 01/30] toaster: don't allow to run toaster as a script brian avery
2015-12-02 18:02 ` [PATCH 02/30] toaster: implement get-dburl command brian avery
2015-12-02 18:02 ` [PATCH 03/30] toaster: set DATABASE_URL in toaster script brian avery
2015-12-02 18:02 ` [PATCH 04/30] toaster: run bitbake the same way brian avery
2015-12-02 18:02 ` [PATCH 05/30] toaster: remove unused variable brian avery
2015-12-03 13:49   ` Peter Kjellerstedt
2015-12-05 18:35     ` Brian Avery
2015-12-02 18:02 ` [PATCH 06/30] toaster: check for toaster configuration later brian avery
2015-12-02 18:02 ` [PATCH 07/30] toaster: use parent of the build dir brian avery
2015-12-02 18:02 ` [PATCH 08/30] toaster: make runbuilds to loop brian avery
2015-12-02 18:02 ` [PATCH 09/30] toaster: start 'manage.py runbuilds' in the script brian avery
2015-12-02 18:02 ` [PATCH 10/30] toaster: update brbe and project attributes brian avery
2015-12-02 18:02 ` [PATCH 11/30] toaster: implement stop_bitbake function brian avery
2015-12-02 18:02 ` [PATCH 12/30] toaster: implement start_bitbake function brian avery
2015-12-02 18:02 ` [PATCH 13/30] toaster: implement 'toaster restart-bitbake' brian avery
2015-12-02 18:02 ` [PATCH 14/30] toaster: remove _setupBE function brian avery
2015-12-02 18:02 ` [PATCH 15/30] toaster: reimplemented startBBServer method brian avery
2015-12-02 18:02 ` [PATCH 16/30] toaster: remove stopBBServer API brian avery
2015-12-02 18:02 ` [PATCH 17/30] toaster: do not terminate bb server brian avery
2015-12-02 18:02 ` [PATCH 18/30] toaster: remove usage of BUILD_MODE variable brian avery
2015-12-02 18:02 ` [PATCH 19/30] toaster: do not create duplicate HelpText objects brian avery
2015-12-02 18:02 ` [PATCH 20/30] toaster: buildinfohelper Broaden the toaster created recipe data case brian avery
2015-12-02 18:02 ` [PATCH 21/30] toaster: implement BitbakeController.getVariable brian avery
2015-12-02 18:02 ` [PATCH 22/30] toaster: set varibales on bitbake server brian avery
2015-12-02 18:02 ` [PATCH 23/30] toaster: remove writeConfFile API brian avery
2015-12-02 18:02 ` [PATCH 24/30] toaster: stop using toaster-pre.conf brian avery
2015-12-02 18:02 ` [PATCH 25/30] toaster: remove SDKMACHINE from project variables brian avery
2015-12-02 18:02 ` [PATCH 26/30] toaster: get rid of complicated heuristics brian avery
2015-12-02 18:02 ` [PATCH 27/30] toaster: unset environment variables brian avery
2015-12-02 18:03 ` [PATCH 28/30] command: add CommandStarted event brian avery
2015-12-07 17:36   ` Richard Purdie [this message]
2015-12-07 18:22     ` Ed Bartosh
2015-12-07 23:23       ` Richard Purdie
2015-12-02 18:03 ` [PATCH 29/30] bb/ui: ignore " brian avery
2015-12-02 18:03 ` [PATCH 30/30] toasterui: process " brian avery
  -- strict thread matches above, loose matches on Subject: below --
2015-11-26 11:27 [PATCH v6 00/30] toaster: 8279: Provide a single way of starting Toaster Ed Bartosh
2015-11-26 11:27 ` [PATCH 28/30] command: add CommandStarted event 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=1449509817.19730.8.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=avery.brian@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=ed.bartosh@linux.intel.com \
    /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.