[oe-commits] Richard Purdie : lib/oeqa/qemurunner: Use a timeout in select() call

git at git.openembedded.org git at git.openembedded.org
Fri Sep 6 21:37:52 UTC 2013


Module: openembedded-core.git
Branch: master-next
Commit: 6fcab1a0edd7c8779a758e5abf6708de5b4e05f4
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=6fcab1a0edd7c8779a758e5abf6708de5b4e05f4

Author: Richard Purdie <richard.purdie at linuxfoundation.org>
Date:   Fri Sep  6 14:14:34 2013 +0000

lib/oeqa/qemurunner: Use a timeout in select() call

A 0 value to select.select() immediately returns with no timeout. This was
pegging the cpu at 100% for the python process which was bad and may be
contributing to some of the timeout problems.

Profile from -P of a core-image-minimal before:

    97526792 function calls (97525652 primitive calls) in 45.189 seconds

and after:

       50204 function calls (49064 primitive calls) in 17.318 seconds

Saving 97.5 million function calls has to be good :)

Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

 meta/lib/oeqa/utils/qemurunner.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/meta/lib/oeqa/utils/qemurunner.py b/meta/lib/oeqa/utils/qemurunner.py
index e7bd8b1..b5c757a 100644
--- a/meta/lib/oeqa/utils/qemurunner.py
+++ b/meta/lib/oeqa/utils/qemurunner.py
@@ -101,7 +101,7 @@ class QemuRunner:
             reachedlogin = False
             stopread = False
             while time.time() < endtime and not stopread:
-                sread, swrite, serror = select.select(socklist, [], [], 0)
+                sread, swrite, serror = select.select(socklist, [], [], 5)
                 for sock in sread:
                     if sock is self.server_socket:
                         self.qemusock, addr = self.server_socket.accept()



More information about the Openembedded-commits mailing list