public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
To: He Kuang <hekuang@huawei.com>
Cc: acme@kernel.org, mingo@redhat.com, wangnan0@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] perf: Fix a precedence bug
Date: Fri, 27 Feb 2015 20:12:00 +0900	[thread overview]
Message-ID: <54F05100.9030900@hitachi.com> (raw)
In-Reply-To: <1425034373-14511-1-git-send-email-hekuang@huawei.com>

(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 <masami.hiramatsu.pt@hitachi.com>

> 
> Signed-off-by: He Kuang <hekuang@huawei.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 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



  reply	other threads:[~2015-02-27 11:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-27  9:35 [PATCH] perf: Fix a precedence bug He Kuang
2015-02-27 10:38 ` He Kuang
2015-02-27 10:40 ` Masami Hiramatsu
2015-02-27 10:52   ` He Kuang
2015-02-27 11:12     ` Masami Hiramatsu [this message]
2015-02-27 11:17     ` Masami Hiramatsu
2015-02-28  9:32     ` [tip:perf/core] perf probe: " tip-bot for He Kuang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54F05100.9030900@hitachi.com \
    --to=masami.hiramatsu.pt@hitachi.com \
    --cc=acme@kernel.org \
    --cc=hekuang@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=wangnan0@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox