Re: RFC/error: Re: [PATCH 3/6] perf tools: Improve thread_stack__event() for trace begin / end

From: Adrian Hunter
Date: Fri Sep 21 2018 - 04:57:25 EST


On 20/09/18 21:13, Arnaldo Carvalho de Melo wrote:
> Em Wed, Sep 19, 2018 at 02:23:35PM +0300, Adrian Hunter escreveu:
>> + return thread_stack__push(thread->ts, ret_addr,
>> + flags && PERF_IP_FLAG_TRACE_END);
>> + } else if (flags & PERF_IP_FLAG_TRACE_BEGIN) {
>
> Some of the build containers caught this:
>
> util/thread-stack.c:274:14: error: use of logical '&&' with constant operand [-Werror,-Wconstant-logical-operand]
> flags && PERF_IP_FLAG_TRACE_END);
> ^ ~~~~~~~~~~~~~~~~~~~~~~
> util/thread-stack.c:274:14: note: use '&' for a bitwise operation
> flags && PERF_IP_FLAG_TRACE_END);
> ^~
> &
> util/thread-stack.c:274:14: note: remove constant to silence this warning
> flags && PERF_IP_FLAG_TRACE_END);
> ~^~~~~~~~~~~~~~~~~~~~~~~~~
> 1 error generated.
>
>
> --------------------------
>
> Should be a '&' as suggested by:
>
> 16 146.45 debian:9 : FAIL gcc (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
> 17 138.35 debian:experimental : FAIL gcc (Debian 8.2.0-4) 8.2.0
>
>
> I'm changing this here, please Ack.

Yes, thank you!