[PATCH] (v2) read inlining info in an NVIDIA extended line map
Wed Nov 10 15:14:13 GMT 2021
Your tweaks are fine. Many thanks for accepting our patch before 186!
John Mellor-Crummey Professor
Dept of Computer Science Rice University
email: email@example.com phone: 713-348-5179
> On Nov 10, 2021, at 4:16 AM, Mark Wielaard <firstname.lastname@example.org> wrote:
> Hi John,
> On Thu, Nov 04, 2021 at 04:41:58PM -0500, John Mellor-Crummey via Elfutils-devel wrote:
>> Here I describe just the improvements to that patch that address Mark’s concerns:
>> (1) all of the code for handling NVIDIA DWARF extensions is always
>> available; there is no special configuration switch needed.
>> (2) all changes are bracketed by comments that mark them NVIDIA
>> (3) the DWARF extended opcodes have been renamed with names that
>> include NVIDIA in them
>> (4) the two new API functions to surface the new information have
>> been improved to separate the interface result from the internal
>> representation (at Mark’s request)
>> (4a) the API for extracting the name of an inlined function in a
>> DWARF line now returns a const char * instead of a string
>> table index
>> (4b) the API for extracting an inline “context” now returns a
>> pointer to a DWARF line where the code is inlined rather
>> than returning an unsigned int (an index into the line table
>> that one could use to compute the pointer)
>> (5) there are test cases for readelf and libdw that use a binary
>> generated by NVIDIA’s compiler. the test cases include information
>> about how the binary was generated
> This is really nice. I did make a few tweaks:
> - Added your original overview as commit message because it contains
> all the relevant context and pointers to more information.
> - Added ChangeLog and NEWS entries, mainly for my own review.
> - I removed the bracketed comments, I think they cluttered the code
> and made it seem like we wanted to remove it or disable at some
> point. I think it should just be considered part of the normal code
> - I removed the NVIDIA_LINEMAP_INLINING_EXTENSIONS define from
> version.h. If people want they can have a configure check for the
> new dwarf_linecontext or dwarf_linefunctionname functions or the
> DW_LNE_NVIDIA_inlined_call or DW_LNE_NVIDIA_set_function_name
> - I made dwarf_linefunctionname always return NULL on error (not
> the magic string "???", which is still used in readelf).
> - Changed the header check to be exactly 4 bytes, so we are sure to be
> able to read the str offset completely (if it is smaller or larger
> we cannot handle it).
> - The new dwarf_linecontext and dwarf_linefunctionname get their own
> new ELFUTILS_0.186 section in libdw.map because they are introduced
> with verion 0.186.
> - The new run-nvidia-extended-linemap-libdw.sh and
> run-nvidia-extended-linemap-readelf.sh sripts and
> testfile_nvidia_linemap.bz2 testfile were added to EXTRA_DIST so
> they show up in a dist tarball.
> Patch as committed attached. Hope you don't mind the cleanups.
> We still want to reduce the size of the Dwarf_Line_s and struct
> line_state (independent of these extensions). I opened a new bug for
> that: https://sourceware.org/bugzilla/show_bug.cgi?id=28574
More information about the Elfutils-devel