diff options
| author | Saul Wold <Saul.Wold@windriver.com> | 2021-06-24 13:42:42 -0700 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-06-27 08:38:34 +0100 |
| commit | f0b9303004a80f10828bbf936fc8b2aa70f0f2b4 (patch) | |
| tree | 70cba9b9a228c4832769a1c3317322a87213fde5 /meta/lib/oeqa/utils | |
| parent | 7ef8f45b265f2a1b919f5d01cf0fd26b4089759c (diff) | |
| download | poky-f0b9303004a80f10828bbf936fc8b2aa70f0f2b4.tar.gz | |
qemurunner: Add info log for qemu startup
Add a couple of logging info to track time between activities, first
is from after the Popen(launch_cmd) to after qmp.connect(), second is
from qmp.connect() to the release of the qemu via the qmp("cont") command
this includes the mmap() activity.
Example output:
QMP connected to QEMU at 06/24/21 11:11:56 and took 0.9556229114532471 seconds from launch
QMP released QEMU at 06/24/21 11:11:56 and took 0.26789021492004395 seconds from connect
(From OE-Core rev: 547f49230ba4ebeefe5b696e0460ebaffa8e91e6)
Signed-off-by: Saul Wold <saul.wold@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/utils')
| -rw-r--r-- | meta/lib/oeqa/utils/qemurunner.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py index abbc7f7d1f..c7f7860317 100644 --- a/meta/lib/oeqa/utils/qemurunner.py +++ b/meta/lib/oeqa/utils/qemurunner.py | |||
| @@ -236,6 +236,7 @@ class QemuRunner: | |||
| 236 | # to be a proper fix but this will suffice for now. | 236 | # to be a proper fix but this will suffice for now. |
| 237 | self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, preexec_fn=os.setpgrp, env=env, cwd=self.tmpdir) | 237 | self.runqemu = subprocess.Popen(launch_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, stdin=subprocess.PIPE, preexec_fn=os.setpgrp, env=env, cwd=self.tmpdir) |
| 238 | output = self.runqemu.stdout | 238 | output = self.runqemu.stdout |
| 239 | launch_time = time.time() | ||
| 239 | 240 | ||
| 240 | # | 241 | # |
| 241 | # We need the preexec_fn above so that all runqemu processes can easily be killed | 242 | # We need the preexec_fn above so that all runqemu processes can easily be killed |
| @@ -339,6 +340,10 @@ class QemuRunner: | |||
| 339 | 340 | ||
| 340 | try: | 341 | try: |
| 341 | self.qmp.connect() | 342 | self.qmp.connect() |
| 343 | connect_time = time.time() | ||
| 344 | self.logger.info("QMP connected to QEMU at %s and took %s seconds" % | ||
| 345 | (time.strftime("%D %H:%M:%S"), | ||
| 346 | time.time() - launch_time)) | ||
| 342 | except OSError as msg: | 347 | except OSError as msg: |
| 343 | self.logger.warning("Failed to connect qemu monitor socket: %s File: %s" % (msg, msg.filename)) | 348 | self.logger.warning("Failed to connect qemu monitor socket: %s File: %s" % (msg, msg.filename)) |
| 344 | return False | 349 | return False |
| @@ -367,6 +372,9 @@ class QemuRunner: | |||
| 367 | 372 | ||
| 368 | # Release the qemu process to continue running | 373 | # Release the qemu process to continue running |
| 369 | self.run_monitor('cont') | 374 | self.run_monitor('cont') |
| 375 | self.logger.info("QMP released QEMU at %s and took %s seconds from connect" % | ||
| 376 | (time.strftime("%D %H:%M:%S"), | ||
| 377 | time.time() - connect_time)) | ||
| 370 | 378 | ||
| 371 | # We are alive: qemu is running | 379 | # We are alive: qemu is running |
| 372 | out = self.getOutput(output) | 380 | out = self.getOutput(output) |
