aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>2014-11-21 20:33:53 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-01-16 15:49:30 -0500
commit6bcf9c1ff3ec22fd81eba336737d9865476509b1 (patch)
tree7c4708991245cf4abf4161b5ffa9741c0ff2bb9c /tools
parent813ccd15452ed34e97aa526ffc70d6d8e6c466c5 (diff)
perf tools powerpc: Use dwfl_report_elf() instead of offline.
dwfl_report_offline() works only when libraries are prelinked. Replace dwfl_report_offline() with dwfl_report_elf() so we correctly extract debug info even from libraries that are not prelinked. Reported-by: Jiri Olsa <jolsa@redhat.com> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Tested-by: Jiri Olsa <jolsa@redhat.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Link: http://lkml.kernel.org/r/20150114221045.GA17703@us.ibm.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/arch/powerpc/util/skip-callchain-idx.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/tools/perf/arch/powerpc/util/skip-callchain-idx.c b/tools/perf/arch/powerpc/util/skip-callchain-idx.c
index 3bb50eac5542..0c370f81e002 100644
--- a/tools/perf/arch/powerpc/util/skip-callchain-idx.c
+++ b/tools/perf/arch/powerpc/util/skip-callchain-idx.c
@@ -103,7 +103,7 @@ static Dwarf_Frame *get_eh_frame(Dwfl_Module *mod, Dwarf_Addr pc)
103 return NULL; 103 return NULL;
104 } 104 }
105 105
106 result = dwarf_cfi_addrframe(cfi, pc, &frame); 106 result = dwarf_cfi_addrframe(cfi, pc-bias, &frame);
107 if (result) { 107 if (result) {
108 pr_debug("%s(): %s\n", __func__, dwfl_errmsg(-1)); 108 pr_debug("%s(): %s\n", __func__, dwfl_errmsg(-1));
109 return NULL; 109 return NULL;
@@ -128,7 +128,7 @@ static Dwarf_Frame *get_dwarf_frame(Dwfl_Module *mod, Dwarf_Addr pc)
128 return NULL; 128 return NULL;
129 } 129 }
130 130
131 result = dwarf_cfi_addrframe(cfi, pc, &frame); 131 result = dwarf_cfi_addrframe(cfi, pc-bias, &frame);
132 if (result) { 132 if (result) {
133 pr_debug("%s(): %s\n", __func__, dwfl_errmsg(-1)); 133 pr_debug("%s(): %s\n", __func__, dwfl_errmsg(-1));
134 return NULL; 134 return NULL;
@@ -145,7 +145,7 @@ static Dwarf_Frame *get_dwarf_frame(Dwfl_Module *mod, Dwarf_Addr pc)
145 * yet used) 145 * yet used)
146 * -1 in case of errors 146 * -1 in case of errors
147 */ 147 */
148static int check_return_addr(struct dso *dso, Dwarf_Addr pc) 148static int check_return_addr(struct dso *dso, u64 map_start, Dwarf_Addr pc)
149{ 149{
150 int rc = -1; 150 int rc = -1;
151 Dwfl *dwfl; 151 Dwfl *dwfl;
@@ -155,6 +155,7 @@ static int check_return_addr(struct dso *dso, Dwarf_Addr pc)
155 Dwarf_Addr start = pc; 155 Dwarf_Addr start = pc;
156 Dwarf_Addr end = pc; 156 Dwarf_Addr end = pc;
157 bool signalp; 157 bool signalp;
158 const char *exec_file = dso->long_name;
158 159
159 dwfl = dso->dwfl; 160 dwfl = dso->dwfl;
160 161
@@ -165,8 +166,10 @@ static int check_return_addr(struct dso *dso, Dwarf_Addr pc)
165 return -1; 166 return -1;
166 } 167 }
167 168
168 if (dwfl_report_offline(dwfl, "", dso->long_name, -1) == NULL) { 169 mod = dwfl_report_elf(dwfl, exec_file, exec_file, -1,
169 pr_debug("dwfl_report_offline() failed %s\n", 170 map_start, false);
171 if (!mod) {
172 pr_debug("dwfl_report_elf() failed %s\n",
170 dwarf_errmsg(-1)); 173 dwarf_errmsg(-1));
171 /* 174 /*
172 * We normally cache the DWARF debug info and never 175 * We normally cache the DWARF debug info and never
@@ -256,10 +259,10 @@ int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain)
256 return skip_slot; 259 return skip_slot;
257 } 260 }
258 261
259 rc = check_return_addr(dso, ip); 262 rc = check_return_addr(dso, al.map->start, ip);
260 263
261 pr_debug("DSO %s, nr %" PRIx64 ", ip 0x%" PRIx64 "rc %d\n", 264 pr_debug("[DSO %s, sym %s, ip 0x%" PRIx64 "] rc %d\n",
262 dso->long_name, chain->nr, ip, rc); 265 dso->long_name, al.sym->name, ip, rc);
263 266
264 if (rc == 0) { 267 if (rc == 0) {
265 /* 268 /*