From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Christopher Larson <clarson@kergoth.com>,
Ross Burton <ross.burton@intel.com>
Cc: "bitbake-devel@lists.openembedded.org"
<bitbake-devel@lists.openembedded.org>
Subject: Re: [PATCH][RFC] bitbake-worker: set the process name when starting a task
Date: Thu, 07 Jan 2016 14:00:08 +0000 [thread overview]
Message-ID: <1452175208.7598.120.camel@linuxfoundation.org> (raw)
In-Reply-To: <CABcZANnO9qiA0-7+tcz8Y03pa5gNEb4EcdKa1MQ6O_hkjgLsvA@mail.gmail.com>
On Wed, 2016-01-06 at 14:42 -0700, Christopher Larson wrote:
> On Wed, Jan 6, 2016 at 9:25 AM, Ross Burton <ross.burton@intel.com>
> wrote:
> > 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@intel.com>
> >
> Very nice. Do you know if it's overwriting just the process name or
> the entire commandline? I'm wondering if pkill bitbake-worker would
> do what you want, or if you'd still need to use pkill -f, for
> example. I'd like to see the toplevel bitbake processes named nicely
> without the python path and whatnot too eventually. We could also
> name the parallel parsing processes (though admittedly they're not
> long lived). Perhaps this should go into a helper function in
> bb.utils or bb.process?
There is a slightly more ugly version of this we could use:
def set_process_title(name):
from ctypes import cdll, byref, create_string_buffer
libc = cdll.LoadLibrary('libc.so.6')
buff = create_string_buffer(len(name)+1)
buff.value = name
libc.prctl(15, byref(buff), 0, 0, 0)
which would then mean we don't have a dependency on the external
module. Obviously using ctypes is a bit nasty though.
I would like to see this markup the worker/cooker/UI threads and so
on...
Cheers,
Richard
prev parent reply other threads:[~2016-01-07 14:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 16:25 [PATCH][RFC] bitbake-worker: set the process name when starting a task Ross Burton
2016-01-06 21:42 ` Christopher Larson
2016-01-07 14:00 ` Richard Purdie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1452175208.7598.120.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=bitbake-devel@lists.openembedded.org \
--cc=clarson@kergoth.com \
--cc=ross.burton@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.