perf unwind: check symsrc ELF for .debug_frame
Arnaldo Carvalho de Melo
maintainerEm Wed, Aug 10, 2016 at 03:36:16PM +0200, Rabin Vincent escreveu:
Quoted 5 lines
From: Rabin Vincent <[email protected]>
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.
Thanks for your work, next time please also copy the persons that did work on this file recently, like:
He Kuang <[email protected]>
And people who acked or reviewed their patches, like:
Jiri Olsa <[email protected]>
Guys, are you ok with these changes? 2/2 seems trivial enough.
- Arnaldo
Quoted 32 lines
Signed-off-by Rabin Vincent <[email protected]>--- tools/perf/util/unwind-libunwind-local.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)tools/perf/util/unwind-libunwind-local.c +14
-0@@ -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 ;Signature · 1 line
2.1.4
PATCH 1/1 perf unwind: check symsrc ELF for .debug_frame
From: Rabin Vincent <[email protected]>
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.
--- tools/perf/util/unwind-libunwind-local.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
tools/perf/util/unwind-libunwind-local.c +14 -0
@@ -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 ;
Signature · 1 line
2.1.4