This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC] elfutils: Checks for debuginfo file without .debug extension as well
- From: Ravi Bangoria <ravi dot bangoria at linux dot vnet dot ibm dot com>
- To: Mark Wielaard <mjw at redhat dot com>
- Cc: elfutils-devel at lists dot fedorahosted dot org, systemtap at sourceware dot org, naveen dot n dot rao at linux dot vnet dot ibm dot com, hemant at linux dot vnet dot ibm dot com, Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
- Date: Wed, 17 Feb 2016 13:50:43 +0530
- Subject: Re: [RFC] elfutils: Checks for debuginfo file without .debug extension as well
- Authentication-results: sourceware.org; auth=none
- References: <1455639695-8350-1-git-send-email-ravi dot bangoria at linux dot vnet dot ibm dot com> <1455641106 dot 9915 dot 55 dot camel at redhat dot com>
Hi Mark,
Thanks for reviewing. Please find my comments.
On Tuesday 16 February 2016 10:15 PM, Mark Wielaard wrote:
Hi Ravi,
On Tue, 2016-02-16 at 21:51 +0530, Ravi Bangoria wrote:
Elfutils, looking for kernel debuginfo file, tries to find it at
various places. If elfutils finds /boot/vmlinu*x* file, it checks
for debufginfo section. If debuginfo is not present, it saves it as
'main elf' and continue looking for debuginfo file having .debug
extension i.e. vmlinux-RELEASE.debug.
'Ubuntu on powerpc' installs kernel as /boot/vmlinux and installs
debuginfo without any extension as /usr/lib/debug/boot/vmlinux-RELEASE
and hence, elfutils is not able to find the debuginfo file.
Here is the lunchpad bug for the same:
https://bugs.launchpad.net/ubuntu/+source/systemtap/+bug/1537125
This patch adds functionality to search for file without any extension
followed by searching file having .debug extension.
Thanks for the analysis. I do have a question though.
The reason we are looking for the vmlinux-3.13.0-76-generic.debug
filename instead of the plain vmlinux-3.13.0-76-generic filename seems
to be because /boot/vmlinux contains a .gnu_debuginfo link with the name
of the debug file. But that name doesn't match?
So I should put it this way:
'Ubuntu on powerpc' installs 'stripped' kernel 'without compressing it'
as /boot/vmlinux. Most of the time it's assumed that vmlinux will have
.debuginfo of .debuglink section. But this is not true here. See outputs
below.
What does eu-readelf --strings=.gnu_debuglink /boot/vmlinux* say?
# eu-readelf --strings=.gnu_debuglink /boot/vmlinux*
/boot/vmlinux:
eu-readelf:
section '.gnu_debuglink' does not exist
/boot/vmlinux-3.13.0-76-generic:
eu-readelf:
section '.gnu_debuglink' does not exist
/boot/vmlinux-4.2.0-27-generic:
eu-readelf:
section '.gnu_debuglink' does not exist
/boot/vmlinux.old:
eu-readelf:
section '.gnu_debuglink' does not exist
Would it make sense to not put in the "correct" (without .debug suffix)
debugfile name in .gnu_debuglink
Yes, that should solve the problem. But changing structure of ubuntu
kernel elf to solve stap problem doesn't look feasible to me. IIRC no
other distro do that. I've confirmed this on RHEL. RHEL distro-kernel
does not have .debuglink section.
Then you may ask how this is working in RHEL then. RHEL / Fedora on
powerpc installs stripped uncompressed kernel as /boot/vmlinuz.
elfutils looking for vmlinux, doesn't find it from /boot/, so it continue
looking for file without any suffix(.debug) and it gets proper file. This is
the case with ubunut x86 as well, except on x86, /boot/vmlinuz is
compressed stripped image.
So I thought about this solution as well, renaming /boot/vmlinux to
/boot/vmlinuz will solve the problem. But this is not appropriate. Because
vmlinu*z* is for compressed image and we are just renaming file without
compressing to solve stap problem.
or completely leaving .gnu_debuginfo
out (or is nothing found then?)
Not sure what does this mean. Can you please explain a bit more.
Regards,
Ravi