On 06/18, Steven Rostedt wrote:
>
> On Tue, 2013-06-18 at 21:22 +0200, Oleg Nesterov wrote:
> > @@ -663,6 +663,12 @@ perf_trace_##call(void *__data, proto)                 
> >                 \
> >     int rctx;                                                       \
> >                                                                     \
> >     __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \
> > +                                                                   \
> > +   head = this_cpu_ptr(event_call->perf_events);                   \
> > +   if (__builtin_constant_p(!__task) && !__task &&                 \
>
>
> I'm trying to wrap my head around this:
>
>   __builtin_constant_p(!task)
>
> is this the same as:
>
>   !__builtin_constant_p(task)
>
> Or is it the same as:
>
>   __builtin_constant_p(task)
>
> ?
>
> Because that '!' is confusing the heck out of me.
>
> If !task is a constant, wouldn't task be a constant too, and if task is
> not a constant then I would also assume !task is not a constant as well.

!__task looks more explicit/symmetrical to me. We need

        if (is_compile_time_true(!__task)) && list_empty)
                return;

is_compile_time_true(cond) could be defined as

        __builtin_constant_p(cond) && (cond)
or
        __builtin_constant_p(!cond) && (cond)

but the 1ts one looks more clean.

However,

> If this is the case, can we nuke the '!' from the builtin_consant_p().

OK, I do not really mind, will do.

And,

> Or is this your way to confuse me as much as my code has confused
> you? ;-)

Of course! this was the main reason.


Steven, I convinced myself the patch should be correct. If you agree with
this hack:

        - anything else I should do apart from the change above?

        - should I resend the previous "[PATCH 0/3] tracing: more
          list_empty(perf_events) checks" series?

          This series depends on "[PATCH 3/3] tracing/perf: Move the
          PERF_MAX_TRACE_SIZE check into perf_trace_buf_prepare()".

          Or I can drop this patch if you do not like it and rediff.

          Just in case, there are other pending patches in trace_kprobe.c
          which I am going to resend, but they are orthogonal.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to