From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14836 invoked by alias); 25 Nov 2015 16:38:19 -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 14818 invoked by uid 89); 25 Nov 2015 16:38:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_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; Wed, 25 Nov 2015 16:38:17 +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 C1BB1A0B4C; Wed, 25 Nov 2015 16:38:16 +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 tAPGcFCj008141; Wed, 25 Nov 2015 11:38:15 -0500 Message-ID: <5655E3F6.3070002@redhat.com> Date: Wed, 25 Nov 2015 16:38:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "Metzger, Markus T" CC: "gdb-patches@sourceware.org" Subject: Re: [PATCH] btrace: diagnose "record btrace pt" without libipt References: <1448011026-4192-1-git-send-email-markus.t.metzger@intel.com> <564F0591.3020006@redhat.com> <564F1C3D.1040709@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00523.txt.bz2 On 11/20/2015 01:59 PM, Metzger, Markus T wrote: > Thanks for pointing this out. Let's try to fix it... > > Handling the "E.Btrace already enabled" error in remote.c shouldn't be too hard. > This would at least allow another "record btrace" after reconnect - and it should > keep the trace logs. This takes the same code path as a new enable so the check > in this patch should suffice. > > A non-PT enabled GDB would try to fall back to BTS, though, so we could either > implicitly disable PT in the target to allow it or give an error, which again leaves > branch tracing unusable in this GDB session. But it would keep the trace logs if > the user accidentally chose the wrong GDB for reconnecting. > > It would be nice if GDB could detect that record btrace is already enabled and push > the record-btrace target automatically. I guess this requires some indication about > the record status from gdbserver. Is there some other target that does this automatic > push on (re-)connect that I could use as reference? E.g., linux-thread-db.c pushes itself from a new_objfile observer (thread_db_new_objfile), and the spu multiarch target pushes itself from an inferior_created observer (spu_multiarch_inferior_created). > > This still leaves the question how GDB should behave if it doesn't support the tracing > format that's already enabled in the GDBserver it just connected to. > I guess warn/error when you try to view/consume it, but still let you disable the tracing? Thanks, Pedro Alves