From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, lersek@redhat.com, mst@redhat.com
Subject: [Qemu-devel] [PATCH 0/3] Name threads
Date: Tue, 28 Jan 2014 15:20:36 +0000 [thread overview]
Message-ID: <1390922439-30750-1-git-send-email-dgilbert@redhat.com> (raw)
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).
The naming of the individual threads is not meant to form an API; tools
shall not rely on the names.
The first patch converts --name to use QemuOpts, a side effect of this is that
--name process=foo,bar
no longer allows a process name of 'foo,bar', since ',' is a separator.
With this enabled in gdb we see:
(gdb) info threads
Id Target Id Frame
5 Thread 0x7fb6670f9700 (LWP 18243) "worker" 0x00007fb66b8fcec0 in sem_timedwait () from /lib64/libpthread.so.0
4 Thread 0x7fb666515700 (LWP 18244) "CPU/KVM" 0x00007fb669ab0117 in ioctl () from /lib64/libc.so.6
3 Thread 0x7fb665d14700 (LWP 18245) "CPU/KVM" 0x00007fb669ab0117 in ioctl () from /lib64/libc.so.6
2 Thread 0x7fb5d7fff700 (LWP 18247) "vnc_worker" 0x00007fb66b8fad20 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libpthread.so.0
* 1 Thread 0x7fb66d451a00 (LWP 18242) "qemuprocess" 0x00007fb669aaeb4f in ppoll () from /lib64/libc.so.6
and it also shows up well in 'top' using the H and V options.
Dr. David Alan Gilbert (3):
Rework --name to use QemuOpts
Add 'namethreads' suboption to --name
Add a 'name' parameter to qemu_thread_create
cpus.c | 6 ++---
hw/block/dataplane/virtio-blk.c | 2 +-
hw/usb/ccid-card-emulated.c | 8 +++---
include/qemu/thread.h | 3 ++-
libcacard/vscclient.c | 2 +-
migration.c | 2 +-
qemu-options.hx | 6 +++--
thread-pool.c | 2 +-
ui/vnc-jobs.c | 3 ++-
util/compatfd.c | 3 ++-
util/qemu-thread-posix.c | 16 +++++++++--
util/qemu-thread-win32.c | 10 ++++++-
vl.c | 59 ++++++++++++++++++++++++++++++++---------
13 files changed, 90 insertions(+), 32 deletions(-)
--
1.8.5.3
next reply other threads:[~2014-01-28 15:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-28 15:20 Dr. David Alan Gilbert (git) [this message]
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
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=1390922439-30750-1-git-send-email-dgilbert@redhat.com \
--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).