From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30699 invoked by alias); 2 Mar 2012 13:50:47 -0000 Received: (qmail 30652 invoked by uid 22791); 2 Mar 2012 13:50:44 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_PX,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 02 Mar 2012 13:50:31 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q22DoSwm002281 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 2 Mar 2012 08:50:28 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q22DoQLk006300; Fri, 2 Mar 2012 08:50:27 -0500 Message-ID: <4F50D022.8000001@redhat.com> Date: Fri, 02 Mar 2012 13:50:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH 2/2] OO tracepoint_action References: <1330650011-31899-1-git-send-email-yao@codesourcery.com> <1330650011-31899-3-git-send-email-yao@codesourcery.com> <4F50B3D2.4060504@redhat.com> <4F50CCBA.70704@codesourcery.com> In-Reply-To: <4F50CCBA.70704@codesourcery.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2012-03/txt/msg00086.txt.bz2 On 03/02/2012 01:35 PM, Yao Qi wrote: > The update to error_tracepoint is guarded by action->ops->execute > > if (taction->ops->execute (taction, ctx, tframe)) > error_tracepoint = tpoint; > > and ops->execute calls cmpxchg (for X action). `execute' of other types > of action always return 0. So I think this is equivalent to original. /* Only record the first error we get. */ if (cmpxchg (&expr_eval_result, So if two threads (in the IPA) happen to trigger an eval error at the same time, only the first error is stored. And then error_tracepoint is set to the tracepoint whose action was being evaluated. With your change, the _last_ (random) thread to return from ->execute would set error_tracepoint, even though that thread hadn't set expr_eval_result. It doesn't look equivalent. > struct tracepoint_action_ops > { > CORE_ADDR (*download) (struct tracepoint_action *action); > }; > > struct tracepoint_action > { > #ifndef IN_PROCESS_AGENT > struct tracepoint_action_ops *ops; > #endif > char type; > }; > > What do you think? Let's try that. > Note that I plan to add a new field `send' in > tracepoint_action_ops to send different types of actions to agent > through "command buffer". -- Pedro Alves