From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39296 invoked by alias); 30 Jun 2015 15:08:55 -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 39266 invoked by uid 89); 30 Jun 2015 15:08:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 30 Jun 2015 15:08:52 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 020B45A; Tue, 30 Jun 2015 15:08:50 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t5UF8ndc027397; Tue, 30 Jun 2015 11:08:50 -0400 Message-ID: <5592B100.803@redhat.com> Date: Tue, 30 Jun 2015 15:08:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: "Metzger, Markus T" CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH 2/5] btrace: support Intel(R) Processor Trace References: <1435047418-21611-1-git-send-email-markus.t.metzger@intel.com> <1435047418-21611-3-git-send-email-markus.t.metzger@intel.com> <55929205.6080907@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-06/txt/msg00644.txt.bz2 On 06/30/2015 03:54 PM, Metzger, Markus T wrote: >>> + decoder = pt_insn_alloc_decoder (&config); >>> + if (decoder == NULL) >>> + error (_("Failed to allocate the Intel(R) Processor Trace decoder.")); >>> + >>> + TRY >>> + { >>> + struct pt_image *image; >>> + >>> + image = pt_insn_get_image(decoder); >>> + if (image == NULL) >>> + error (_("Failed to configure the Intel(R) Processor Trace decoder.")); >>> + >>> + errcode = pt_image_set_callback(image, >> btrace_pt_readmem_callback, NULL); >>> + if (errcode < 0) >>> + error (_("Failed to configure the Intel(R) Processor Trace decoder: " >>> + "%s."), pt_errstr (pt_errcode (errcode))); >>> + >>> + ftrace_add_pt (decoder, &btinfo->begin, &btinfo->end, &level, >>> + &btinfo->ngaps); >>> + } >>> + CATCH (error, RETURN_MASK_ALL) >>> + { >>> + /* Indicate a gap in the trace if we quit trace processing. Errors were >>> + already logged before. */ >> >> What does this "already logged before" mean? AFAICS, the errors thrown >> in the TRY branch are just swallowed here. Did you mean to rethrow them? >> Otherwise I'm not seeing the point in throwing them in the first place. > > This means that decode errors are already represented as gaps in the trace. > When the trace is printed, the error at a trace gap is printed. > > This code is now handling a user interrupt, which is also represented > as a gap at the very end of the trace. > > This reference to decode errors is maybe more confusing than helpful. > I'll remove it. I still don't get why throw the errors in the TRY branch: if (image == NULL) error (_("Failed to configure the Intel(R) Processor Trace decoder.")); errcode = pt_image_set_callback(image, btrace_pt_readmem_callback, NULL); if (errcode < 0) error (_("Failed to configure the Intel(R) Processor Trace decoder: " "%s."), pt_errstr (pt_errcode (errcode))); ... if they're just dropped on the catch brock. Shouldn't those be rethrown? The CATCH block you had does not do that. And it neither rethrows the ctrl-c that generates the RETURN_QUIT: + CATCH (error, RETURN_MASK_ALL) + { + /* Indicate a gap in the trace if we quit trace processing. Errors were + already logged before. */ + if (error.reason == RETURN_QUIT && btinfo->end != NULL) + { + btinfo->end = ftrace_new_gap (btinfo->end, BDE_PT_USER_QUIT); + btinfo->ngaps++; + } + } So shouldn't that be: CATCH (error, RETURN_MASK_ALL) { /* Indicate a gap in the trace if we quit trace processing. Errors were already logged before. */ if (error.reason == RETURN_QUIT && btinfo->end != NULL) { btinfo->end = ftrace_new_gap (btinfo->end, BDE_PT_USER_QUIT); btinfo->ngaps++; } + throw_exception (error); } ? > I'm just adding new elements and attributes. I thought I'd bump the version > since there are new features. Should I leave it at version 1.0? Yes. That way record bts with old gdb should still work with new gdbserver. (Please give that a try to make sure it actually still works.) Thanks, Pedro Alves