Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>,
	"akamath996@gmail.com" <akamath996@gmail.com>,
	"tom@tromey.com" <tom@tromey.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	SANGAMESH MALLAYYA <sangamesh.swamy@in.ibm.com>,
	Aditya Kamath <Aditya.Kamath1@ibm.com>
Subject: Re: [PATCH v2] Speed up next/step while debugging multithreaded programs on AIX.
Date: Thu, 10 Sep 2026 09:45:16 -0400	[thread overview]
Message-ID: <2207a4ad-d2c5-43a2-9d91-4c6d80b1558b@polymtl.ca> (raw)
In-Reply-To: <f341ce7e2c62377bc3c9580e2229c1a86de42183.camel@de.ibm.com>



On 2026-09-10 09:14, Ulrich Weigand wrote:
> Aditya Vidyadhar Kamath <akamath996@gmail.com> wrote:
> 
> +      /* Attempt to sync_threadlists() only when debugging object
> files
> +	 and not core files since the list of threads never changes
> for
> +	 core files.  Even for live inferiors, skip the sync when the
> +	 thread count matches the previous stop.  */
> 
> This last part seems racy to me.  In principle, it is possible
> that one thread terminated and simultaneously one new thread was
> created, since the last time we stopped.  In this case, the thread
> count would be the same, but the thread list still incorrect.
> 
> Given the other test for single-stepping, is this particular
> check even still resulting in a noticeable performance
> difference?

I would suggest making a patch with just the get_signaled_thread batch
change first, since that one looks fairly safe and low hanging fruit.
Then, measure again and then look for the next optimization.

I would suggest using the "scoped_time_it" class to measure the
execution time of various functions and scopes.  This object measures
the time spent between its construction and destruction.  On
destruction, it prints a line like:

  Time for "DWARF indexing worker": wall 0.195, user 0.130, sys 0.033, user+sys 0.163, 83.6 % CPU

Include that information in your future commit messages (the before and
after).  That will give us an accurate picture of where time is spent,
and how much each optimization helps.

Just sprinkle it like this:

  {
    scoped_time_it time_it ("doing something");

    ...
  }

And then enable it with:

  (gdb) maintenance set per-command time on

Simon

  reply	other threads:[~2026-09-10 13:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 10:16 Aditya Vidyadhar Kamath
2026-09-10 13:14 ` Ulrich Weigand
2026-09-10 13:45   ` Simon Marchi [this message]
2026-09-10 13:25 ` Simon Marchi
2026-09-10 17:32 ` Abhay Kandpal

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=2207a4ad-d2c5-43a2-9d91-4c6d80b1558b@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=Aditya.Kamath1@ibm.com \
    --cc=Ulrich.Weigand@de.ibm.com \
    --cc=akamath996@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sangamesh.swamy@in.ibm.com \
    --cc=tom@tromey.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