Comment 14 for bug 669641

Revision history for this message
Peter Petrakis (peter-petrakis) wrote :

OK, so I think you have a build issue, as I can add the run the objcopy
line alone and verify the heading was added.

root@ubuntu:/usr/lib/debug# lsb_release -r
Release: 12.04
root@ubuntu:/usr/lib/debug# uname -a
Linux ubuntu 3.4.0-3-generic #7~lp669641v201205242144 SMP Thu May 24 21:45:43 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

root@ubuntu:~# objcopy \
> --add-gnu-debuglink=/usr/lib/debug/lib/modules/3.4.0-3-generic/kernel/drivers/scsi/libiscsi.ko /lib/modules/3.4.0-3-generic/kernel/drivers/scsi/libiscsi.ko

root@ubuntu:~# objdump -h /lib/modules/3.4.0-3-generic/kernel/drivers/scsi/libiscsi.ko | grep -A2 debuglink
 21 .gnu_debuglink 00000010 0000000000000000 0000000000000000 00009aae 2**0
                  CONTENTS, READONLY

but systemtap still fumbles over it, no entries found.

root@ubuntu:~# stap -l 'module("libiscsi").function("*")'

But strace confirms that the debug file was opened

stat("/lib/modules/3.4.0-3-generic/kernel/drivers/scsi/libiscsi.ko", {st_mode=S_IFREG|0644, st_size=87192, ...}) = 0
open("/lib/modules/3.4.0-3-generic/kernel/drivers/scsi/libiscsi.ko", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=87192, ...}) = 0
close(4) = 0
open("/lib/modules/3.4.0-3-generic/kernel/drivers/scsi/.debug/libiscsi.ko", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/debug/lib/modules/3.4.0-3-generic/kernel/drivers/scsi/libiscsi.ko", O_RDONLY) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=689768, ...}) = 0
fcntl(4, F_GETFL) = 0x8000 (flags O_RDONLY|O_LARGEFILE)
fstat(4, {st_mode=S_IFREG|0644, st_size=689768, ...}) = 0
mmap(NULL, 689768, PROT_READ|PROT_WRITE, MAP_PRIVATE, 4, 0) = 0x7faaa4333000
munmap(0x7faaa4333000, 689768) = 0
close(4) = 0
close(4) = -1 EBADF (Bad file descriptor)

So what went wrong? When I go back and apply the script that
creates the shadow links to the debug files the result is the same, no
output, regardless of the module I choose to test.

I think your build is broken.