Skip to content
Snippets Groups Projects
Commit 2e2ce6c0 authored by Joe Hershberger's avatar Joe Hershberger Committed by Masahiro Yamada
Browse files

moveconfig: Print status about the processed defconfigs


This gives a basic idea about progress.

Signed-off-by: default avatarJoe Hershberger <joe.hershberger@ni.com>
Acked-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 95bf9c7e
No related branches found
No related tags found
No related merge requests found
...@@ -559,7 +559,7 @@ class Slot: ...@@ -559,7 +559,7 @@ class Slot:
pass pass
shutil.rmtree(self.build_dir) 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. """Assign a new subprocess for defconfig and add it to the slot.
If the slot is vacant, create a new subprocess for processing the If the slot is vacant, create a new subprocess for processing the
...@@ -580,6 +580,8 @@ class Slot: ...@@ -580,6 +580,8 @@ class Slot:
stderr=subprocess.PIPE) stderr=subprocess.PIPE)
self.defconfig = defconfig self.defconfig = defconfig
self.state = STATE_DEFCONFIG self.state = STATE_DEFCONFIG
self.num = num
self.total = total
return True return True
def poll(self): def poll(self):
...@@ -630,6 +632,9 @@ class Slot: ...@@ -630,6 +632,9 @@ class Slot:
if self.state == STATE_AUTOCONF: if self.state == STATE_AUTOCONF:
self.parser.update_defconfig(self.defconfig) 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""" """Save off the defconfig in a consistent way"""
cmd = list(self.make_cmd) cmd = list(self.make_cmd)
cmd.append('savedefconfig') cmd.append('savedefconfig')
...@@ -683,7 +688,7 @@ class Slots: ...@@ -683,7 +688,7 @@ class Slots:
for i in range(options.jobs): for i in range(options.jobs):
self.slots.append(Slot(config_attrs, options, devnull, make_cmd)) 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. """Add a new subprocess if a vacant slot is found.
Arguments: Arguments:
...@@ -693,7 +698,7 @@ class Slots: ...@@ -693,7 +698,7 @@ class Slots:
Return True on success or False on failure Return True on success or False on failure
""" """
for slot in self.slots: for slot in self.slots:
if slot.add(defconfig): if slot.add(defconfig, num, total):
return True return True
return False return False
...@@ -777,8 +782,8 @@ def move_config(config_attrs, options): ...@@ -777,8 +782,8 @@ def move_config(config_attrs, options):
# Main loop to process defconfig files: # Main loop to process defconfig files:
# Add a new subprocess into a vacant slot. # Add a new subprocess into a vacant slot.
# Sleep if there is no available slot. # Sleep if there is no available slot.
for defconfig in defconfigs: for i, defconfig in enumerate(defconfigs):
while not slots.add(defconfig): while not slots.add(defconfig, i, len(defconfigs)):
while not slots.available(): while not slots.available():
# No available slot: sleep for a while # No available slot: sleep for a while
time.sleep(SLEEP_TIME) time.sleep(SLEEP_TIME)
...@@ -787,6 +792,7 @@ def move_config(config_attrs, options): ...@@ -787,6 +792,7 @@ def move_config(config_attrs, options):
while not slots.empty(): while not slots.empty():
time.sleep(SLEEP_TIME) time.sleep(SLEEP_TIME)
print ''
slots.show_failed_boards() slots.show_failed_boards()
def bad_recipe(filename, linenum, msg): def bad_recipe(filename, linenum, msg):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment