Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Martin Simmons <qqxnjvamvxwx@dyxyl.com>
To: "Ijaz, Abdul B" <abdul.b.ijaz@intel.com>
Cc: gdb@sourceware.org, tankut.baris.aktemur@intel.com,
	christina.schimpe@intel.com, markus.t.metzger@intel.com
Subject: Re: [RFC] New command "thread filter" in GDB
Date: Mon, 28 Oct 2024 21:12:03 +0000	[thread overview]
Message-ID: <jeplnk7x0c.fsf@localhost> (raw)
In-Reply-To: <SA1PR11MB6846B4855C73BC2919F9BCFACB702@SA1PR11MB6846.namprd11.prod.outlook.com> (gdb@sourceware.org)

>>>>> 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

  parent reply	other threads:[~2024-10-28 21:12 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 [this message]
2024-10-28 22:26   ` Ijaz, Abdul B via Gdb

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=jeplnk7x0c.fsf@localhost \
    --to=qqxnjvamvxwx@dyxyl.com \
    --cc=abdul.b.ijaz@intel.com \
    --cc=christina.schimpe@intel.com \
    --cc=gdb@sourceware.org \
    --cc=markus.t.metzger@intel.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