Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752922AbbB1Jcp (ORCPT ); Sat, 28 Feb 2015 04:32:45 -0500 Received: from terminus.zytor.com ([198.137.202.10]:45042 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751896AbbB1Jcj (ORCPT ); Sat, 28 Feb 2015 04:32:39 -0500 Date: Sat, 28 Feb 2015 01:32:19 -0800 From: tip-bot for He Kuang Message-ID: Cc: hekuang@huawei.com, masami.hiramatsu.pt@hitachi.com, wangnan0@huawei.com, acme@redhat.com, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de Reply-To: wangnan0@huawei.com, masami.hiramatsu.pt@hitachi.com, hekuang@huawei.com, hpa@zytor.com, linux-kernel@vger.kernel.org, mingo@kernel.org, tglx@linutronix.de, acme@redhat.com In-Reply-To: <1425034373-14511-1-git-send-email-hekuang@huawei.com> References: <1425034373-14511-1-git-send-email-hekuang@huawei.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe: Fix a precedence bug Git-Commit-ID: f56847c2e99810781f6941d01baff9ae223eeac3 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1879 Lines: 51 Commit-ID: f56847c2e99810781f6941d01baff9ae223eeac3 Gitweb: http://git.kernel.org/tip/f56847c2e99810781f6941d01baff9ae223eeac3 Author: He Kuang AuthorDate: Fri, 27 Feb 2015 18:52:53 +0800 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 27 Feb 2015 10:31:09 -0300 perf probe: Fix a precedence bug 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) Signed-off-by: He Kuang Acked-by: Masami Hiramatsu Cc: Wang Nan Link: http://lkml.kernel.org/r/1425034373-14511-1-git-send-email-hekuang@huawei.com Signed-off-by: Arnaldo Carvalho de Melo --- 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 9526cf3..7c0e765 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -151,7 +151,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; } -- 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/