summaryrefslogtreecommitdiff
path: root/tools/perf/util/srcline.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/srcline.c')
-rw-r--r--tools/perf/util/srcline.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index af468e3bb6fa..33321867416b 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -550,6 +550,9 @@ static int addr2line(const char *dso_name, u64 addr,
size_t inline_count = 0;
if (!a2l) {
+ if (!filename__has_section(dso_name, ".debug_line"))
+ goto out;
+
dso->a2l = addr2line_subprocess_init(dso_name);
a2l = dso->a2l;
}
@@ -570,13 +573,15 @@ static int addr2line(const char *dso_name, u64 addr,
* "??"/"??:0" lines.
*/
if (fprintf(a2l->to_child, "%016"PRIx64"\n,\n", addr) < 0 || fflush(a2l->to_child) != 0) {
- pr_warning("%s %s: could not send request\n", __func__, dso_name);
+ if (!symbol_conf.disable_add2line_warn)
+ pr_warning("%s %s: could not send request\n", __func__, dso_name);
goto out;
}
switch (read_addr2line_record(a2l, &record_function, &record_filename, &record_line_nr)) {
case -1:
- pr_warning("%s %s: could not read first record\n", __func__, dso_name);
+ if (!symbol_conf.disable_add2line_warn)
+ pr_warning("%s %s: could not read first record\n", __func__, dso_name);
goto out;
case 0:
/*
@@ -585,14 +590,17 @@ static int addr2line(const char *dso_name, u64 addr,
*/
switch (read_addr2line_record(a2l, NULL, NULL, NULL)) {
case -1:
- pr_warning("%s %s: could not read delimiter record\n", __func__, dso_name);
+ if (!symbol_conf.disable_add2line_warn)
+ pr_warning("%s %s: could not read delimiter record\n",
+ __func__, dso_name);
break;
case 0:
/* As expected. */
break;
default:
- pr_warning("%s %s: unexpected record instead of sentinel",
- __func__, dso_name);
+ if (!symbol_conf.disable_add2line_warn)
+ pr_warning("%s %s: unexpected record instead of sentinel",
+ __func__, dso_name);
break;
}
goto out;
@@ -716,7 +724,7 @@ out:
if (!show_addr)
return (show_sym && sym) ?
- strndup(sym->name, sym->namelen) : NULL;
+ strndup(sym->name, sym->namelen) : SRCLINE_UNKNOWN;
if (sym) {
if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "",