public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Question about kernel module debug
@ 2007-10-16  3:12 Yuxin_Zhuang
  2007-10-16  3:24 ` Yuxin_Zhuang
  2007-10-16 16:01 ` Frank Ch. Eigler
  0 siblings, 2 replies; 8+ messages in thread
From: Yuxin_Zhuang @ 2007-10-16  3:12 UTC (permalink / raw)
  To: systemtap; +Cc: Yuxin_Zhuang

Hi,Systemtap users:

I've installed systemtap 0.5.8 on RHEL4 with kernel 2.6.9-42. I wanna
use systemtap to debug a kernel module which is not built into the
kernel and I got some questions.

1. Is the 'debuginfo' of the module needed by systemtap is just the
stuff created by gcc with option '-g'? Will an additional '-O2' make a
lot of difference?

2. I've put the '.ko' file which is built with options '-g -O2' under
the proper search path and created a symbol link with the suffix
'.ko.debug' to it. Before the systemtap is run, the module has been
loaded and works well. But systemtap reported that it can not find the
module's debuginfo. 
The output is: 

Pass 1: parsed user script and 25 library script(s) in
80usr/10sys/136real ms.
semantic error: cannot find module my_module debuginfo: r_offset is
bogus
semantic error: no match for probe point
while: resolving probe point module("my_module").function("*")
Pass 2: analyzed script: 2 probe(s), 0 function(s), 0 global(s) in
0usr/30sys/43real ms.
Pass 2: analysis failed.  Try again with more '-v' (verbose) options.

And I straced the stap, the output before printing the error is as
follows :

......
open("/usr/lib/systemtap/../lib/systemtap/libebl_i386.so", O_RDONLY) =
-1 ENOENT (No such file or directory)
open("/usr/lib/systemtap/libebl_i386.so", O_RDONLY) = 5
read(5, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`\6\0\000"...,
512) = 512
fstat64(5, {st_mode=S_IFREG|0755, st_size=7724, ...}) = 0
old_mmap(NULL, 10596, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5,
0) = 0xcf5000
old_mmap(0xcf7000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x1000) = 0xcf7000
close(5)                                = 0
open("/lib/modules/2.6.9-42.ELsmp/kernel/fs/my_module/my_module.ko.debug
", O_RDONLY|O_LARGEFILE) = 5
fcntl64(5, F_GETFL)                     = 0x8000 (flags
O_RDONLY|O_LARGEFILE)
fstat64(5, {st_mode=S_IFREG|0755, st_size=2734531, ...}) = 0
mmap2(NULL, 2734531, PROT_READ|PROT_WRITE, MAP_PRIVATE, 5, 0) =
0xb589f000
open("/sys/module/my_module/sections/.text", O_RDONLY) = 6
fstat64(6, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb589e000
read(6, "0xd0e0c000\n", 4096)           = 11
read(6, "", 4096)                       = 0
close(6)                                = 0
munmap(0xb589e000, 4096)                = 0
open("/sys/module/my_module/sections/.rodata", O_RDONLY) = 6
fstat64(6, {st_mode=S_IFREG|0444, st_size=4096, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0xb589e000
read(6, "0xd0e29c90\n", 4096)           = 11
read(6, "", 4096)                       = 0
close(6)                                = 0
munmap(0xb589e000, 4096)                = 0
write(2, "semantic error: ", 16semantic error: )        = 16
...... 

What can be the reason for the error?? 
Any suggestions will be appreciated, thanks a lot!


ZHUANG Yuxin

^ permalink raw reply	[flat|nested] 8+ messages in thread
* RE: Question about kernel module debug
@ 2007-10-18  5:34 Yuxin_Zhuang
  0 siblings, 0 replies; 8+ messages in thread
From: Yuxin_Zhuang @ 2007-10-18  5:34 UTC (permalink / raw)
  To: fche; +Cc: systemtap

I've also got a newer version of systemtap ( 0.6) with elfutils version
0.129. But it doesn't work either.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-10-19  6:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-16  3:12 Question about kernel module debug Yuxin_Zhuang
2007-10-16  3:24 ` Yuxin_Zhuang
2007-10-16 16:01 ` Frank Ch. Eigler
2007-10-18  2:18   ` Yuxin_Zhuang
2007-10-18  6:17   ` Yuxin_Zhuang
2007-10-18 18:22     ` Frank Ch. Eigler
2007-10-19  6:32       ` Yuxin_Zhuang
2007-10-18  5:34 Yuxin_Zhuang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).