This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: backtrace and self-compiled module
Hi Mark,
Mark Wielaard wrote:
Hi Christian,
On Wed, 2009-06-03 at 16:07 +0200, Christian Kaiser wrote:
I have a question related to the 'backtrace()' function in conjunction
with self-compiled modules. Running my script (see below) on a kernel
functions gives correct output while running it on a module from our
drivers gives mostly only two correct lines. I have to switch between
line three and four of my script to swap between kernel functions and
module functions.
[...]
Any comments are welcome!
If you script doesn't probe anything in the kernel proper (like in your
second module example) stap doesn't know to include the symbol and
unwind tables of the kernel itself. To make your second example unwind
through and show the functions inside the kernel proper add -d kernel:
stap -d kernel -v stack_trace.stp sunrpc cache_cleanup
Maybe we should just always include the kernel symbols/unwind table by
default to prevent surprises like you got.
Thanks for your effort but that doesn't solve my problem. It is still
two correct lines only...
I'll try to give some more detail of what the backtrace should look like.
[root@sunf-1 ~]# stap -d kernel -v stack_trace.stp dis_ssocks
AF_SCI_stream_trigger_setup
Pass 1: parsed user script and 45 library script(s) in
120usr/0sys/132real ms.
Pass 2: analyzed script: 2 probe(s), 3 function(s), 0 embed(s), 1
global(s) in 50usr/100sys/146real ms.
Pass 3: translated to C into
"/tmp/stap84brey/stap_a79c1715703e68e73c470ed324c61598_1175.c" in
180usr/160sys/344real ms.
Pass 4: compiled C into "stap_a79c1715703e68e73c470ed324c61598_1175.ko"
in 1520usr/260sys/1707real ms.
Pass 5: starting run.
===== (1) =====
0xffffffff8850894a : AF_SCI_stream_trigger_setup+0x1/0x74 [dis_ssocks]
0xffffffff884ff04e : AF_SCI_init_sciconn+0x186/0x1b3 [dis_ssocks]
0x00ffffffff884ff0 : _osif_sock_cb_state_change+0xffffffff884ff0/0x0
[dis_ssocks]
0x0400ffffffff884f : _osif_sock_cb_state_change+0x400ffffffff884f/0x0
[dis_ssocks]
0xe40400ffffffff88 : _osif_sock_cb_state_change+0xe40400ffffffff88/0x0
[dis_ssocks]
0x3de40400ffffffff : _osif_sock_cb_state_change+0x3de40400ffffffff/0x0
[dis_ssocks]
0x00000043de40400f : _osif_sock_cb_state_change+0x43de40400f/0x0
[dis_ssocks]
===== (1) =====
0xffffffff8850894a : AF_SCI_stream_trigger_setup+0x1/0x74 [dis_ssocks]
0xffffffff884ff04e : AF_SCI_init_sciconn+0x186/0x1b3 [dis_ssocks]
0x00ffffffff884ff0 : _osif_sock_cb_state_change+0xffffffff884ff0/0x0
[dis_ssocks]
0x6800ffffffff884f : _osif_sock_cb_state_change+0x6800ffffffff884f/0x0
[dis_ssocks]
0xf16800ffffffff88 : _osif_sock_cb_state_change+0xf16800ffffffff88/0x0
[dis_ssocks]
[...]
should look like:
AF_SCI_stream_trigger_setup [dis_ssocks/intr.c]
AF_SCI_init_sciconn [dis_ssocks/stream.c]
stream_start_connecter [dis_ssocks/connect.c, defined as static]
AF_SCI_stream_connect [dis_ssocks/connect.c]
[...]
I find all symbols except the one for stream_start_connecter (OK since
it is defined as static) in the dis_ssocks.ko file.
0000000000013949 T AF_SCI_stream_trigger_setup
0000000000009ec8 T AF_SCI_init_sciconn
000000000000ef70 T AF_SCI_stream_connect
Christian
--
Christian Kaiser, Software Engineer, Dolphin Interconnect Solutions
http://www.dolphinics.com