From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51466 invoked by alias); 24 Feb 2017 09:32:24 -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 51451 invoked by uid 89); 24 Feb 2017 09:32:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-6.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_2,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=BEGIN, Tel, tel, office X-HELO: mga06.intel.com Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 24 Feb 2017 09:32:22 +0000 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 24 Feb 2017 01:32:20 -0800 X-ExtLoop1: 1 Received: from irsmsx106.ger.corp.intel.com ([163.33.3.31]) by orsmga005.jf.intel.com with ESMTP; 24 Feb 2017 01:32:20 -0800 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.142]) by IRSMSX106.ger.corp.intel.com ([169.254.8.197]) with mapi id 14.03.0248.002; Fri, 24 Feb 2017 09:32:19 +0000 From: "Metzger, Markus T" To: "Wiederhake, Tim" , "gdb-patches@sourceware.org" Subject: RE: [PATCH 02/11] btrace: Change parameters to use btrace_thread_info. Date: Fri, 24 Feb 2017 09:32:00 -0000 Message-ID: References: <1487337989-6367-1-git-send-email-tim.wiederhake@intel.com> <1487337989-6367-3-git-send-email-tim.wiederhake@intel.com> In-Reply-To: <1487337989-6367-3-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/msg00659.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 02/11] btrace: Change parameters to use btrace_thread_inf= o. Hello Tim, > gdb/ChangeLog: > * btrace.c (ftrace_new_function, ftrace_fixup_caller, ftrace_new_call, > ftrace_new_tailcall, ftrace_find_caller, ftrace_find_call, > ftrace_new_return, ftrace_new_switch, ftrace_new_gap, > ftrace_update_function, ftrace_update_insns, ftrace_connect_bfun, > ftrace_connect_backtrace, ftrace_bridge_gap, > btrace_compute_ftrace_bts, > ftrace_add_pt, btrace_compute_ftrace_pt): Changed to use struct > btrace_thread_info * as parameter. Adjusted comments where Two spaces after '.'. > bfun->msym =3D mfun; > @@ -258,7 +259,8 @@ ftrace_update_caller (struct btrace_function *bfun, > /* Fix up the caller for all segments of a function. */ >=20 > static void > -ftrace_fixup_caller (struct btrace_function *bfun, > +ftrace_fixup_caller (struct btrace_thread_info *btinfo, > + struct btrace_function *bfun, > struct btrace_function *caller, > enum btrace_function_flag flags) > { I assume the new argument will be used in later patches. > @@ -275,18 +277,17 @@ ftrace_fixup_caller (struct btrace_function *bfun, > } >=20 > /* Add a new function segment for a call. > - CALLER is the chronologically preceding function segment. > MFUN and FUN are the symbol information we have for this function. */ Please add 'at the end of the trace' like you did for ftrace_new_function. > ftrace_debug (bfun, "new call"); > @@ -295,18 +296,17 @@ ftrace_new_call (struct btrace_function *caller, > } >=20 > /* Add a new function segment for a tail call. > - CALLER is the chronologically preceding function segment. > MFUN and FUN are the symbol information we have for this function. */ Same here. More instances below. =20 > -/* Add the instruction at PC to BFUN's instructions. */ > +/* Add the instruction at PC to the instructions of the current function= call > + segment at the end of the trace. */ Just "function segment" without the "call". > @@ -1017,7 +1029,7 @@ btrace_compute_ftrace_bts (struct thread_info *tp, > break; > } >=20 > - btinfo->end =3D ftrace_update_function (btinfo->end, pc); > + btinfo->end =3D ftrace_update_function (btinfo, pc); > if (btinfo->begin =3D=3D NULL) > btinfo->begin =3D btinfo->end; It would be cleaner if we moved this BTINFO->BEGIN update into ftrace_new_f= unction. Patch 9 will remove BTINFO->BEGIN/END but this would allow us to get rid of= most of the btrace_function pointers before patch 5. We may not need to squash eve= rything, which may help later bisects. We really only need btrace_function pointers for maintaining the list of ga= ps and the function level adjustment, and for fixing up callers. The latter two don't= generate new functions, so we're safe. And for gaps, we have to switch to indices, anyw= ay. 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