From: Tom Tromey <tom@tromey.com>
To: Tom de Vries <tdevries@suse.de>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] [gdb] Exclude unavailable hardware threads in default worker-threads
Date: Wed, 16 Sep 2026 18:22:57 -0600 [thread overview]
Message-ID: <87h5jo680u.fsf@tromey.com> (raw)
In-Reply-To: <20260906154838.139837-2-tdevries@suse.de> (Tom de Vries's message of "Sun, 6 Sep 2026 17:48:38 +0200")
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Sorry I didn't reply to this earlier. I saw it went in.
Tom> +#ifdef __linux__
Tom> +#include <sched.h>
Tom> +#endif
The autoconf wisdom is to do feature checks, not platform checks, a
style that's generally used in gdb. And you can see the result here,
where the above turned into
+#if defined (__linux__) || defined (__CYGWIN__)
Tom> + /* Exclude unavailable hardware threads (for instance made
Tom> + unavailable using taskset). */
Tom> +#ifdef __linux__
Tom> + cpu_set_t cpus;
Tom> + int res = sched_getaffinity (getpid (), sizeof (cpu_set_t), &cpus);
Likewise for functions.
Tom> +#else
Tom> + /* Todo: handle other platforms. */
Tom> +#endif
gdb generally has stopped adding todo/FIXME/etc comments, mainly because
nobody ever actually does them. Sometimes there are exceptions for
specific plans, I'm guilty of this myself with the Python safety code.
But here I think leaving this out would be completely fine, it's
implicit that ports to new hosts may be desirable.
thanks,
Tom
next prev parent reply other threads:[~2026-09-17 0:23 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-06 15:48 [PATCH 1/2] [gdb/testsuite] Fix timeout in do_self_tests Tom de Vries
2026-09-06 15:48 ` [PATCH 2/2] [gdb] Exclude unavailable hardware threads in default worker-threads Tom de Vries
2026-09-07 4:44 ` Thiago Jung Bauermann
2026-09-07 6:52 ` Tom de Vries
2026-09-09 12:02 ` Tom de Vries
2026-09-16 17:27 ` Tom de Vries
2026-09-17 0:22 ` Tom Tromey [this message]
2026-09-17 12:43 ` Tom de Vries
2026-09-17 21:59 ` Tom Tromey
2026-09-18 7:07 ` Tom de Vries
2026-09-07 4:36 ` [PATCH 1/2] [gdb/testsuite] Fix timeout in do_self_tests Thiago Jung Bauermann
2026-09-09 11:57 ` Tom de Vries
2026-09-09 20:28 ` Thiago Jung Bauermann
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=87h5jo680u.fsf@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=tdevries@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox