All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: He Kuang <hekuang@huawei.com>
Cc: masami.hiramatsu.pt@hitachi.com, a.p.zijlstra@chello.nl,
	jolsa@kernel.org, mingo@redhat.com, wangnan0@huawei.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 3/3] perf probe: Show better error message when failed to find variable
Date: Mon, 11 May 2015 10:59:38 -0300	[thread overview]
Message-ID: <20150511135938.GH28183@kernel.org> (raw)
In-Reply-To: <1431349804-31849-3-git-send-email-hekuang@huawei.com>

Em Mon, May 11, 2015 at 01:10:04PM +0000, He Kuang escreveu:
> Indicate to check variable location range in error message when we got
> failed to find the variable, and put user-supplied variable name in
> quotes.
> 
> Before this patch:
> 
>   $ perf probe --add 'generic_perform_write+118 bytes'
>   Failed to find the location of bytes at this address.
>    Perhaps, it has been optimized out.
>     Error: Failed to add events.
> 
> After this patch:
>   $ perf probe --add 'generic_perform_write+118 bytes'
>   Failed to find the location of the 'bytes' variable at this address.
>    Perhaps, it has been optimized out.
>    Use -V with --range option to show variable location range.
>     Error: Failed to add events.

See my other reply.

- Arnaldo
 
> Signed-off-by: He Kuang <hekuang@huawei.com>
> ---
>  tools/perf/util/probe-finder.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
> index f032329..0fc2ae8 100644
> --- a/tools/perf/util/probe-finder.c
> +++ b/tools/perf/util/probe-finder.c
> @@ -528,8 +528,10 @@ static int convert_variable(Dwarf_Die *vr_die, struct probe_finder *pf)
>  	ret = convert_variable_location(vr_die, pf->addr, pf->fb_ops,
>  					&pf->sp_die, pf->tvar);
>  	if (ret == -ENOENT || ret == -EINVAL)
> -		pr_err("Failed to find the location of %s at this address.\n"
> -		       " Perhaps, it has been optimized out.\n", pf->pvar->var);
> +		pr_err("Failed to find the location of the '%s' variable at this address.\n"
> +		       " Perhaps, it has been optimized out.\n"
> +		       " Use -V with --range option to show variable location range.\n",
> +		       pf->pvar->var);
>  	else if (ret == -ENOTSUP)
>  		pr_err("Sorry, we don't support this variable location yet.\n");
>  	else if (ret == 0 && pf->pvar->field) {
> -- 
> 1.8.5.2

  reply	other threads:[~2015-05-11 13:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-11 13:10 [PATCH v4 1/3] perf probe: Remove length limitation for showing available variables He Kuang
2015-05-11 13:10 ` [PATCH v4 2/3] perf probe: Add --range option to show variable location range He Kuang
2015-05-11 13:58   ` Arnaldo Carvalho de Melo
2015-05-11 14:19     ` hekuang
2015-05-11 14:38       ` Arnaldo Carvalho de Melo
2015-05-11 13:10 ` [PATCH v4 3/3] perf probe: Show better error message when failed to find variable He Kuang
2015-05-11 13:59   ` Arnaldo Carvalho de Melo [this message]
2015-05-11 20:23   ` Masami Hiramatsu
2015-05-11 13:59 ` [PATCH v4 1/3] perf probe: Remove length limitation for showing available variables Arnaldo Carvalho de Melo

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=20150511135938.GH28183@kernel.org \
    --to=acme@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=hekuang@huawei.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.