summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorMikko Rapeli <mikko.rapeli@linaro.org>2023-02-09 10:09:33 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-24 16:41:51 +0000
commitd0ae99feb87b44335a8d4ac0f983c84327eabc22 (patch)
tree3b233c9dc2db99f08a1ec8855c6bdee076425ea4 /meta/lib
parentf3437cb7404553cb7e0ac0662f88d74d0de5030f (diff)
downloadpoky-d0ae99feb87b44335a8d4ac0f983c84327eabc22.tar.gz
oeqa qemurunner: read more data at a time from serial
Use a short sleep to bundle serial console reads so that we are not reading one character at a time which reduces busy looping. (From OE-Core rev: 62df87d3544b7fc3717743b131a62c6092359ec5) Signed-off-by: Mikko Rapeli <mikko.rapeli@linaro.org> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> (cherry picked from commit cafe65d8cf7544edbd387f7f5f6d77c64c6b18fa) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oeqa/utils/qemurunner.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index c68974f25c..3aeef19434 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -198,7 +198,7 @@ class QemuRunner:
198 qmp_file = "." + next(tempfile._get_candidate_names()) 198 qmp_file = "." + next(tempfile._get_candidate_names())
199 qmp_param = ' -S -qmp unix:./%s,server,wait' % (qmp_file) 199 qmp_param = ' -S -qmp unix:./%s,server,wait' % (qmp_file)
200 qmp_port = self.tmpdir + "/" + qmp_file 200 qmp_port = self.tmpdir + "/" + qmp_file
201 # Create a second socket connection for debugging use, 201 # Create a second socket connection for debugging use,
202 # note this will NOT cause qemu to block waiting for the connection 202 # note this will NOT cause qemu to block waiting for the connection
203 qmp_file2 = "." + next(tempfile._get_candidate_names()) 203 qmp_file2 = "." + next(tempfile._get_candidate_names())
204 qmp_param += ' -qmp unix:./%s,server,nowait' % (qmp_file2) 204 qmp_param += ' -qmp unix:./%s,server,nowait' % (qmp_file2)
@@ -463,6 +463,8 @@ class QemuRunner:
463 socklist.remove(self.server_socket) 463 socklist.remove(self.server_socket)
464 self.logger.debug("Connection from %s:%s" % addr) 464 self.logger.debug("Connection from %s:%s" % addr)
465 else: 465 else:
466 # try to avoid reading only a single character at a time
467 time.sleep(0.1)
466 data = data + sock.recv(1024) 468 data = data + sock.recv(1024)
467 if data: 469 if data:
468 bootlog += data 470 bootlog += data