From: "Ijaz, Abdul B via Gdb" <gdb@sourceware.org>
To: Martin Simmons <qqxnjvamvxwx@dyxyl.com>
Cc: "gdb@sourceware.org" <gdb@sourceware.org>,
"Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>,
"Schimpe, Christina" <christina.schimpe@intel.com>,
"Metzger, Markus T" <markus.t.metzger@intel.com>
Subject: RE: [RFC] New command "thread filter" in GDB
Date: Mon, 28 Oct 2024 22:26:02 +0000 [thread overview]
Message-ID: <SA1PR11MB68464B7CA31B6BB28DDF2CCBCB4A2@SA1PR11MB6846.namprd11.prod.outlook.com> (raw)
In-Reply-To: <jeplnk7x0c.fsf@localhost>
Thanks Martin for the feedback.
>> * info threads 1 2 3 4
>> * “info thread” command print thread info for thread ids “1 2 3 4 5”
Martin > Are you also proposing an extension to "info threads" and "threads apply"? Otherwise, I don't see how a script can use the result of "thread filter" in those commands.
Maybe some extension to allow a string type list from a variable like in the following (currently, you get an error "History value must have integer type.")?
Abdul > The output of this command can still be used by only copying the value inside the quotes and discarding the double quotes for "info threads" or "thread apply" commands in current gdb. But, yes eventually, "info threads" and "thread apply" command will be extended to use the output of this command from history value. This is the reason that the output of this command is proposed a space separated list of ids a string value and added to history to make it more useable. E.g.
"
thread filter all $_thread<5
Filtered threads:
$1 = “1 2 3 4”
$ info threads 1 2 3 4
"
Thanks & Best Regards
Abdul Basit
-----Original Message-----
From: Martin Simmons <qqxnjvamvxwx@dyxyl.com>
Sent: Monday, October 28, 2024 10:12 PM
To: Ijaz, Abdul B <abdul.b.ijaz@intel.com>
Cc: gdb@sourceware.org; Aktemur, Tankut Baris <tankut.baris.aktemur@intel.com>; Schimpe, Christina <christina.schimpe@intel.com>; Metzger, Markus T <markus.t.metzger@intel.com>
Subject: Re: [RFC] New command "thread filter" in GDB
>>>>> On Wed, 2 Oct 2024 07:24:21 +0000, Ijaz, Abdul B via Gdb said:
>
> Hi All,
>
> I am writing to collect your feedback for the new command “thread filter”, we would like to introduce. This new command will process the input list of threads and then try to filter them if there is any expression in the input. So it print only filtered thread ids from the input list where the input expression evaluates to true. Here are some examples for the usage of this command:
>
>
> * thread filter 1-9
> * Outputs the ids of threads with single digit
> * thread filter all x > 10
> * Outputs the ids of threads in whose context the variable “x” is greater than 10.
> * thread filter 10-99 $_thread % 2 == 0
> * Outputs the ids of threads whose id is a two-digit even number.
> * thread filter all predicate()
> * Outputs the ids of thread for which the function “predicate” evaluates to true.
> * thread filter all workitem == 1234
> * Find the thread(s) for which the “workitem” variable has a specific value.
>
> Output of all these commands will be string type list of thread ids
> which may be used later for other commands like thread apply, info
> thread or further filtering. For example
>
> * thread filter all $_thread<5
>
> Filtered threads:
>
> $1 = “1 2 3 4”
>
>
> Examples of output usage in other command like “info thread” or “thread apply”:
>
> * info threads 1 2 3 4
> * “info thread” command print thread info for thread ids “1 2 3 4 5”
Are you also proposing an extension to "info threads" and "threads apply"? Otherwise, I don't see how a script can use the result of "thread filter" in those commands.
Maybe some extension to allow a string type list from a variable like in the following (currently, you get an error "History value must have integer type.")?
info threads $1
thread apply $1 p workitem
__Martin
Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928
prev parent reply other threads:[~2024-10-28 22:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-02 7:24 Ijaz, Abdul B via Gdb
[not found] ` <PH0PR11MB7636DBD9F1AAFE6076A636D3F9432@PH0PR11MB7636.namprd11.prod.outlook.com>
2024-10-28 11:57 ` [PING][RFC] " Ijaz, Abdul B via Gdb
2024-10-28 13:41 ` Dov Grobgeld via Gdb
2024-10-28 20:10 ` Ijaz, Abdul B via Gdb
2024-10-28 14:44 ` [RFC] " Andrew Burgess via Gdb
2024-10-28 20:46 ` Ijaz, Abdul B via Gdb
2024-10-29 10:11 ` Martin Simmons
2024-10-28 21:12 ` Martin Simmons
2024-10-28 22:26 ` Ijaz, Abdul B via Gdb [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=SA1PR11MB68464B7CA31B6BB28DDF2CCBCB4A2@SA1PR11MB6846.namprd11.prod.outlook.com \
--to=gdb@sourceware.org \
--cc=abdul.b.ijaz@intel.com \
--cc=christina.schimpe@intel.com \
--cc=markus.t.metzger@intel.com \
--cc=qqxnjvamvxwx@dyxyl.com \
--cc=tankut.baris.aktemur@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox