From: Simon Marchi <simark@simark.ca>
To: Pedro Alves <pedro@palves.net>,
"Aktemur, Tankut Baris" <tankut.baris.aktemur@intel.com>,
Simon Marchi <simon.marchi@efficios.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: Laurent Morichetti <Laurent.Morichetti@amd.com>
Subject: Re: [PATCH v2] gdb: infrun: consume multiple events at each pass in stop_all_threads
Date: Fri, 15 May 2020 12:06:25 -0400 [thread overview]
Message-ID: <d73950df-9edd-a45e-ebab-1a8cbd750abd@simark.ca> (raw)
In-Reply-To: <5ac9bb7a-6bf0-401f-909e-54d98739685b@palves.net>
On 2020-05-14 2:14 p.m., Pedro Alves wrote:
> On 5/14/20 7:02 PM, Simon Marchi wrote:
>
>> Here's a rebased version.
>
> Thanks Simon. Please go ahead and merge.
>
> BTW, did you consider coming up with a mechanism similar to
> make_scoped_defer_target_commit_resume()/target_commit_resume()
> for target_stop, so that we could coalesce the multiple vCont;t
> requests in a single remote packet? That could also cut down
> on latency.
>
> (gdbserver's resume interface is better for that, in that
> a stop, continues and steps all go via the same interface:
>
> static void
> resume (struct thread_resume *actions, size_t num_actions)
> {
>
> I've pondered adjusting GDB's resume interface in a similar
> way. That would make target_commit_resume Just Work for
> stops too.
> )
No, I haven't considered it, but I think I see what you mean. To illustrate this case using
the remote target, I had to set "maintenance set target-non-stop on", while using
"target non-stop off". Am I missing something, is there a more common scenario where
it gets called, using the remote target?
With the above, when hitting a breakpoint, I do see the stops sent in sequence as part
of stop_all_threads:
Sending packet: $vCont;t:p25a703.25a71c#86...Packet received: OK
Sending packet: $vCont;t:p25a703.25a71d#87...Packet received: OK
Sending packet: $vCont;t:p25a703.25a71e#88...Packet received: OK
Sending packet: $vCont;t:p25a703.25a71f#89...Packet received: OK
Sending packet: $vCont;t:p25a703.25a720#54...Packet received: OK
which could easily be coalesced. I think a `target_commit_stop` approach that mimics
`target_commit_resume` would work, without being too invasive. But maybe changing
the `target_stop` interface to accept multiple ptids would be a better approach for
the future, since it's more of a step towards the gdbserver-style interface that you
talked about. In stop_all_threads, it would be quite easy to use: build a vector of
ptid in this loop:
4815 /* Go through all threads looking for threads that we need
4816 to tell the target to stop. */
4817 for (thread_info *t : all_non_exited_threads ())
and call target_stop once after the loop.
Simon
next prev parent reply other threads:[~2020-05-15 16:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 19:36 [PATCH] " Simon Marchi
2020-03-11 19:13 ` Simon Marchi
2020-03-25 16:37 ` [PING][PATCH] " Simon Marchi
2020-04-16 17:51 ` [PATCH] " Pedro Alves
2020-04-16 20:32 ` Simon Marchi
2020-05-14 14:32 ` Aktemur, Tankut Baris
2020-05-14 18:02 ` [PATCH v2] " Simon Marchi
2020-05-14 18:14 ` Pedro Alves
2020-05-15 16:06 ` Simon Marchi [this message]
2020-05-15 16:15 ` Pedro Alves
2020-05-15 16:53 ` Simon Marchi
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=d73950df-9edd-a45e-ebab-1a8cbd750abd@simark.ca \
--to=simark@simark.ca \
--cc=Laurent.Morichetti@amd.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@palves.net \
--cc=simon.marchi@efficios.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