qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: lersek@redhat.com, qemu-devel@nongnu.org, mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH 0/3] Name threads
Date: Tue, 28 Jan 2014 16:31:55 +0000	[thread overview]
Message-ID: <20140128163154.GB31213@work-vm> (raw)
In-Reply-To: <52E7CFAB.6090801@redhat.com>

* Paolo Bonzini (pbonzini@redhat.com) wrote:
> Il 28/01/2014 16:20, Dr. David Alan Gilbert (git) ha scritto:
> >From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
> >
> >This series uses pthread_setname_np (when available) to set the names on
> >threads that QEMU creates to make life easier when debugging.
> >
> >It's turned off by default (because there were worries that it might break
> >tools that relied on process names) but is enabled by adding
> >
> >   namethreads=on
> >
> >to the --name option.
> >
> >Note that the initial thread still has the default name (or the value passed
> >as the process= parameter to --name).
> 
> I plead guilty to bikeshedding and propose s/namethreads/threads/.

If I need to reroll anyway I'll change that; although I just suggested
making it debug-thread in my reply to Michael to make it clear it wasn't
an API.

> Also, how did you test the merging of options?  Perhaps parse_name
> could itself call qemu_find_opts("name"), and could be called just
> once at the end of option parsing.  But that's just how *I* would
> have written the code, and what you have is fine if it works with
> multiple occurrences of -name.

I was trying to follow the closest example I could find; but
the multiple --name seems to woke out ok; with a bit of debug
if I do:

 ./bin/qemu-system-x86_64 --name foo,namethreads=off --name process=bar --name namethreads=on
parse_name: setting namethreads=0
parse_name: qemu_name=foo proc_name=(null)
parse_name: setting namethreads=0
parse_name: qemu_name=foo proc_name=bar
parse_name: setting namethreads=1
parse_name: qemu_name=foo proc_name=bar

So I think that ends up with the right result; it doesn't stop you from repeating
options, but I think takes the last one.

Dave
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2014-01-28 16:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28 15:20 [Qemu-devel] [PATCH 0/3] Name threads Dr. David Alan Gilbert (git)
2014-01-28 15:20 ` [Qemu-devel] [PATCH 1/3] Rework --name to use QemuOpts Dr. David Alan Gilbert (git)
2014-01-29  8:49   ` Alex Bennée
2014-01-28 15:20 ` [Qemu-devel] [PATCH 2/3] Add 'namethreads' suboption to --name Dr. David Alan Gilbert (git)
2014-01-28 15:53   ` Michael S. Tsirkin
2014-01-28 18:09     ` Dr. David Alan Gilbert
2014-01-28 19:01       ` Michael S. Tsirkin
2014-01-28 15:20 ` [Qemu-devel] [PATCH 3/3] Add a 'name' parameter to qemu_thread_create Dr. David Alan Gilbert (git)
2014-01-28 15:56   ` Michael S. Tsirkin
2014-01-28 16:12     ` Dr. David Alan Gilbert
2014-01-28 16:21       ` Laszlo Ersek
2014-01-28 16:44       ` Michael S. Tsirkin
2014-01-28 15:41 ` [Qemu-devel] [PATCH 0/3] Name threads Paolo Bonzini
2014-01-28 16:31   ` Dr. David Alan Gilbert [this message]
2014-01-28 16:33     ` Paolo Bonzini

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=20140128163154.GB31213@work-vm \
    --to=dgilbert@redhat.com \
    --cc=lersek@redhat.com \
    --cc=mst@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).