diff mbox

perf: unwind: use the dwarf info only if loaded

Message ID 1387212194-8028-1-git-send-email-jean.pihet@linaro.org
State Superseded
Headers show

Commit Message

Jean Pihet Dec. 16, 2013, 4:43 p.m. UTC
Use the info only if it has been found in the .debug_frame
section of the ELF binary.

Signed-off-by: Jean Pihet <jean.pihet@linaro.org>
---
 tools/perf/util/unwind.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Jiri Olsa Dec. 18, 2013, 2:44 p.m. UTC | #1
On Mon, Dec 16, 2013 at 05:43:14PM +0100, Jean Pihet wrote:
> Use the info only if it has been found in the .debug_frame
> section of the ELF binary.
> 
> Signed-off-by: Jean Pihet <jean.pihet@linaro.org>

I couldn't test, but it looks ok

Acked-by: Jiri Olsa <jolsa@redhat.com>

thanks,
jirka
diff mbox

Patch

diff --git a/tools/perf/util/unwind.c b/tools/perf/util/unwind.c
index 0efd539..416f22b 100644
--- a/tools/perf/util/unwind.c
+++ b/tools/perf/util/unwind.c
@@ -340,10 +340,10 @@  find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
 	/* Check the .debug_frame section for unwinding info */
 	if (!read_unwind_spec_debug_frame(map->dso, ui->machine, &segbase)) {
 		memset(&di, 0, sizeof(di));
-		dwarf_find_debug_frame(0, &di, ip, 0, map->dso->name,
-				       map->start, map->end);
-		return dwarf_search_unwind_table(as, ip, &di, pi,
-						 need_unwind_info, arg);
+		if (dwarf_find_debug_frame(0, &di, ip, 0, map->dso->name,
+					   map->start, map->end))
+			return dwarf_search_unwind_table(as, ip, &di, pi,
+							 need_unwind_info, arg);
 	}
 #endif