[bitbake-devel] [PATCH][RFC] bitbake-worker: set the process name when starting a task

Ross Burton ross.burton at intel.com
Wed Jan 6 16:25:00 UTC 2016


If the setproctitle module is present then use it to change the process name
when the worker starts a task.  This results in each worker showing what task it
is executing in a process listing.

Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 bitbake/bin/bitbake-worker | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/bitbake/bin/bitbake-worker b/bitbake/bin/bitbake-worker
index 3390f63..15b0f10 100755
--- a/bitbake/bin/bitbake-worker
+++ b/bitbake/bin/bitbake-worker
@@ -371,6 +371,12 @@ class BitbakeWorker(object):
         fn, task, taskname, quieterrors, appends, taskdepdata = pickle.loads(data)
         workerlog_write("Handling runtask %s %s %s\n" % (task, fn, taskname))
 
+        try:
+            import setproctitle
+            setproctitle.setproctitle("bitbake-worker: %s:%s" % (os.path.basename(fn), taskname))
+        except ImportError:
+            pass
+
         pid, pipein, pipeout = fork_off_task(self.cookercfg, self.data, self.workerdata, fn, task, taskname, appends, taskdepdata, quieterrors)
 
         self.build_pids[pid] = task
-- 
2.6.4




More information about the bitbake-devel mailing list