From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6383 invoked by alias); 25 Feb 2013 09:13:02 -0000 Received: (qmail 6373 invoked by uid 22791); 25 Feb 2013 09:13:01 -0000 X-SWARE-Spam-Status: No, hits=-8.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,TW_CP,TW_XS X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Feb 2013 09:12:57 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 25 Feb 2013 01:11:32 -0800 X-ExtLoop1: 1 Received: from irsmsx104.ger.corp.intel.com ([163.33.3.159]) by orsmga002.jf.intel.com with ESMTP; 25 Feb 2013 01:12:55 -0800 Received: from irsmsx151.ger.corp.intel.com (163.33.192.59) by IRSMSX104.ger.corp.intel.com (163.33.3.159) with Microsoft SMTP Server (TLS) id 14.1.355.2; Mon, 25 Feb 2013 09:12:54 +0000 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.108]) by IRSMSX151.ger.corp.intel.com ([169.254.4.144]) with mapi id 14.01.0355.002; Mon, 25 Feb 2013 09:12:54 +0000 From: "Metzger, Markus T" To: "Pedro Alves (palves@redhat.com)" CC: "Jan Kratochvil (jan.kratochvil@redhat.com)" , "gdb-patches@sourceware.org" , "markus.t.metzger@gmail.com" Subject: FW: [rfc] remote, btrace: add branch tracing protocol to Qbtrace packet Date: Mon, 25 Feb 2013 09:13:00 -0000 Message-ID: References: <1361546562-26827-1-git-send-email-markus.t.metzger@intel.com> In-Reply-To: <1361546562-26827-1-git-send-email-markus.t.metzger@intel.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00622.txt.bz2 Hi Pedro, Jan recommended that you review this patch about changes to the remote serial protocol. Thanks, Markus. -----Original Message----- From: Metzger, Markus T=20 Sent: Friday, February 22, 2013 4:23 PM To: jan.kratochvil@redhat.com Cc: gdb-patches@sourceware.org; markus.t.metzger@gmail.com; Metzger, Markus= T Subject: [rfc] remote, btrace: add branch tracing protocol to Qbtrace packet From: Markus Metzger We might want to add support for LBR branch tracing in the future. To prepare for this, I would specify the branch trace recording method in the Qbtrace packet when requesting branch tracing. The supported branch trace recording methods will further be listed in response to a QSupported packet. The patch works but I'm not sure whether it is in the spirit of the remote serial protocol. This patch does not enable GDB to support different recording methods. GDB still only supports BTS-based branch trace recording. But I hope this will avoid having to change the remote serial protocol later on when we want to add the new recording method. 2013-02-22 Markus Metzger --- gdb/doc/gdb.texinfo | 10 +++++++--- gdb/gdbserver/server.c | 6 +++--- gdb/remote.c | 4 ++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index d6842f1..ec934a5 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -37570,7 +37570,10 @@ rather than reporting the hit to @value{GDBN}. The remote stub understands the @samp{qbtrace} packet. =20 @item Qbtrace -The remote stub understands the @samp{Qbtrace} packet. +The remote stub understands the @samp{Qbtrace} packet. The branch +trace recording method will be specified after the packet name +separated by a single colon (@code{:}). There will be one entry for +each supported branch trace recording method. =20 @end table =20 @@ -37951,8 +37954,9 @@ No new branch trace data is available. A badly formed request or an error was encountered. @end table =20 -@item Qbtrace:on -Enable branch tracing for the current thread. +@item Qbtrace:@var{method} +Enable branch tracing for the current thread using the @var{method} +branch trace recording method. =20 Reply: @table @samp diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index c335af7..debef5d 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -463,12 +463,12 @@ handle_btrace_general_set (char *own_buf) =20 err =3D NULL; =20 - if (strcmp (op, "on") =3D=3D 0) + if (strcmp (op, "bts") =3D=3D 0) err =3D handle_btrace_enable (thread); else if (strcmp (op, "off") =3D=3D 0) err =3D handle_btrace_disable (thread); else - err =3D "E.Bad Qbtrace operation. Use on or off."; + err =3D "E.Bad Qbtrace operation. Use bts or off."; =20 if (err !=3D 0) strcpy (own_buf, err); @@ -1828,7 +1828,7 @@ handle_query (char *own_buf, int packet_len, int *new= _packet_len_p) if (target_supports_btrace ()) { strcat (own_buf, ";qbtrace+"); - strcat (own_buf, ";Qbtrace+"); + strcat (own_buf, ";Qbtrace:bts+"); strcat (own_buf, ";qXfer:btrace:read+"); } =20 diff --git a/gdb/remote.c b/gdb/remote.c index 6f95125..2322ece 100755 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -11164,7 +11164,7 @@ send_Qbtrace (ptid_t ptid, int enable) set_general_thread (ptid); =20 buf +=3D xsnprintf (buf, endbuf - buf, "%s:", packet->name); - buf +=3D xsnprintf (buf, endbuf - buf, enable ? "on" : "off"); + buf +=3D xsnprintf (buf, endbuf - buf, enable ? "bts" : "off"); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); =20 @@ -11928,7 +11928,7 @@ Show the maximum size of the address (in bits) in a= memory packet."), NULL, "qbtrace", "query-btrace", 0); =20 add_packet_config_cmd (&remote_protocol_packets[PACKET_Qbtrace], - "Qbtrace", "enable-btrace", 0); + "Qbtrace:bts", "enable-btrace", 0); =20 add_packet_config_cmd (&remote_protocol_packets[PACKET_qXfer_btrace], "qXfer:btrace", "read-btrace", 0); --=20 1.7.1 Intel GmbH Dornacher Strasse 1 85622 Feldkirchen/Muenchen, Deutschland Sitz der Gesellschaft: Feldkirchen bei Muenchen Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk Registergericht: Muenchen HRB 47456 Ust.-IdNr./VAT Registration No.: DE129385895 Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052