From: tip-bot for He Kuang <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hekuang@huawei.com, tglx@linutronix.de, jolsa@kernel.org,
wangnan0@huawei.com, hpa@zytor.com,
masami.hiramatsu.pt@hitachi.com, mingo@kernel.org,
acme@redhat.com, a.p.zijlstra@chello.nl,
linux-kernel@vger.kernel.org
Subject: [tip:perf/core] perf probe: Show better error message when failed to find variable
Date: Thu, 14 May 2015 23:44:29 -0700 [thread overview]
Message-ID: <tip-7d5eaba9b33682b734e3a79c21c4a9a5f91624b1@git.kernel.org> (raw)
In-Reply-To: <1431336304-16863-3-git-send-email-hekuang@huawei.com>
Commit-ID: 7d5eaba9b33682b734e3a79c21c4a9a5f91624b1
Gitweb: http://git.kernel.org/tip/7d5eaba9b33682b734e3a79c21c4a9a5f91624b1
Author: He Kuang <hekuang@huawei.com>
AuthorDate: Mon, 11 May 2015 09:25:04 +0000
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Tue, 12 May 2015 09:59:50 -0300
perf probe: Show better error message when failed to find variable
Indicate to check variable location range in error message when we got
failed to find the variable.
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 the --range option to show 'bytes' location range.
Error: Failed to add events.
Signed-off-by: He Kuang <hekuang@huawei.com>
Acked-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/1431336304-16863-3-git-send-email-hekuang@huawei.com
[ Improve the error message based on lkml thread ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/probe-finder.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 5804086..590a24a 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -527,10 +527,12 @@ 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);
- else if (ret == -ENOTSUP)
+ if (ret == -ENOENT || ret == -EINVAL) {
+ 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 the --range option to show '%s' location range.\n",
+ pf->pvar->var, 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) {
ret = convert_variable_fields(vr_die, pf->pvar->var,
next prev parent reply other threads:[~2015-05-15 6:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-11 9:25 [PATCH v3 1/3] perf probe: Remove length limitation for showing available variables He Kuang
2015-05-11 9:25 ` [PATCH v3 2/3] perf probe: Add --range option to show variable location range He Kuang
2015-05-11 12:04 ` Masami Hiramatsu
2015-05-15 6:44 ` [tip:perf/core] perf probe: Add --range option to show a variable 's " tip-bot for He Kuang
2015-05-11 9:25 ` [PATCH v3 3/3] perf probe: Show better error message when failed to find variable He Kuang
2015-05-11 9:30 ` Ingo Molnar
2015-05-11 9:43 ` He Kuang
2015-05-11 9:50 ` Ingo Molnar
2015-05-11 10:15 ` He Kuang
2015-05-11 12:02 ` Masami Hiramatsu
2015-05-11 13:35 ` Arnaldo Carvalho de Melo
2015-05-11 13:44 ` Arnaldo Carvalho de Melo
2015-05-11 20:31 ` Masami Hiramatsu
2015-05-11 9:31 ` Ingo Molnar
2015-05-15 6:44 ` tip-bot for He Kuang [this message]
2015-05-15 6:43 ` [tip:perf/core] perf probe: Remove length limitation for showing available variables 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=tip-7d5eaba9b33682b734e3a79c21c4a9a5f91624b1@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=hekuang@huawei.com \
--cc=hpa@zytor.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=tglx@linutronix.de \
--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
Powered by JetHome