This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dwarf unwinder (only works on i386/x86_64) - now with eh_frame and debug_frame fallback


On Thu, 2009-05-21 at 11:44 -0700, Roland McGrath wrote:
> > The "ugly" code in these patches is in adjustStartAddress() in
> > runtime/unwind.c. This really should go into _stp_module_relocate or
> > read_pointer. One tricky issue here is that we read the eh_frame section
> > during translation time and then load it in kernel space at module init
> > time. eh_frame tables can use pointer encodings that are absolute or
> > pc_relative (actually data relative), so we need to readjust for the new
> > load location of the eh_frame.
> 
> In the long run I think the right thing here will be to convert the data at
> translation time.  That is, make all addresses use a simple "absolute" form
> (as is usual in .debug_frame), which really means "loadbase-relative" for
> DSOs--i.e., the same as addresses in the symbol table, etc.  Then at run
> time you just have one uniform way to treat addresses in each module.
> That keeps things as simple as possible at runtime.

Yes, agreed.

> > Some optimizations that could be done:
> > - Use the eh_frame_hdr binary search table
> >   (needs careful auditing of adjustStartAddress -> read_pointer).
> [...]
> > - Merge debug_frame and eh_frame at runtime and build our own
> >   binary search hdr.
> 
> By "runtime" here, you mean "translation time", right?  In the unspecified
> future, elfutils libs will provide easy-to-use code for merging tables,
> emitting them in whichever format, and generating binary search tables.
> Probably any such optimization concerns can wait for that.

Yes, I meant translation time. It would be wonderful if elfutils
provides an easy way to, merge the tables, transform them to be
"loadbase-relative" and generate a binary-search hdr for the result. I
am not sure how urgent such an cleanup and optimization is, we don't
have much experience with the user backtraces (or the kernel dwarf
unwinder for that matter). It isn't on my "short-list" at the moment.

Cheers,

Mark


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]