public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Enrico Jorns <ejo@pengutronix.de>
To: openembedded-core@lists.openembedded.org
Cc: yocto@pengutronix.de, ejo@pengutronix.de
Subject: [PATCH 08/10] oeqa/utils/qemurunner: limit precision of timing debugging output
Date: Fri, 31 Mar 2023 12:26:20 +0200	[thread overview]
Message-ID: <20230331102622.1468385-9-ejo@pengutronix.de> (raw)
In-Reply-To: <20230331102622.1468385-1-ejo@pengutronix.de>

* There is no need to be that precise. It just irritates in the logs.
* There is also no point in printing plain time.time() value a single
  time while only using formatted printout everywhere else, thus remove
  it.
* Use %d for printing integer times

Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
---
 meta/lib/oeqa/utils/qemurunner.py | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index 9d6fe4fe59..623d45010a 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -275,7 +275,7 @@ class QemuRunner:
             os._exit(0)
 
         self.logger.debug("runqemu started, pid is %s" % self.runqemu.pid)
-        self.logger.debug("waiting at most %s seconds for qemu pid (%s)" %
+        self.logger.debug("waiting at most %d seconds for qemu pid (%s)" %
                           (self.runqemutime, time.strftime("%D %H:%M:%S")))
         endtime = time.time() + self.runqemutime
         while not self.is_alive() and time.time() < endtime:
@@ -299,7 +299,7 @@ class QemuRunner:
             self.logger.warning('runqemu exited with code %d' % self.runqemu.returncode)
 
         if not self.is_alive():
-            self.logger.error("Qemu pid didn't appear in %s seconds (%s)" %
+            self.logger.error("Qemu pid didn't appear in %d seconds (%s)" %
                               (self.runqemutime, time.strftime("%D %H:%M:%S")))
 
             qemu_pid = None
@@ -354,7 +354,7 @@ class QemuRunner:
                 self.qmp.settimeout(self.runqemutime)
                 self.qmp.connect()
                 connect_time = time.time()
-                self.logger.info("QMP connected to QEMU at %s and took %s seconds" %
+                self.logger.info("QMP connected to QEMU at %s and took %.2f seconds" %
                                   (time.strftime("%D %H:%M:%S"),
                                    time.time() - launch_time))
             except OSError as msg:
@@ -388,14 +388,14 @@ class QemuRunner:
 
         # Release the qemu process to continue running
         self.run_monitor('cont')
-        self.logger.info("QMP released QEMU at %s and took %s seconds from connect" %
+        self.logger.info("QMP released QEMU at %s and took %.2f seconds from connect" %
                           (time.strftime("%D %H:%M:%S"),
                            time.time() - connect_time))
 
         # We are alive: qemu is running
         out = self.getOutput(output)
         netconf = False # network configuration is not required by default
-        self.logger.debug("qemu started in %s seconds - qemu procces pid is %s (%s)" %
+        self.logger.debug("qemu started in %.2f seconds - qemu procces pid is %s (%s)" %
                           (time.time() - (endtime - self.runqemutime),
                            self.qemupid, time.strftime("%D %H:%M:%S")))
         cmdline = ''
@@ -486,9 +486,9 @@ class QemuRunner:
                             self.server_socket = qemusock
                             stopread = True
                             reachedlogin = True
-                            self.logger.debug("Reached login banner in %s seconds (%s, %s)" %
+                            self.logger.debug("Reached login banner in %.2f seconds (%s)" %
                                               (time.time() - (endtime - self.boottime),
-                                              time.strftime("%D %H:%M:%S"), time.time()))
+                                              time.strftime("%D %H:%M:%S")))
                     else:
                         # no need to check if reachedlogin unless we support multiple connections
                         self.logger.debug("QEMU socket disconnected before login banner reached. (%s)" %
-- 
2.39.2



  parent reply	other threads:[~2023-03-31 10:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-31 10:26 [PATCH 00/10] oeqa: some minor fixes and cleanups Enrico Jorns
2023-03-31 10:26 ` [PATCH 01/10] oeqa/selftest/cases/runqemu: update imports Enrico Jorns
2023-03-31 10:26 ` [PATCH 02/10] oeqa/targetcontrol: fix misspelled RuntimeError Enrico Jorns
2023-03-31 10:26 ` [PATCH 03/10] oeqa/targetcontrol: do not set dump_host_cmds redundantly Enrico Jorns
2023-03-31 10:26 ` [PATCH 04/10] oeqa/targetcontrol: remove unused imports Enrico Jorns
2023-03-31 10:26 ` [PATCH 05/10] oeqa/utils/commands: fix usage of undefined EPIPE Enrico Jorns
2023-03-31 10:26 ` [PATCH 06/10] oeqa/utils/commands: remove unused imports Enrico Jorns
2023-03-31 10:26 ` [PATCH 07/10] oeqa/utils/qemurunner: replace hard-coded user 'root' in debug output Enrico Jorns
2023-03-31 10:26 ` Enrico Jorns [this message]
2023-03-31 10:26 ` [PATCH 09/10] oeqa/utils/qemurunner: fix undefined TimeoutExpired Enrico Jorns
2023-03-31 10:26 ` [PATCH 10/10] oeqa: whitespace and indentation cleanups Enrico Jorns

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230331102622.1468385-9-ejo@pengutronix.de \
    --to=ejo@pengutronix.de \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=yocto@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox