Re: [PATCH 2/2] OO tracepoint_action

Pedro Alves
2012-03-02T13:50:47Z

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