summaryrefslogtreecommitdiffstats
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:46 +0000
commit7f36239b4ed63d31cb1fba03c00320ffe7c173a0 (patch)
treeda21fcce7fa4ace95394db7a11c329cc436a3aa5
parent519f3a7196a5657466a644bdd93f7b3a7cd3d7cd (diff)
downloadpoky-7f36239b4ed63d31cb1fba03c00320ffe7c173a0.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: 3699e5bf2f9259266c49aaf69127183988b9d052) 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>
-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 9a99859388..fedabb189a 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -195,7 +195,7 @@ class QemuRunner:
195 qmp_file = "." + next(tempfile._get_candidate_names()) 195 qmp_file = "." + next(tempfile._get_candidate_names())
196 qmp_param = ' -S -qmp unix:./%s,server,wait' % (qmp_file) 196 qmp_param = ' -S -qmp unix:./%s,server,wait' % (qmp_file)
197 qmp_port = self.tmpdir + "/" + qmp_file 197 qmp_port = self.tmpdir + "/" + qmp_file
198 # Create a second socket connection for debugging use, 198 # Create a second socket connection for debugging use,
199 # note this will NOT cause qemu to block waiting for the connection 199 # note this will NOT cause qemu to block waiting for the connection
200 qmp_file2 = "." + next(tempfile._get_candidate_names()) 200 qmp_file2 = "." + next(tempfile._get_candidate_names())
201 qmp_param += ' -qmp unix:./%s,server,nowait' % (qmp_file2) 201 qmp_param += ' -qmp unix:./%s,server,nowait' % (qmp_file2)
@@ -459,6 +459,8 @@ class QemuRunner:
459 socklist.remove(self.server_socket) 459 socklist.remove(self.server_socket)
460 self.logger.debug("Connection from %s:%s" % addr) 460 self.logger.debug("Connection from %s:%s" % addr)
461 else: 461 else:
462 # try to avoid reading only a single character at a time
463 time.sleep(0.1)
462 data = data + sock.recv(1024) 464 data = data + sock.recv(1024)
463 if data: 465 if data:
464 bootlog += data 466 bootlog += data