diff options
author | He Kuang <hekuang@huawei.com> | 2015-02-27 18:52:53 +0800 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2015-02-27 10:31:09 -0300 |
commit | f56847c2e99810781f6941d01baff9ae223eeac3 (patch) | |
tree | c11436a722f8971ad02d17bee7d290b2ca4dc3ab /tools/perf/util/probe-event.c | |
parent | 94ba462d69efeba2f97111321a9ba1aa8141da57 (diff) | |
download | lwn-f56847c2e99810781f6941d01baff9ae223eeac3.tar.gz lwn-f56847c2e99810781f6941d01baff9ae223eeac3.zip |
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 <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>
Diffstat (limited to 'tools/perf/util/probe-event.c')
-rw-r--r-- | tools/perf/util/probe-event.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |