Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Markus Metzger <markus.t.metzger@intel.com>
Cc: gdb-patches@sourceware.org, markus.t.metzger@gmail.com,
	       Pedro Alves <palves@redhat.com>,
	Eli Zaretskii <eliz@gnu.org>
Subject: Re: [patch v9 23/23] btrace, remote: drop qbtrace packet
Date: Tue, 05 Mar 2013 20:15:00 -0000	[thread overview]
Message-ID: <20130305201450.GW2386@host2.jankratochvil.net> (raw)
In-Reply-To: <1362416770-19750-24-git-send-email-markus.t.metzger@intel.com>

On Mon, 04 Mar 2013 18:06:10 +0100, Markus Metzger wrote:
> Use the qXfer:btrace:read packet's annex to encode a trace read method:
> 
>   all ... read all trace
>   new ... read all trace if the trace has changed

BTW fixing previous patches by adding new patches is not right.  It clutters
GDB history.  There will be now target_btrace_has_changed in the history
despite it has never been approved for FSF GDB check-in.

I understand it is easier this way.

But GDB existing in many source variants and people (yes, incl. me) dig into
its history for various backports, regressions finding etc. so a minimal
logical changes are preferred.

Please merge it with the appropriate parts.


> 
> This obsoletes the need for the qbtrace packet.
> 
> CC: Pedro Alves <palves@redhat.com>
> CC: Jan Kratochvil <jan.kratochvil@redhat.com>
> CC: Eli Zaretskii <eliz@gnu.org>
> 
> 2013-03-04  Markus Metzger  <markus.t.metzger@intel.com>
> 
> 	* target.h (target_ops) <to_read_btrace>: Add type parameter.
> 	(target_ops) <to_btrace_has_changed>: Remove.
> 	(target_btrace_has_changed): Remove.
> 	(target_read_btrace): Add type parameter.
> 	* target.c (target_read_btrace): Add type parameter.
> 	(target_btrace_has_changed): Remove.
> 	* remote.c (PACKET_qbtrace): Remove.
> 	(remote_protocol_features): Remove qbtrace.
> 	(remote_supports_btrace): Remove check for qbtrace.
> 	(remote_btrace_has_changed): Remove.
> 	(remote_read_btrace): Consider read type.
> 	(init_remote_ops): Remove to_disable_btrace.
> 	(_initialize_remote): Remove qbtrace.
> 	* i386-linux-nat.c (_initialize_i386_linux_nat): Remove
> 	initialization of to_btrace_has_changed.
> 	* common/linux-btrace.h (linux_read_btrace): Add type parameter.
> 	(linux_btrace_has_changed): Removed.
> 	* common/linux-btrace.c (linux_btrace_has_changed): Moved.
> 	Changed to static.
> 	(linux_read_btrace): Consider read type.
> 	* common/btrace-common.h (btrace_read_type): New enum.
> 	* btrace.c (btrace_fetch): Only update branch trace if it
> 	changed.
> 	* amd64-linux-nat.c (_initialize_amd64_linux_nat): Remove
> 	initialization of to_btrace_has_changed.
> 
> gdbserver/
> 
> 	* target.h (target_ops): Remove btrace_has_changed. Add type
> 	parameter to read_btrace. Update target_ macros.
> 	* server.c: Include btrace-common.h.
> 	(handle_qxfer_btrace): Consider read type in annex.
> 	(handle_btrace_query): Removed.
> 	(handle_query): Remove qbtrace from qSupported. Remove call to
> 	handle_btrace_query.
> 	* linux-low.c (linux_low_read_btrace): Consider read type.
> 	(linux_target_ops): Remove linux_btrace_has_changed.
> 
> doc/
> 
> 	* gdb.texinfo (Remote Configuration): Remove qbtrace.
> 	Describe annex of Qbtrace.
[...]
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
[...]
>  /* Read the branch trace.  */
>  
>  static VEC (btrace_block_s) *
> -remote_read_btrace (struct btrace_target_info *tinfo)
> +remote_read_btrace (struct btrace_target_info *tinfo,
> +		    enum btrace_read_type type)
>  {
>    struct packet_config *packet = &remote_protocol_packets[PACKET_qXfer_btrace];
>    struct remote_state *rs = get_remote_state ();
>    VEC (btrace_block_s) *btrace = NULL;
> +  const char *annex;
>    char *xml;
>  
>    if (packet->support != PACKET_ENABLE)
> @@ -11268,8 +11223,21 @@ remote_read_btrace (struct btrace_target_info *tinfo)
>    error (_("Cannot process branch tracing result. XML parsing not supported."));
>  #endif
>  
> +  switch (type)
> +    {
> +    case btrace_read_all:
> +      annex = "all";
> +      break;
> +    case btrace_read_new:
> +      annex = "new";
> +      break;
> +    default:

Here should be internal_error call.  It just cannot happen in valid GDB
binary.


> +      annex = NULL;
> +      break;
> +    }
> +
>    xml = target_read_stralloc (&current_target,
> -                              TARGET_OBJECT_BTRACE, NULL);
> +                              TARGET_OBJECT_BTRACE, annex);
>    if (xml != NULL)
>      {
>        struct cleanup *cleanup = make_cleanup (xfree, xml);


  parent reply	other threads:[~2013-03-05 20:15 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-04 17:07 [patch v9 00/23] branch tracing support for Atom Markus Metzger
2013-03-04 17:07 ` [patch v9 07/23] gdbserver, btrace: add generic btrace support Markus Metzger
2013-03-05 20:08   ` Jan Kratochvil
2013-03-06  9:15     ` Metzger, Markus T
2013-03-06 13:22   ` Jan Kratochvil
2013-03-04 17:07 ` [patch v9 10/23] remote, btrace: add branch tracing protocol to Qbtrace packet Markus Metzger
2013-03-05 20:09   ` Jan Kratochvil
2013-03-06  9:19     ` Metzger, Markus T
2013-03-04 17:07 ` [patch v9 02/23] linux, btrace: perf_event based branch tracing Markus Metzger
2013-03-05 20:06   ` Jan Kratochvil
2013-03-06 10:11   ` Mark Kettenis
2013-03-06 10:29     ` Metzger, Markus T
2013-03-04 17:07 ` [patch v9 04/23] xml, btrace: define btrace xml document style Markus Metzger
2013-03-05 20:07   ` Jan Kratochvil
2013-03-04 17:07 ` [patch v9 03/23] linux, i386, amd64: enable btrace for 32bit and 64bit linux native Markus Metzger
2013-03-05 20:06   ` Jan Kratochvil
2013-03-04 17:07 ` [patch v9 08/23] gdbserver, linux, btrace: add btrace support for linux-low Markus Metzger
2013-03-05 20:09   ` Jan Kratochvil
2013-03-06  9:17     ` Metzger, Markus T
2013-03-06 13:33   ` Jan Kratochvil
2013-03-04 17:07 ` [patch v9 01/23] thread, btrace: add generic branch trace support Markus Metzger
2013-03-05 20:06   ` Jan Kratochvil
2013-03-05 22:02     ` Tom Tromey
2013-03-06 21:11   ` Doug Evans
2013-03-07  7:50     ` Metzger, Markus T
2013-03-07 22:57       ` Doug Evans
2013-03-04 17:07 ` [patch v9 05/23] remote, btrace: add branch trace remote ops Markus Metzger
2013-03-05 20:07   ` Jan Kratochvil
2013-03-06  9:00     ` Metzger, Markus T
2013-03-04 17:07 ` [patch v9 16/23] record: default target methods Markus Metzger
2013-03-05 20:10   ` Jan Kratochvil
2013-03-04 17:08 ` [patch v9 22/23] testsuite, gdb.btrace: add btrace tests Markus Metzger
2013-03-04 19:47   ` Jan Kratochvil
2013-03-05  6:39     ` Metzger, Markus T
2013-03-05 20:14   ` Jan Kratochvil
2013-03-06 15:32     ` christian.himpel
2013-03-06 16:35       ` Jan Kratochvil
2013-03-04 17:08 ` [patch v9 06/23] btrace, doc: document remote serial protocol Markus Metzger
2013-03-04 18:08   ` Eli Zaretskii
2013-03-05 20:08   ` Jan Kratochvil
2013-03-06  9:06     ` Metzger, Markus T
2013-03-06  9:50       ` Jan Kratochvil
2013-03-06 10:01         ` Metzger, Markus T
2013-03-06 12:07           ` Jan Kratochvil
2013-03-06 12:13             ` Metzger, Markus T
2013-03-06 12:17               ` Jan Kratochvil
2013-03-04 17:08 ` [patch v9 11/23] target: add add_deprecated_target_alias Markus Metzger
2013-03-05 20:09   ` Jan Kratochvil
2013-03-04 17:08 ` [patch v9 20/23] record-btrace, disas: omit pc prefix Markus Metzger
2013-03-05 20:13   ` Jan Kratochvil
2013-03-04 17:08 ` [patch v9 19/23] record, btrace: add record-btrace target Markus Metzger
2013-03-05 20:13   ` Jan Kratochvil
2013-03-06  9:57     ` Metzger, Markus T
2013-03-06 13:35       ` Jan Kratochvil
2013-03-06 14:01         ` Metzger, Markus T
2013-03-06 16:28   ` Jan Kratochvil
2013-03-04 17:08 ` [patch v9 09/23] btrace, x86: disable on some processors Markus Metzger
2013-03-05 20:09   ` Jan Kratochvil
2013-03-04 17:09 ` [patch v9 17/23] record: add "record instruction-history" command Markus Metzger
2013-03-04 18:14   ` Eli Zaretskii
2013-03-05 20:11   ` Jan Kratochvil
2013-03-04 17:09 ` [patch v9 14/23] record-full.c: rename record_ in record_full_ Markus Metzger
2013-03-05 20:10   ` Jan Kratochvil
2013-03-04 17:09 ` [patch v9 15/23] record-full.h: rename record_ into record_full_ Markus Metzger
2013-03-05 20:10   ` Jan Kratochvil
2013-03-04 17:09 ` [patch v9 13/23] record: make it build again Markus Metzger
2013-03-05 20:10   ` Jan Kratochvil
2013-03-04 17:09 ` [patch v9 21/23] doc, record: document record changes Markus Metzger
2013-03-04 18:13   ` Eli Zaretskii
2013-03-05 20:13   ` Jan Kratochvil
2013-03-04 17:09 ` [patch v9 18/23] record: add "record function-call-history" command Markus Metzger
2013-03-04 18:07   ` Eli Zaretskii
2013-03-05 20:12   ` Jan Kratochvil
2013-03-04 17:09 ` [patch v9 23/23] btrace, remote: drop qbtrace packet Markus Metzger
2013-03-04 18:15   ` Eli Zaretskii
2013-03-05 20:15   ` Jan Kratochvil [this message]
2013-03-04 17:10 ` [patch v9 12/23] record: split record Markus Metzger
2013-03-05 20:09   ` Jan Kratochvil
2013-03-06 12:43 ` Crash of GDB with gdbserver btrace enabled [Re: [patch v9 00/23] branch tracing support for Atom] Jan Kratochvil
2013-03-06 14:40   ` Metzger, Markus T
2013-03-06 15:31     ` Metzger, Markus T
2013-03-06 17:06       ` Jan Kratochvil
2013-03-06 18:08         ` Metzger, Markus T
2013-03-07  9:06           ` Jan Kratochvil
2013-03-07  9:41             ` Metzger, Markus T
2013-03-07 10:00               ` Metzger, Markus T
2013-03-07 10:14                 ` Jan Kratochvil
2013-03-07 10:33                   ` Metzger, Markus T
2013-03-07 12:07                     ` Jan Kratochvil
2013-03-07 12:33                       ` Metzger, Markus T
2013-03-07 14:45                         ` Jan Kratochvil
2013-03-07 15:22                           ` Metzger, Markus T
2013-03-07 15:46                             ` Jan Kratochvil
2013-03-07 15:12                         ` Pedro Alves
2013-03-07 15:33                           ` Metzger, Markus T
2013-03-07 15:39                             ` Jan Kratochvil
2013-03-07 15:41                             ` Pedro Alves
     [not found]                           ` <20130318170643.GA15625@host2.jankratochvil.net>
     [not found]                             ` <514758DA.2060905@redhat.com>
2013-03-20 15:52                               ` [commit] [patch] Code cleanup: Remove parameter quitting [Re: Crash of GDB with gdbserver btrace enabled] Jan Kratochvil
     [not found]                               ` <20130318192604.GA2786@host2.jankratochvil.net>
     [not found]                                 ` <51477828.30000@redhat.com>
2013-03-26  0:15                                   ` Jan Kratochvil
2013-04-03 18:05                                     ` Pedro Alves
2013-03-07 10:08               ` Crash of GDB with gdbserver btrace enabled [Re: [patch v9 00/23] branch tracing support for Atom] Jan Kratochvil
2013-03-06 15:41   ` Jan Kratochvil

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=20130305201450.GW2386@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=markus.t.metzger@gmail.com \
    --cc=markus.t.metzger@intel.com \
    --cc=palves@redhat.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