From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11849 invoked by alias); 9 May 2017 13:14:44 -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 11102 invoked by uid 89); 9 May 2017 13:14:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=sk:owner@s, ownersourcewareorg, sk:owners, owner@sourceware.org X-HELO: mga04.intel.com Received: from mga04.intel.com (HELO mga04.intel.com) (192.55.52.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 09 May 2017 13:14:41 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2017 06:14:37 -0700 X-ExtLoop1: 1 Received: from irsmsx102.ger.corp.intel.com ([163.33.3.155]) by fmsmga001.fm.intel.com with ESMTP; 09 May 2017 06:14:37 -0700 Received: from irsmsx111.ger.corp.intel.com (10.108.20.4) by IRSMSX102.ger.corp.intel.com (163.33.3.155) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 9 May 2017 14:14:36 +0100 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.163]) by irsmsx111.ger.corp.intel.com ([169.254.2.58]) with mapi id 14.03.0319.002; Tue, 9 May 2017 14:14:36 +0100 From: "Wiederhake, Tim" To: Simon Marchi CC: "gdb-patches@sourceware.org" , "Metzger, Markus T" Subject: RE: [PATCH v3 04/12] btrace: Use function segment index in call iterator. Date: Tue, 09 May 2017 13:14:00 -0000 Message-ID: <9676A094AF46E14E8265E7A3F4CCE9AF3C14CD43@irsmsx105.ger.corp.intel.com> References: <1494312929-22749-1-git-send-email-tim.wiederhake@intel.com> <1494312929-22749-5-git-send-email-tim.wiederhake@intel.com> <41edfcfb42636c7888cdc4660696f593@polymtl.ca> In-Reply-To: <41edfcfb42636c7888cdc4660696f593@polymtl.ca> dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-05/txt/msg00210.txt.bz2 Hi Simon! Thanks for the review. > -----Original Message----- > From: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] On Behalf Of Simon Marchi > Sent: Tuesday, May 9, 2017 2:51 PM > To: Wiederhake, Tim > Cc: gdb-patches@sourceware.org; Metzger, Markus T > > Subject: Re: [PATCH v3 04/12] btrace: Use function segment index in call > iterator. >=20 > On 2017-05-09 02:55, Tim Wiederhake wrote: > > Remove FUNCTION pointer in struct btrace_call_iterator and use an index > > into > > the list of function segments instead. > > > > 2017-05-09 Tim Wiederhake > > > > gdb/ChangeLog: > > > > * btrace.c (btrace_ends_with_single_insn): New function. > > (btrace_call_get, btrace_call_number, btrace_call_begin, > > btrace_call_end, btrace_call_next, btrace_call_prev, > > btrace_find_call_by_number): Use index into call segment vector > > instead of pointer. > > (btrace_call_cmp): Simplify. > > * btrace.h (struct btrace_call_iterator): Replace function call > > segment > > pointer with index into vector. > > * record-btrace.c (record_btrace_call_history): Use index instead of > > pointer. > > > > --- > > gdb/btrace.c | 198 > > ++++++++++++++++++++++------------------------------ > > gdb/btrace.h | 5 +- > > gdb/record-btrace.c | 2 +- > > 3 files changed, 87 insertions(+), 118 deletions(-) > > > > diff --git a/gdb/btrace.c b/gdb/btrace.c > > index c2d3730..5615aad 100644 > > --- a/gdb/btrace.c > > +++ b/gdb/btrace.c > > @@ -2527,12 +2527,33 @@ btrace_find_insn_by_number (struct > > btrace_insn_iterator *it, > > return 1; > > } > > > > +/* Returns a non-zero value if the recording ends with a function > > segment that > > + contains only a single (i.e. the current) instruction. */ > > + > > +static int >=20 > bool? Right, changed locally. > Otherwise, it LGTM. I'm not familiar with the btrace specific > computations, but it made sense to me. I trust that you guys know what > you are doing and have tested it enough :). I tested the patches on i686 and x86_64 -- maybe I should have mentioned th= at. > If I understand correctly, btrace_function::number is 1-based? If so, > it would be good to mention it somewhere (if it's not already, but I > couldn't find it). See the comment on btrace_thread_info::functions :). >=20 > Thanks, >=20 > Simon Regards, Tim 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