From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64551 invoked by alias); 6 Jun 2016 06:38:05 -0000 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 Received: (qmail 64534 invoked by uid 89); 6 Jun 2016 06:38:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=nicole, Nicole, Amtsgericht, amtsgericht X-HELO: mga11.intel.com Received: from mga11.intel.com (HELO mga11.intel.com) (192.55.52.93) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Jun 2016 06:37:54 +0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 05 Jun 2016 23:37:53 -0700 X-ExtLoop1: 1 Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2016 23:37:53 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.117]) by IRSMSX153.ger.corp.intel.com ([169.254.9.105]) with mapi id 14.03.0248.002; Mon, 6 Jun 2016 07:37:51 +0100 From: "Metzger, Markus T" To: Simon Marchi , "gdb-patches@sourceware.org" Subject: RE: [PATCH] Add method/format information to =record-started Date: Mon, 06 Jun 2016 06:38:00 -0000 Message-ID: References: <20160603155220.22286-1-simon.marchi@ericsson.com> In-Reply-To: <20160603155220.22286-1-simon.marchi@ericsson.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-06/txt/msg00077.txt.bz2 > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Simon Marchi > Sent: Friday, June 3, 2016 5:52 PM > To: gdb-patches@sourceware.org > Cc: Simon Marchi > Subject: [PATCH] Add method/format information to =3Drecord-started >=20 > Eclipse CDT now supports enabling execution recording using two methods > (full and btrace) and both formats for btrace (bts and pt). In the > event that recording is enabled behind the back of the GUI (by the user > on the command line, or a script), we need to know which method/format > are being used, so it can be correctly reflected in the interface. This > patch adds this information to the =3Drecord-started async record. >=20 > Before: >=20 > =3Drecord-started,thread-group=3D"i1" >=20 > After: >=20 > =3Drecord-started,thread-group=3D"i1",method=3D"btrace",format=3D"bts" > =3Drecord-started,thread-group=3D"i1",method=3D"btrace",format=3D"pt" > =3Drecord-started,thread-group=3D"i1",method=3D"full" >=20 > The "format" field is only present when the current method supports > multiple formats (only the btrace method as of now). Thanks for adding this. > @@ -407,8 +409,30 @@ mi_record_changed (struct inferior *inferior, int st= arted) > old_chain =3D make_cleanup_restore_target_terminal (); > target_terminal_ours_for_output (); >=20 > - fprintf_unfiltered (mi->event_channel, "record-%s,thread-group=3D\"i%= d\"", > - started ? "started" : "stopped", inferior->num); > + if (started) > + { > + if (format !=3D NULL) > + { Do we really need braces, here... > + fprintf_unfiltered ( > + mi->event_channel, > + "record-started,thread- > group=3D\"i%d\",method=3D\"%s\",format=3D\"%s\"", > + inferior->num, method, format); > + } > + else > + { > + ...and here... > + fprintf_unfiltered ( > + mi->event_channel, > + "record-started,thread-group=3D\"i%d\",method=3D\"%s\"", > + inferior->num, method); > + } > + } > + else > + { ...and here? > + fprintf_unfiltered (mi->event_channel, > + "record-stopped,thread-group=3D\"i%d\"", inferior- > >num); > + } > + > @@ -234,7 +235,8 @@ record_btrace_open (const char *args, int from_tty) > NULL); > record_btrace_generating_corefile =3D 0; >=20 > - observer_notify_record_changed (current_inferior (), 1); > + format =3D record_btrace_conf.format =3D=3D BTRACE_FORMAT_PT ? "pt" : = "bts"; I'd use a switch here and not assume that format !=3D pt means bts. If we = added another format (LBR maybe?) we might miss this. Regards, Markus. Intel Deutschland GmbH Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Christin Eisenschmid, Christian Lamprechter Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928