All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ján Tomko" <jtomko@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, "Stefan Weil" <sw@weilnetz.de>,
	qemu-block@nongnu.org,
	"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
	"Dr. David Alan Gilbert" <dave@treblig.org>,
	"Kevin Wolf" <kwolf@redhat.com>,
	"Hanna Reitz" <hreitz@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH v2 03/14] system: unconditionally enable thread naming
Date: Thu, 11 Sep 2025 13:59:04 +0200	[thread overview]
Message-ID: <aMK5iGPz5rSV7WC8@fedora> (raw)
In-Reply-To: <20250829180354.2922145-4-berrange@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2535 bytes --]

On a Friday in 2025, Daniel P. Berrangé wrote:
>When thread naming was introduced years ago, it was disabled by
>default and put behind a command line flag:
>
>  commit 8f480de0c91a18d550721f8d9af969ebfbda0793
>  Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
>  Date:   Thu Jan 30 10:20:31 2014 +0000
>
>    Add 'debug-threads' suboption to --name
>
>This was done based on a concern that something might depend
>on the historical thread naming. Thread names, however, were
>never promised to be part of QEMU's public API. The defaults
>will vary across platforms, so no assumptions should ever be
>made about naming.
>
>An opt-in behaviour is also unfortunately incompatible with
>RCU which creates its thread from an constructor function
>which is run before command line args are parsed. Thus the
>RCU thread lacks any name.
>
>libvirt has unconditionally enabled debug-threads=yes on all
>VMs it creates for 10 years. Interestingly this DID expose a
>bug in libvirt, as it parsed /proc/$PID/stat and could not
>cope with a space in the thread name. This was a latent
>pre-existing bug in libvirt though, and not a part of QEMU's
>API.
>
>Having thread names always available, will allow thread names
>to be included in error reports and log messags QEMU prints
>by default, which will improve ability to triage QEMU bugs.
>
>Reviewed-by: Dr. David Alan Gilbert <dave@treblig.org>
>Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>---
> docs/about/deprecated.rst |  7 +++++++
> include/qemu/thread.h     |  1 -
> system/vl.c               | 11 ++++++-----
> util/qemu-thread-posix.c  | 18 +-----------------
> util/qemu-thread-win32.c  | 27 ++++++---------------------
> 5 files changed, 20 insertions(+), 44 deletions(-)
>
>diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
>index d50645a071..bd6f865558 100644
>--- a/docs/about/deprecated.rst
>+++ b/docs/about/deprecated.rst
>@@ -81,6 +81,13 @@ kernel since 2001. None of the board types QEMU supports need
> ``param_struct`` support, so this option has been deprecated and will
> be removed in a future QEMU version.
>
>+``debug-threads`` option for ``-name``

(since 10.2)

Jano

>+''''''''''''''''''''''''''''''''''''''
>+
>+Thread ``debug-threads`` option for the ``-name`` argument is now
>+ignored. Thread naming is unconditionally enabled for all platforms
>+where it is supported.
>+
> User-mode emulator command line arguments
> -----------------------------------------
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  parent reply	other threads:[~2025-09-11 12:00 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-29 18:03 [PATCH v2 00/14] util: sync error_report & qemu_log output more closely Daniel P. Berrangé
2025-08-29 18:03 ` [PATCH v2 01/14] include: define constant for early constructor priority Daniel P. Berrangé
2025-08-30 21:56   ` Richard Henderson
2025-08-30 22:56   ` Dr. David Alan Gilbert
2025-08-29 18:03 ` [PATCH v2 02/14] monitor: initialize global data from a constructor Daniel P. Berrangé
2025-08-30 21:57   ` Richard Henderson
2025-08-30 23:00   ` Dr. David Alan Gilbert
2025-08-29 18:03 ` [PATCH v2 03/14] system: unconditionally enable thread naming Daniel P. Berrangé
2025-08-30 21:59   ` Richard Henderson
2025-09-11 11:59   ` Ján Tomko [this message]
2025-08-29 18:03 ` [PATCH v2 04/14] util: expose qemu_thread_set_name Daniel P. Berrangé
2025-08-30 22:01   ` Richard Henderson
2025-08-30 23:02   ` Dr. David Alan Gilbert
2025-08-29 18:03 ` [PATCH v2 05/14] audio: make jackaudio use qemu_thread_set_name Daniel P. Berrangé
2025-08-30 22:05   ` Richard Henderson
2025-08-30 23:12   ` Dr. David Alan Gilbert
2025-08-29 18:03 ` [PATCH v2 06/14] util: set the name for the 'main' thread Daniel P. Berrangé
2025-08-30 22:06   ` Richard Henderson
2025-08-30 23:26   ` Dr. David Alan Gilbert
2025-08-29 18:03 ` [PATCH v2 07/14] util: add API to fetch the current thread name Daniel P. Berrangé
2025-08-30 22:14   ` Richard Henderson
2025-09-01  8:49     ` Daniel P. Berrangé
2025-09-02 10:19       ` Richard Henderson
2025-08-29 18:03 ` [PATCH v2 08/14] log: avoid prefix on split qemu_log calls Daniel P. Berrangé
2025-08-29 18:03 ` [PATCH v2 09/14] util: introduce common helper for error-report & log code Daniel P. Berrangé
2025-09-02 10:22   ` Richard Henderson
2025-08-29 18:03 ` [PATCH v2 10/14] util: convert error-report & log to message API for timestamp Daniel P. Berrangé
2025-08-29 18:03 ` [PATCH v2 11/14] util: add support for formatting a workload name in messages Daniel P. Berrangé
2025-08-29 18:03 ` [PATCH v2 12/14] util: add support for formatting a program " Daniel P. Berrangé
2025-08-29 18:03 ` [PATCH v2 13/14] util: add support for formatting thread info " Daniel P. Berrangé
2025-08-29 18:03 ` [PATCH v2 14/14] util: add brackets around guest name in message context Daniel P. Berrangé

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=aMK5iGPz5rSV7WC8@fedora \
    --to=jtomko@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dave@treblig.org \
    --cc=hreitz@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=manos.pitsidianakis@linaro.org \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=philmd@linaro.org \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu_oss@crudebyte.com \
    --cc=sw@weilnetz.de \
    /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.