aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/probe-finder.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r--tools/perf/util/probe-finder.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index df0238654698..562762117639 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -985,7 +985,7 @@ static int debuginfo__find_probes(struct debuginfo *dbg,
985 985
986#if _ELFUTILS_PREREQ(0, 142) 986#if _ELFUTILS_PREREQ(0, 142)
987 /* Get the call frame information from this dwarf */ 987 /* Get the call frame information from this dwarf */
988 pf->cfi = dwarf_getcfi(dbg->dbg); 988 pf->cfi = dwarf_getcfi_elf(dwarf_getelf(dbg->dbg));
989#endif 989#endif
990 990
991 off = 0; 991 off = 0;
@@ -1441,13 +1441,15 @@ static int line_range_walk_cb(const char *fname, int lineno,
1441 void *data) 1441 void *data)
1442{ 1442{
1443 struct line_finder *lf = data; 1443 struct line_finder *lf = data;
1444 int err;
1444 1445
1445 if ((strtailcmp(fname, lf->fname) != 0) || 1446 if ((strtailcmp(fname, lf->fname) != 0) ||
1446 (lf->lno_s > lineno || lf->lno_e < lineno)) 1447 (lf->lno_s > lineno || lf->lno_e < lineno))
1447 return 0; 1448 return 0;
1448 1449
1449 if (line_range_add_line(fname, lineno, lf->lr) < 0) 1450 err = line_range_add_line(fname, lineno, lf->lr);
1450 return -EINVAL; 1451 if (err < 0 && err != -EEXIST)
1452 return err;
1451 1453
1452 return 0; 1454 return 0;
1453} 1455}
@@ -1473,14 +1475,15 @@ static int find_line_range_by_line(Dwarf_Die *sp_die, struct line_finder *lf)
1473 1475
1474static int line_range_inline_cb(Dwarf_Die *in_die, void *data) 1476static int line_range_inline_cb(Dwarf_Die *in_die, void *data)
1475{ 1477{
1476 find_line_range_by_line(in_die, data); 1478 int ret = find_line_range_by_line(in_die, data);
1477 1479
1478 /* 1480 /*
1479 * We have to check all instances of inlined function, because 1481 * We have to check all instances of inlined function, because
1480 * some execution paths can be optimized out depends on the 1482 * some execution paths can be optimized out depends on the
1481 * function argument of instances 1483 * function argument of instances. However, if an error occurs,
1484 * it should be handled by the caller.
1482 */ 1485 */
1483 return 0; 1486 return ret < 0 ? ret : 0;
1484} 1487}
1485 1488
1486/* Search function definition from function name */ 1489/* Search function definition from function name */