]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
perf probe: Fix a precedence bug
authorHe Kuang <hekuang@huawei.com>
Fri, 27 Feb 2015 10:52:53 +0000 (18:52 +0800)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 27 Feb 2015 13:31:09 +0000 (10:31 -0300)
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 <hekuang@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1425034373-14511-1-git-send-email-hekuang@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/probe-event.c

index 9526cf37682e97929839f06b66c9ba07fc5282e6..7c0e765fa2e3ee320836581de42bcc9ec1196ef6 100644 (file)
@@ -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;
 }