aboutsummaryrefslogtreecommitdiffstats
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.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index d19f05c56de6..3c21fd059b64 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -496,7 +496,8 @@ out:
496#define A2L_FAIL_LIMIT 123 496#define A2L_FAIL_LIMIT 123
497 497
498char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 498char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
499 bool show_sym, bool show_addr, bool unwind_inlines) 499 bool show_sym, bool show_addr, bool unwind_inlines,
500 u64 ip)
500{ 501{
501 char *file = NULL; 502 char *file = NULL;
502 unsigned line = 0; 503 unsigned line = 0;
@@ -536,7 +537,7 @@ out:
536 537
537 if (sym) { 538 if (sym) {
538 if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "", 539 if (asprintf(&srcline, "%s+%" PRIu64, show_sym ? sym->name : "",
539 addr - sym->start) < 0) 540 ip - sym->start) < 0)
540 return SRCLINE_UNKNOWN; 541 return SRCLINE_UNKNOWN;
541 } else if (asprintf(&srcline, "%s[%" PRIx64 "]", dso->short_name, addr) < 0) 542 } else if (asprintf(&srcline, "%s[%" PRIx64 "]", dso->short_name, addr) < 0)
542 return SRCLINE_UNKNOWN; 543 return SRCLINE_UNKNOWN;
@@ -550,9 +551,9 @@ void free_srcline(char *srcline)
550} 551}
551 552
552char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym, 553char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
553 bool show_sym, bool show_addr) 554 bool show_sym, bool show_addr, u64 ip)
554{ 555{
555 return __get_srcline(dso, addr, sym, show_sym, show_addr, false); 556 return __get_srcline(dso, addr, sym, show_sym, show_addr, false, ip);
556} 557}
557 558
558struct srcline_node { 559struct srcline_node {