From: He Kuang <heku...@huawei.com>

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_o...@linux.git/fs/open.c)

Signed-off-by: He Kuang <heku...@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu...@hitachi.com>
Cc: Wang Nan <wangn...@huawei.com>
Link: 
http://lkml.kernel.org/r/1425034373-14511-1-git-send-email-heku...@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 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 9526cf37682e..7c0e765fa2e3 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;
 }
-- 
1.9.3

--
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