From patchwork Fri Jun 22 21:29:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [quantal/precise, SRU] bug #669641 - UBUNTU PACKAGING - systemtap fails to discover installed debug modules Date: Fri, 22 Jun 2012 11:29:47 -0000 From: Chris J Arges X-Patchwork-Id: 166678 Message-Id: <4FE4E3CB.3000904@canonical.com> To: Ubuntu Kernel Team BugLink: https://bugs.launchpad.net/bugs/669641 == Precise SRU Justification == Impact: When using systemtap with Ubuntu kernels, the proper debug modules cannot be automatically discovered. == Fix == This patch allows for the build system to insert the .gnu_debuglink sections in the .ko files pointing to the full unstripped .ko in /usr/lib/debug/.. in the dbgsym ddebs. In addition there are checks to ensure the debug symbol actually exists before creating the .gnu_debuglink section. == Testcase == 1) Install systemtap. 2) Run "stap -l 'module("serio_raw").function("*")'" 3) This should show list all the probe points for that module. Thanks, --chris j arges >From cf63b6edab8e47ecb09f1603e3a3d26fe3cda6c6 Mon Sep 17 00:00:00 2001 From: John Rigby Date: Thu, 14 Jun 2012 21:17:38 +0100 Subject: [PATCH] UBUNTU: PACKAGING: add .gnu_debuglink sections to .ko files BugLink: http://launchpad.net/bugs/669641 Kernel module .ko files now have .gnu_debuglink sections pointing to the full unstripped .ko in /usr/lib/debug/.. in the dbgsym ddebs. [Peter Petrakis ] Check that debug symbol ko exists before attempting to create .gnu_debuglink section. Signed-off-by: Peter Petrakis Signed-off-by: Chris J Arges --- debian/rules.d/2-binary-arch.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk index a2555ee..d3460bb 100644 --- a/debian/rules.d/2-binary-arch.mk +++ b/debian/rules.d/2-binary-arch.mk @@ -168,6 +168,15 @@ ifneq ($(skipdbg),true) $(dbgpkgdir)/usr/lib/debug/boot/vmlinux-$(abi_release)-$* $(build_cd) $(kmake) $(build_O) modules_install \ INSTALL_MOD_PATH=$(dbgpkgdir)/usr/lib/debug + # Add .gnu_debuglink sections to each stripped .ko + # pointing to unstripped verson + find $(pkgdir) -name '*.ko' | sed 's|$(pkgdir)||'| while read module ; do \ + if [[ -f "$(dbgpkgdir)/usr/lib/debug/$$module" ]] ; then \ + $(CROSS_COMPILE)objcopy \ + --add-gnu-debuglink=$(dbgpkgdir)/usr/lib/debug/$$module \ + $(pkgdir)/$$module; \ + fi; \ + done rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/build rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/source rm -f $(dbgpkgdir)/usr/lib/debug/lib/modules/$(abi_release)-$*/modules.* -- 1.7.9.5