Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1459426

[PATCH] perf unwind: check symsrc ELF for .debug_frame

From Rabin Vincent <rabin.vincent@axis.com>
Newsgroups linux.kernel
Subject [PATCH] perf unwind: check symsrc ELF for .debug_frame
Date 2016-08-10 20:30 +0200
Message-ID <s4GgI-79-105@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


From: Rabin Vincent <rabinv@axis.com>

When using split debug info, the file without debug info may not have a
.debug_frame section, so we need to check the symsrc ELF also, since
that's the file we actually read the unwind information from.

Signed-off-by: Rabin Vincent <rabinv@axis.com>
---
 tools/perf/util/unwind-libunwind-local.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/tools/perf/util/unwind-libunwind-local.c b/tools/perf/util/unwind-libunwind-local.c
index 97c0f8f..d492192 100644
--- a/tools/perf/util/unwind-libunwind-local.c
+++ b/tools/perf/util/unwind-libunwind-local.c
@@ -308,6 +308,20 @@ static int read_unwind_spec_debug_frame(struct dso *dso,
 		dso__data_put_fd(dso);
 	}
 
+	/*
+	 * With split debug info, the file without debug info may not have a
+	 * .debug_frame, so check the symsrc too.
+	 */
+	if (ofs == 0 && dso->symsrc_filename) {
+		fd = open(dso->symsrc_filename, O_RDONLY);
+		if (fd < 0)
+			return -EINVAL;
+
+		ofs = elf_section_offset(fd, ".debug_frame");
+		dso->data.debug_frame_offset = ofs;
+		close(fd);
+	}
+
 	*offset = ofs;
 	if (*offset)
 		return 0;
-- 
2.1.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH] perf unwind: check symsrc ELF for .debug_frame Rabin Vincent <rabin.vincent@axis.com> - 2016-08-10 20:30 +0200

csiph-web