Commit 50c6d8d3 authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

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/+/2167221Reviewed-by: 's avatarEdward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: 's avatarAnthony Polito <apolito@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
parent a57cf48d
...@@ -117,11 +117,16 @@ class PsPrinter(object): ...@@ -117,11 +117,16 @@ class PsPrinter(object):
self.active = sys.platform.startswith('linux2') self.active = sys.platform.startswith('linux2')
self.thread = None self.thread = None
@staticmethod
def print_pstree(): def print_pstree():
"""Debugging function used to print "ps auxwwf" for stuck processes.""" """Debugging function used to print "ps auxwwf" for stuck processes."""
# Add new line for cleaner output
print()
subprocess.call(['ps', 'auxwwf']) subprocess.call(['ps', 'auxwwf'])
# Restart timer, we want to continue printing until the process is
# terminated.
self.poke()
def poke(self): def poke(self):
if self.active: if self.active:
self.cancel() self.cancel()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment