From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@linux.intel.com>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 02/11] perf annotate: Inform the user about objdump failures in --stdio
Date: Fri, 6 Nov 2015 17:54:30 -0300 [thread overview]
Message-ID: <1446843279-14825-3-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1446843279-14825-1-git-send-email-acme@kernel.org>
From: Andi Kleen <ak@linux.intel.com>
When the browser fails to annotate it is difficult for users to find out
what went wrong.
Add some errors for objdump failures that are displayed in the UI.
Note it would be even better to handle these errors smarter, like
falling back to the binary when the debug info is somehow corrupted. But
for now just giving a better error is an improvement.
Committer note:
This works for --stdio, where errors just scroll by the screen:
# perf annotate --stdio intel_idle
Failure running objdump --start-address=0xffffffff81418290 --stop-address=0xffffffff814183ae -l -d --no-show-raw -S -C /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1 2>/dev/null|grep -v /root/.debug/.build-id/28/2777c262e6b3c0451375163c9a81c893218ab1|expand
Percent | Source code & Disassembly of vmlinux for cycles:pp
------------------------------------------------------------------
And with that one can use that command line to try to find out more about what
happened instead of getting a blank screen, an improvement.
We need tho to improve this further to get it to work with other UIs, like
--tui and --gtk, where it continues showing a blank screen, no messages, as
the pr_err() used is enough just for --stdio.
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: http://lkml.kernel.org/r/1446779167-18949-1-git-send-email-andi@firstfloor.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/annotate.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/tools/perf/util/annotate.c b/tools/perf/util/annotate.c
index 0fc8d7a2fea5..f2974da0185a 100644
--- a/tools/perf/util/annotate.c
+++ b/tools/perf/util/annotate.c
@@ -1084,6 +1084,7 @@ int symbol__annotate(struct symbol *sym, struct map *map, size_t privsize)
struct kcore_extract kce;
bool delete_extract = false;
int lineno = 0;
+ int nline;
if (filename)
symbol__join_symfs(symfs_filename, filename);
@@ -1179,6 +1180,9 @@ fallback:
ret = decompress_to_file(m.ext, symfs_filename, fd);
+ if (ret)
+ pr_err("Cannot decompress %s %s\n", m.ext, symfs_filename);
+
free(m.ext);
close(fd);
@@ -1204,13 +1208,25 @@ fallback:
pr_debug("Executing: %s\n", command);
file = popen(command, "r");
- if (!file)
+ if (!file) {
+ pr_err("Failure running %s\n", command);
+ /*
+ * If we were using debug info should retry with
+ * original binary.
+ */
goto out_remove_tmp;
+ }
- while (!feof(file))
+ nline = 0;
+ while (!feof(file)) {
if (symbol__parse_objdump_line(sym, map, file, privsize,
&lineno) < 0)
break;
+ nline++;
+ }
+
+ if (nline == 0)
+ pr_err("No output from %s\n", command);
/*
* kallsyms does not have symbol sizes so there may a nop at the end.
--
2.1.0
next prev parent reply other threads:[~2015-11-06 20:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 20:54 [GIT PULL 00/11] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 01/11] perf stat: Make stat options global Arnaldo Carvalho de Melo
2015-11-06 20:54 ` Arnaldo Carvalho de Melo [this message]
2015-11-06 20:54 ` [PATCH 03/11] perf probe: Cleanup find_perf_probe_point_from_map to reduce redundancy Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 04/11] bpf tools: Improve libbpf error reporting Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 05/11] bpf tools: Add new API bpf_object__get_kversion() Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 06/11] perf tools: Make fetch_kernel_version() publicly available Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 07/11] perf bpf: Improve BPF related error messages Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 08/11] perf test: Enhance the LLVM test: update basic BPF test program Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 09/11] perf test: Enhance the LLVM tests: add kbuild test Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 10/11] perf test: Add 'perf test BPF' Arnaldo Carvalho de Melo
2015-11-06 20:54 ` [PATCH 11/11] perf test: Do not be case sensitive when searching for matching tests Arnaldo Carvalho de Melo
2015-11-08 7:24 ` [GIT PULL 00/11] perf/core improvements and fixes Ingo Molnar
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=1446843279-14825-3-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=ak@linux.intel.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.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).