From: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>,
ak@linux.intel.com, Jiri Olsa <jolsa@redhat.com>,
peterz@infradead.org
Cc: Anton Blanchard <anton@au1.ibm.com>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] tools/perf: Fix error reporting
Date: Thu, 2 Oct 2014 17:53:36 -0700 [thread overview]
Message-ID: <1412297616-14179-3-git-send-email-sukadev@linux.vnet.ibm.com> (raw)
In-Reply-To: <1412297616-14179-1-git-send-email-sukadev@linux.vnet.ibm.com>
If user explicitly specifies a vmlinux or kallsyms file on the command
line and the specified file doesn't yield any symbols, print a warning
message.
$ perf report -kallsyms
No kernel symbols in the vmlinux 'allsyms'?
Failed to load symbols for DSO [kernel.kallsyms], continuing
without symbols
This could help user better recognize the typo -kallsyms v. --kallsyms.
It would also help if the user points to a stripped/invalid vmlinux or
an invalid kallsyms.
With a stripped vmlinux:
$ perf report -k /tmp/vmlinux
No kernel symbols in the vmlinux '/tmp/vmlinux'?
Failed to load symbols for DSO [kernel.kallsyms], continuing
without symbols
and with perf top
$ perf top -k /tmp/vmlinux
No kernel symbols in the vmlinux '/tmp/vmlinux'?
/tmp/vmlinux with build id f43f4e78d3afac6492dcae52cd756394247997d6
not found, continuing without symbols
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
---
tools/perf/util/symbol.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 9b66e27..ad5baa4 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1658,8 +1658,13 @@ static int dso__load_kernel_sym(struct dso *dso, struct map *map,
}
if (!symbol_conf.ignore_vmlinux && symbol_conf.vmlinux_name != NULL) {
- return dso__load_vmlinux(dso, map, symbol_conf.vmlinux_name,
+ nsyms = dso__load_vmlinux(dso, map, symbol_conf.vmlinux_name,
false, filter);
+ if (nsyms <= 0) {
+ pr_warning("No kernel symbols in the vmlinux '%s'?\n",
+ symbol_conf.vmlinux_name);
+ }
+ return nsyms;
}
if (!symbol_conf.ignore_vmlinux && vmlinux_path != NULL) {
@@ -1682,6 +1687,10 @@ do_kallsyms:
nsyms = dso__load_kallsyms(dso, kallsyms_filename, map, filter);
if (nsyms > 0)
pr_debug("Using %s for symbols\n", kallsyms_filename);
+ else if (symbol_conf.kallsyms_name) {
+ pr_warning("No kernel symbols in the kallsyms '%s'?\n",
+ kallsyms_filename);
+ }
free(kallsyms_allocated_filename);
if (nsyms > 0 && !dso__is_kcore(dso)) {
--
1.8.3.1
prev parent reply other threads:[~2014-10-03 0:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-03 0:53 [PATCH 1/3] tools/perf: Fix error message Sukadev Bhattiprolu
2014-10-03 0:53 ` [PATCH 2/3] tools/perf: Rename variables for clarity Sukadev Bhattiprolu
2014-10-03 0:53 ` Sukadev Bhattiprolu [this message]
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=1412297616-14179-3-git-send-email-sukadev@linux.vnet.ibm.com \
--to=sukadev@linux.vnet.ibm.com \
--cc=acme@kernel.org \
--cc=ak@linux.intel.com \
--cc=anton@au1.ibm.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=peterz@infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).