aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/annotate.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-11-08 02:22:37 -0500
committerIngo Molnar <mingo@kernel.org>2015-11-08 02:22:37 -0500
commitbad9bc2d466445b0398b78a452b7706a05ebc182 (patch)
tree86943a9ccb8cd7c44c741f562ebec257c7d83b6a /tools/perf/util/annotate.c
parent66ef3493d4bb387f5a83915e33dc893102fd1b43 (diff)
parent345c99a303e1d97b407bf99190314a878d59ca92 (diff)
Merge tag 'perf-core-for-mingo-2' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
Pull perf/core improvements and fixes from Arnaldo Carvalho de Melo: Fixes: - libbpf error reporting improvements, using a strerror interface to more precisely tell the user about problems with the provided scriptlet, be it in C or as a ready made object file (Wang Nan) - Do not be case sensitive when searching for matching 'perf test' entries (Arnaldo Carvalho de Melo) - Inform the user about objdump failures in 'perf annotate' (Andi Kleen) Infrastructure changes: - Improve the LLVM 'perf test' entry, introduce a new ones for BPF and kbuild tests to check the environment used by clang to compile .c scriptlets (Wang Nan) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'tools/perf/util/annotate.c')
-rw-r--r--tools/perf/util/annotate.c20
1 files 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)
1084 struct kcore_extract kce; 1084 struct kcore_extract kce;
1085 bool delete_extract = false; 1085 bool delete_extract = false;
1086 int lineno = 0; 1086 int lineno = 0;
1087 int nline;
1087 1088
1088 if (filename) 1089 if (filename)
1089 symbol__join_symfs(symfs_filename, filename); 1090 symbol__join_symfs(symfs_filename, filename);
@@ -1179,6 +1180,9 @@ fallback:
1179 1180
1180 ret = decompress_to_file(m.ext, symfs_filename, fd); 1181 ret = decompress_to_file(m.ext, symfs_filename, fd);
1181 1182
1183 if (ret)
1184 pr_err("Cannot decompress %s %s\n", m.ext, symfs_filename);
1185
1182 free(m.ext); 1186 free(m.ext);
1183 close(fd); 1187 close(fd);
1184 1188
@@ -1204,13 +1208,25 @@ fallback:
1204 pr_debug("Executing: %s\n", command); 1208 pr_debug("Executing: %s\n", command);
1205 1209
1206 file = popen(command, "r"); 1210 file = popen(command, "r");
1207 if (!file) 1211 if (!file) {
1212 pr_err("Failure running %s\n", command);
1213 /*
1214 * If we were using debug info should retry with
1215 * original binary.
1216 */
1208 goto out_remove_tmp; 1217 goto out_remove_tmp;
1218 }
1209 1219
1210 while (!feof(file)) 1220 nline = 0;
1221 while (!feof(file)) {
1211 if (symbol__parse_objdump_line(sym, map, file, privsize, 1222 if (symbol__parse_objdump_line(sym, map, file, privsize,
1212 &lineno) < 0) 1223 &lineno) < 0)
1213 break; 1224 break;
1225 nline++;
1226 }
1227
1228 if (nline == 0)
1229 pr_err("No output from %s\n", command);
1214 1230
1215 /* 1231 /*
1216 * kallsyms does not have symbol sizes so there may a nop at the end. 1232 * kallsyms does not have symbol sizes so there may a nop at the end.