From 50c6d8d348bc160854e64de821052da79bdbd483 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Mon, 27 Apr 2020 20:09:16 +0000 Subject: [PATCH] Print ps in intervals while the process is running R=apolito@google.com, ehmaldonado@chromium.org Bug: 1074355 Change-Id: Id2d5c8ca6f27fefb0fe8d769ae2e50dbaaddadbb Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2167221 Reviewed-by: Edward Lesmes Reviewed-by: Anthony Polito Commit-Queue: Josip Sokcevic --- recipes/recipe_modules/bot_update/resources/bot_update.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/recipes/recipe_modules/bot_update/resources/bot_update.py b/recipes/recipe_modules/bot_update/resources/bot_update.py index 4561c67c3b..eae8f41c0d 100755 --- a/recipes/recipe_modules/bot_update/resources/bot_update.py +++ b/recipes/recipe_modules/bot_update/resources/bot_update.py @@ -117,11 +117,16 @@ class PsPrinter(object): self.active = sys.platform.startswith('linux2') self.thread = None - @staticmethod def print_pstree(): """Debugging function used to print "ps auxwwf" for stuck processes.""" + # Add new line for cleaner output + print() subprocess.call(['ps', 'auxwwf']) + # Restart timer, we want to continue printing until the process is + # terminated. + self.poke() + def poke(self): if self.active: self.cancel()