Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] OO tracepoint_action
Date: Fri, 02 Mar 2012 13:50:00 -0000	[thread overview]
Message-ID: <4F50D022.8000001@redhat.com> (raw)
In-Reply-To: <4F50CCBA.70704@codesourcery.com>

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


      reply	other threads:[~2012-03-02 13:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-02  1:00 [patch 0/2] " Yao Qi
2012-03-02  1:00 ` [PATCH 1/2] New field stop_pc in tracepoint_hit_ctx Yao Qi
2012-03-02 10:49   ` Pedro Alves
2012-03-02  1:00 ` [PATCH 2/2] OO tracepoint_action Yao Qi
2012-03-02  1:06   ` Yao Qi
2012-03-02 11:50   ` Pedro Alves
2012-03-02 13:36     ` Yao Qi
2012-03-02 13:50       ` Pedro Alves [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F50D022.8000001@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox