From patchwork Tue May 19 18:21:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Hershberger X-Patchwork-Id: 474023 X-Patchwork-Delegate: yamada.m@jp.panasonic.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 9D092140D4E for ; Wed, 20 May 2015 04:24:46 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D2034B8A1; Tue, 19 May 2015 20:24:44 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c1QiwcSIkS51; Tue, 19 May 2015 20:24:44 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 468E54B8BA; Tue, 19 May 2015 20:24:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7E0934B87C for ; Tue, 19 May 2015 20:23:42 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nkldtCKOAbw6 for ; Tue, 19 May 2015 20:23:42 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from ni.com (skprod2.natinst.com [130.164.80.23]) by theia.denx.de (Postfix) with ESMTPS id 1792A4B882 for ; Tue, 19 May 2015 20:23:34 +0200 (CEST) Received: from us-aus-mgwout2.amer.corp.natinst.com (nb-snip2-1338.natinst.com [130.164.19.135]) by us-aus-skprod2.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id t4JINXb7015792; Tue, 19 May 2015 13:23:33 -0500 Received: from linux-xvxi.natinst.com ([130.164.14.198]) by us-aus-mgwout2.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP6 HF1218) with ESMTP id 2015051913233316-171171 ; Tue, 19 May 2015 13:23:33 -0500 From: Joe Hershberger To: u-boot@lists.denx.de Date: Tue, 19 May 2015 13:21:25 -0500 Message-Id: <1432059685-3018-9-git-send-email-joe.hershberger@ni.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1432059685-3018-1-git-send-email-joe.hershberger@ni.com> References: <1431726052-6519-1-git-send-email-joe.hershberger@ni.com> <1432059685-3018-1-git-send-email-joe.hershberger@ni.com> X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 05/19/2015 01:23:33 PM, Serialize by Router on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6 HF1218|December 12, 2014) at 05/19/2015 01:23:33 PM, Serialize complete at 05/19/2015 01:23:33 PM X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2015-05-19_07:, , signatures=0 Cc: Joe Hershberger Subject: [U-Boot] [PATCH v5 9/9] moveconfig: Print status about the processed defconfigs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This gives a basic idea about progress. Signed-off-by: Joe Hershberger --- Changes in v5: None Changes in v4: None Changes in v3: -New for version 3 Changes in v2: None tools/moveconfig.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tools/moveconfig.py b/tools/moveconfig.py index a6f1853..a6e7c22 100755 --- a/tools/moveconfig.py +++ b/tools/moveconfig.py @@ -558,7 +558,7 @@ class Slot: pass shutil.rmtree(self.build_dir) - def add(self, defconfig): + def add(self, defconfig, num, total): """Assign a new subprocess for defconfig and add it to the slot. If the slot is vacant, create a new subprocess for processing the @@ -579,6 +579,8 @@ class Slot: stderr=subprocess.PIPE) self.defconfig = defconfig self.state = STATE_DEFCONFIG + self.num = num + self.total = total return True def poll(self): @@ -629,6 +631,9 @@ class Slot: if self.state == STATE_AUTOCONF: self.parser.update_defconfig(self.defconfig) + print ' %d defconfigs out of %d\r' % (self.num + 1, self.total), + sys.stdout.flush() + """Save off the defconfig in a consistent way""" cmd = list(self.make_cmd) cmd.append('savedefconfig') @@ -682,7 +687,7 @@ class Slots: for i in range(options.jobs): self.slots.append(Slot(config_attrs, options, devnull, make_cmd)) - def add(self, defconfig): + def add(self, defconfig, num, total): """Add a new subprocess if a vacant slot is found. Arguments: @@ -692,7 +697,7 @@ class Slots: Return True on success or False on failure """ for slot in self.slots: - if slot.add(defconfig): + if slot.add(defconfig, num, total): return True return False @@ -777,8 +782,8 @@ def move_config(config_attrs, options): # Main loop to process defconfig files: # Add a new subprocess into a vacant slot. # Sleep if there is no available slot. - for defconfig in defconfigs: - while not slots.add(defconfig): + for i, defconfig in enumerate(defconfigs): + while not slots.add(defconfig, i, len(defconfigs)): while not slots.available(): # No available slot: sleep for a while time.sleep(SLEEP_TIME) @@ -787,6 +792,7 @@ def move_config(config_attrs, options): while not slots.empty(): time.sleep(SLEEP_TIME) + print '' slots.show_failed_boards() def bad_recipe(filename, linenum, msg):