diff mbox series

[10/14] oeqa qemurunner.py: add debug prints to stop()

Message ID 20230120144450.2913935-11-mikko.rapeli@linaro.org
State New
Headers show
Series oeqa runtime tests when qemu hangs | expand

Commit Message

Mikko Rapeli Jan. 20, 2023, 2:44 p.m. UTC
These help to investigate if any of the functions hang
when test target hangs.

Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org>
---
 meta/lib/oeqa/utils/qemurunner.py | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index eb6d3e8c57..ed44036758 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -533,12 +533,16 @@  class QemuRunner:
         return True
 
     def stop(self):
+        self.logger.debug("Stopping QemuRunner")
         if hasattr(self, "origchldhandler"):
             signal.signal(signal.SIGCHLD, self.origchldhandler)
+        self.logger.debug("Stopping thread")
         self.stop_thread()
+        self.logger.debug("Stopping qemu system")
         self.stop_qemu_system()
         if self.runqemu:
             if hasattr(self, "monitorpid"):
+                self.logger.debug("Sending SIGKILL to monitorpid")
                 os.kill(self.monitorpid, signal.SIGKILL)
                 self.logger.debug("Sending SIGTERM to runqemu")
                 try:
@@ -559,12 +563,15 @@  class QemuRunner:
             self.runqemu_exited = True
 
         if hasattr(self, 'qmp') and self.qmp:
+            self.logger.debug("Closing QMP")
             self.qmp.close()
             self.qmp = None
         if hasattr(self, 'server_socket') and self.server_socket:
+            self.logger.debug("Closing server socket")
             self.server_socket.close()
             self.server_socket = None
         if hasattr(self, 'threadsock') and self.threadsock:
+            self.logger.debug("Closing threadsock")
             self.threadsock.close()
             self.threadsock = None
         self.qemupid = None
@@ -576,6 +583,7 @@  class QemuRunner:
                 # We raced, ignore
                 pass
         if self.monitorpipe:
+            self.logger.debug("Closing monitorpipe")
             self.monitorpipe.close()
 
     def stop_qemu_system(self):