[oe-commits] [bitbake] branch master-next updated: more logging

git at git.openembedded.org git at git.openembedded.org
Sat Dec 1 10:34:10 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

The following commit(s) were added to refs/heads/master-next by this push:
     new 50870e7  more logging
50870e7 is described below

commit 50870e7adddbed5dafbb2fd27827433b9b10c096
Author: Richard Purdie <richard.purdie at linuxfoundation.org>
AuthorDate: Sat Dec 1 10:31:24 2018 +0000

    more logging
    
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/daemonize.py      |  8 ++++----
 lib/bb/server/process.py | 30 +++++++++++++++++++++++++-----
 2 files changed, 29 insertions(+), 9 deletions(-)

diff --git a/lib/bb/daemonize.py b/lib/bb/daemonize.py
index cae7a42..e1d0c5a 100644
--- a/lib/bb/daemonize.py
+++ b/lib/bb/daemonize.py
@@ -69,7 +69,7 @@ def createDaemon(function, logfile):
         os.dup2(si.fileno(), sys.stdin.fileno())
 
     with open(logfile + "A", 'a+') as f:
-        f.write("Here D\n")
+        f.write("Here D %s\n" % os.getpid())
 
     try:
         so = open(logfile, 'a+')
@@ -83,18 +83,18 @@ def createDaemon(function, logfile):
     sys.stderr = sys.stdout
 
     with open(logfile + "A", 'a+') as f:
-        f.write("Here E\n")
+        f.write("Here E %s\n" % os.getpid())
 
     try:
         function()
     except Exception as e:
         with open(logfile + "A", 'a+') as f:
-            f.write("Here F %s\n" % str(e))
+            f.write("Here F %s %s\n" % (os.getpid(), str(e)))
 
         traceback.print_exc()
     finally:
         with open(logfile + "A", 'a+') as f:
-            f.write("Here G\n")
+            f.write("Here G %s\n" % os.getpid())
 
         bb.event.print_ui_queue()
         # os._exit() doesn't flush open files like os.exit() does. Manually flush
diff --git a/lib/bb/server/process.py b/lib/bb/server/process.py
index 6bc0fc5..947d0a2 100644
--- a/lib/bb/server/process.py
+++ b/lib/bb/server/process.py
@@ -140,7 +140,7 @@ class ProcessServer(multiprocessing.Process):
         def disconnect_client(self, fds):
             if not self.haveui:
                 return
-            print("Disconnecting Client")
+            print("Disconnecting Client %s" % os.getpid())
             fds.remove(self.controllersock)
             fds.remove(self.command_channel)
             bb.event.unregister_UIHhandler(self.event_handle, True)
@@ -153,7 +153,7 @@ class ProcessServer(multiprocessing.Process):
             self.lastui = time.time()
             self.cooker.clientComplete()
             if self.timeout is None:
-                print("No timeout, exiting.")
+                print("No timeout, exiting. %s" % os.getpid())
                 self.quit = True
 
         while not self.quit:
@@ -396,10 +396,10 @@ class BitBakeServer(object):
         os.set_inheritable(self.sock.fileno(), True)
         startdatetime = datetime.datetime.now()
         with open(logfile + "A", 'a+') as f:
-            f.write("Here A\n")
+            f.write("Here A %s\n" % os.getpid())
         bb.daemonize.createDaemon(self._startServer, logfile)
         with open(logfile + "A", 'a+') as f:
-            f.write("Here B\n")
+            f.write("Here B %s\n" % os.getpid())
         self.sock.close()
         self.bitbake_lock.close()
         os.close(self.readypipein)
@@ -461,20 +461,40 @@ class BitBakeServer(object):
 
     def _startServer(self):
         with open(self.logfile + "A", 'a+') as f:
-            f.write("Here H\n")
+            f.write("Here H %s\n" % os.getpid())
 
         print(self.start_log_format % (os.getpid(), datetime.datetime.now().strftime(self.start_log_datetime_format)))
+
+        with open(self.logfile + "A", 'a+') as f:
+            f.write("Here I %s\n" % os.getpid())
+
         server = ProcessServer(self.bitbake_lock, self.sock, self.sockname)
+        with open(self.logfile + "A", 'a+') as f:
+            f.write("Here J %s\n" % os.getpid())
+
         self.configuration.setServerRegIdleCallback(server.register_idle_function)
         os.close(self.readypipe)
         writer = ConnectionWriter(self.readypipein)
+        with open(self.logfile + "A", 'a+') as f:
+            f.write("Here K %s\n" % os.getpid())
+
         self.cooker = bb.cooker.BBCooker(self.configuration, self.featureset)
+        with open(self.logfile + "A", 'a+') as f:
+            f.write("Here L %s\n" % os.getpid())
+
         writer.send("r")
         writer.close()
+        with open(self.logfile + "A", 'a+') as f:
+            f.write("Here M %s\n" % os.getpid())
+
+
         server.cooker = self.cooker
         server.server_timeout = self.configuration.server_timeout
         server.xmlrpcinterface = self.configuration.xmlrpcinterface
         print("Started bitbake server pid %d" % os.getpid())
+        with open(self.logfile + "A", 'a+') as f:
+            f.write("Here N %s\n" % os.getpid())
+
         server.start()
 
 def connectProcessServer(sockname, featureset):

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list