Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752396AbbB0LMK (ORCPT ); Fri, 27 Feb 2015 06:12:10 -0500 Received: from mail9.hitachi.co.jp ([133.145.228.44]:41347 "EHLO mail9.hitachi.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751433AbbB0LMI (ORCPT ); Fri, 27 Feb 2015 06:12:08 -0500 Message-ID: <54F05100.9030900@hitachi.com> Date: Fri, 27 Feb 2015 20:12:00 +0900 From: Masami Hiramatsu Organization: Hitachi, Ltd., Japan User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: He Kuang Cc: acme@kernel.org, mingo@redhat.com, wangnan0@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf: Fix a precedence bug References: <54F049BB.1000506@hitachi.com> <1425034373-14511-1-git-send-email-hekuang@huawei.com> In-Reply-To: <1425034373-14511-1-git-send-email-hekuang@huawei.com> Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1644 Lines: 52 (2015/02/27 19:52), He Kuang wrote: > The minus operator has higher precedence than ?: > Add parentheses around ?: fix this. > > Before this patch: > $ echo 'p:myprobe do_sys_open' > /sys/kernel/debug/tracing/kprobe_events > $ perf probe -l -k ../vmlinux > kprobes:myprobe (on do_sys_open) > > After this patch: > $ echo 'p:myprobe do_sys_open' > /sys/kernel/debug/tracing/kprobe_events > $ perf probe -l -k ../vmlinux > kprobes:myprobe (on do_sys_open@linux.git/fs/open.c) Thanks for finding this bug! Acked-by: Masami Hiramatsu > > Signed-off-by: He Kuang > --- > tools/perf/util/probe-event.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c > index 919937e..bed8d0f 100644 > --- a/tools/perf/util/probe-event.c > +++ b/tools/perf/util/probe-event.c > @@ -150,7 +150,7 @@ static u64 kernel_get_symbol_address_by_name(const char *name, bool reloc) > sym = __find_kernel_function_by_name(name, &map); > if (sym) > return map->unmap_ip(map, sym->start) - > - (reloc) ? 0 : map->reloc; > + ((reloc) ? 0 : map->reloc); > } > return 0; > } > -- Masami HIRAMATSU Software Platform Research Dept. Linux Technology Research Center Hitachi, Ltd., Yokohama Research Laboratory E-mail: masami.hiramatsu.pt@hitachi.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/