This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Call target_can_download_tracepoint if there are tracepoints to download
- From: Pedro Alves <palves at redhat dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>, gdb-patches at sourceware dot org
- Date: Wed, 09 Sep 2015 11:40:17 +0100
- Subject: Re: [PATCH] Call target_can_download_tracepoint if there are tracepoints to download
- Authentication-results: sourceware.org; auth=none
- References: <1441721612-15314-1-git-send-email-yao dot qi at linaro dot org>
On 09/08/2015 03:13 PM, Yao Qi wrote:
> Nowadays, GDB calls target_can_download_tracepoint at the entry of
> download_tracepoint_locations, which is called by.
> update_global_location_list. Sometimes, it is not needed to call
> target_can_download_tracepoint at all because there is no tracepoint
> created. In remote target, target_can_download_tracepoint send
> qTStatus to the remote in order to know whether tracepoint can be
> downloaded or not. This means some redundant qTStatus packets are
> sent.
>
> This patch is to teach GDB to call target_can_download_tracepoint
> lazily, only on the moment there are tracepoint to download.
> gdb.perf/single-step.exp (with a local patch to measure RSP packets)
> shows the number of RSP packets is reduced because there is no
> tracepoint at all, so GDB doesn't send qTStatus any more.
>
> # of RSP packets
> original patched
> single-step rsp 1000 7000 6000
> single-step rsp 2000 14000 12000
> single-step rsp 3000 21000 18000
> single-step rsp 4000 28000 24000
>
> Regression tested on x86_64-linux, both native and gdbserver.
Awesome. These qTStatus packets have bothered me before too.
The patch looks fine to me.
>
> gdb:
>
> 2015-09-08 Yao Qi <yao.qi@linaro.org>
>
> * breakpoint.c (download_tracepoint_locations): New local
> can_download_tracepoint. Check the result of
> target_can_download_tracepoint and save it in
> can_download_tracepoint if there are tracepoints to download.
> * linux-nat.h (enum tribool): Move it to ...
> * defs.h: ... here.
I'd suggest moving tribool in common/common-types.h. It's just
be a matter of time before we want to use this in gdbserver too..
Thanks,
Pedro Alves