From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 57234 invoked by alias); 24 Feb 2017 09:33:37 -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 57218 invoked by uid 89); 24 Feb 2017 09:33:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.6 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=NEXT, Tel, tel, office 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; Fri, 24 Feb 2017 09:33:34 +0000 Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2017 01:33:33 -0800 X-ExtLoop1: 1 Received: from irsmsx151.ger.corp.intel.com ([163.33.192.59]) by fmsmga005.fm.intel.com with ESMTP; 24 Feb 2017 01:33:33 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.142]) by IRSMSX151.ger.corp.intel.com ([169.254.4.20]) with mapi id 14.03.0248.002; Fri, 24 Feb 2017 09:33:32 +0000 From: "Metzger, Markus T" To: "Wiederhake, Tim" , "gdb-patches@sourceware.org" Subject: RE: [PATCH 08/11] [SQUASH] btrace: Adjust struct btrace_function::{flow,segment}. Date: Fri, 24 Feb 2017 09:33:00 -0000 Message-ID: References: <1487337989-6367-1-git-send-email-tim.wiederhake@intel.com> <1487337989-6367-9-git-send-email-tim.wiederhake@intel.com> In-Reply-To: <1487337989-6367-9-git-send-email-tim.wiederhake@intel.com> Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg00665.txt.bz2 > -----Original Message----- > From: Wiederhake, Tim > Sent: Friday, February 17, 2017 2:26 PM > To: gdb-patches@sourceware.org > Cc: Metzger, Markus T > Subject: [PATCH 08/11] [SQUASH] btrace: Adjust struct > btrace_function::{flow,segment}. Hello Tim, > - /* The previous and next segment belonging to the same function. > - If a function calls another function, the former will have at least > - two segments: one before the call and another after the return. */ > - struct btrace_func_link segment; > - > - /* The previous and next function in control flow order. */ > - struct btrace_func_link flow; > + /* The function segment numbers of the previous and next segment belon= ging > to > + the same function. If a function calls another function, the forme= r will > + have at least two segments: one before the call and another after t= he > + return. Will be zero if there is no such function segment. */ > + unsigned int prev_segment; > + unsigned int next_segment; Since we don't need FLOW.PREV/NEXT anymore, I'd omit _SEGMENT in the name and just call it PREV and NEXT. The comment will describe what they mean. If we manage to not needing to squash the patches, I'd keep the two parts s= eparate. =20 > - for (; bfun !=3D NULL; bfun =3D bfun->flow.next) > - bfun->level +=3D adjustment; > + while (bfun !=3D NULL) > + { > + bfun->level +=3D adjustment; > + bfun =3D ftrace_find_call_by_number (btinfo, bfun->number + 1); > + } Could we do a VEC_iterate instead? > level =3D INT_MAX; > - for (; bfun !=3D end; bfun =3D bfun->flow.next) > - level =3D std::min (level, bfun->level); > + while (bfun !=3D end) > + { > + level =3D std::min (level, bfun->level); > + bfun =3D ftrace_find_call_by_number (btinfo, bfun->number + 1); > + } Same here. Thanks, 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