From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26614 invoked by alias); 10 Oct 2014 18:32:25 -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 26546 invoked by uid 89); 10 Oct 2014 18:32:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,LIKELY_SPAM_BODY,RP_MATCHES_RCVD,SPF_PASS,UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 10 Oct 2014 18:32:24 +0000 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s9AIWJto023907 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 10 Oct 2014 18:32:20 GMT Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s9AIWJZP010006 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Oct 2014 18:32:19 GMT Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id s9AIWHBN009918; Fri, 10 Oct 2014 18:32:18 GMT Received: from termi.oracle.com (/10.175.211.52) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 10 Oct 2014 11:32:17 -0700 From: jose.marchesi@oracle.com (Jose E. Marchesi) To: Sergio Durigan Junior Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 5/9] New probe type: DTrace USDT probes. References: <1411724905-31234-1-git-send-email-jose.marchesi@oracle.com> <1411724905-31234-6-git-send-email-jose.marchesi@oracle.com> <87y4syt5zn.fsf@redhat.com> <87iojrevbz.fsf@oracle.com> <87ppdz23p1.fsf@redhat.com> Date: Fri, 10 Oct 2014 18:32:00 -0000 In-Reply-To: <87ppdz23p1.fsf@redhat.com> (Sergio Durigan Junior's message of "Fri, 10 Oct 2014 14:13:30 -0400") Message-ID: <87lhondb4y.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg00277.txt.bz2 > You should free the enablers VEC in the end of the function. You could > probably make a cleanup and call it later. > > Hmm, I don't see the need of doing a deep copy of the vector, nor I > remember why I felt it was necessary to do it when I wrote the original > code. > > I changed that to: > > /* Add the vector of enablers to this probe, if any. */ > ret->enablers = enablers; > > But maybe(probably) I am missing something? :? Hm, right. But if you do that, you will have to adjust dtrace_probe_destroy, because it will be freeing the same 'enablers' over and over... Aaah, that was indeed the reason! A "DOF probe" translates into 0 or more gdb probes, and they all share the same vector of enablers. Maintaining a copy of the enablers per gdb probe makes it trivial to manage its memory. Otherwise we would need to keep track of which enabler vectors are shared by which gdb probes... argh! I will roll back to the deep copy approach :) > This shouldn't be needed, because USDT probes don't have the concept of > a semaphore, right? I will submit a patch soon to fix the fact that the > set/clear_semaphore functions are being called inconditionally. > > Correct, that should not be needed and can go away as soon as you do > that change. I should be able to post something today. Will put you on the loop. Ah nice, I will update the patches accordingly.