This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

backtrace and self-compiled module


Hi all,

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.

stack_trace.stp
---------------
  1 global call_stack
  2
  3 probe kernel.function(@1)
  4 #probe module(@1).function(@2)
  5 {
  6     call_stack[backtrace()] <<< 1
  7 }
  8
  9 probe end
 10 {
 11     foreach (s in call_stack) {
 12         printf("===== (%d) =====\n", @count(call_stack[s]))
 13         print_stack(s)
 14     }
 15     exit()
 16 }
 17

[root@sunf-1 ~]# stap -v stack_trace.stp kmalloc
Pass 1: parsed user script and 45 library script(s) in 120usr/0sys/133real ms.
Pass 2: analyzed script: 526 probe(s), 3 function(s), 0 embed(s), 1 global(s) in 260usr/110sys/370real ms.
Pass 3: translated to C into "/tmp/staprOVIg5/stap_1277d9d38d0d42d1871a8e58cc4e92cf_77904.c" in 170usr/160sys/325real ms.
Pass 4: compiled C into "stap_1277d9d38d0d42d1871a8e58cc4e92cf_77904.ko" in 1530usr/240sys/1710real ms.
Pass 5: starting run.
===== (1) =====
0xffffffff800e7a2e : seq_open+0x1a/0x80 [kernel]
0xffffffff80250511 : sockstat_seq_show+0x0/0xc7 [kernel]
0xffffffff800e7ae9 : single_open+0x55/0x7b [kernel]
0xffffffff80250450 : sockstat_seq_open+0x0/0x11 [kernel]
0xffffffff8001e3b1 : __dentry_open+0xd9/0x1dc [kernel]
0xffffffff800273b2 : do_filp_open+0x2a/0x38 [kernel]
0x00000ffffffff800
===== (1) =====
0xffffffff800e7a9f : single_open+0xb/0x7b [kernel]
0xffffffff80250450 : sockstat_seq_open+0x0/0x11 [kernel]
0xffffffff8001e3b1 : __dentry_open+0xd9/0x1dc [kernel]
0xffffffff800273b2 : do_filp_open+0x2a/0x38 [kernel]
0xffffffff8001979b : do_sys_open+0x44/0xbe [kernel]
0xffffffff8005d28d : add_disk_randomness+0x898/0x14b7 [kernel]
0x00000ffffffffda0
===== (1) =====
0xffffffff80050c7e : vmstat_start+0x13/0x7d [kernel]
0xffffffff800e78c3 : seq_lseek+0xcd/0x21e [kernel]
[...]


vs.

[root@sunf-1 ~]# stap -v stack_trace.stp dis_ssocks stream_adaptive_wait_tx
Pass 1: parsed user script and 45 library script(s) in 130usr/0sys/133real ms.
Pass 2: analyzed script: 2 probe(s), 3 function(s), 0 embed(s), 1 global(s) in 40usr/100sys/147real ms.
Pass 3: using cached /root/.systemtap/cache/17/stap_171c50300958b0a546cae34336fded45_1164.c
Pass 4: using cached /root/.systemtap/cache/17/stap_171c50300958b0a546cae34336fded45_1164.ko
Pass 5: starting run.
===== (1) =====
0xffffffff884fc76d : stream_adaptive_wait_tx+0x1/0x4fa [dis_ssocks]
0xffffffff884fd3c4 : AF_SCI_stream_send_vmessage+0x54f/0x965 [dis_ssocks]
0xf1ffffffff884fd3 : _osif_sock_cb_state_change+0xf1ffffffff884fd3/0x0 [dis_ssocks]
0xe4f1ffffffff884f : _osif_sock_cb_state_change+0xe4f1ffffffff884f/0x0 [dis_ssocks]
0x01e4f1ffffffff88 : _osif_sock_cb_state_change+0x1e4f1ffffffff88/0x0 [dis_ssocks]
0x8001e4f1ffffffff : _osif_sock_cb_state_change+0x8001e4f1ffffffff/0x0 [dis_ssocks]
0x00000008001e4f1f : _osif_sock_cb_state_change+0x8001e4f1f/0x0 [dis_ssocks]
Pass 5: run completed in 0usr/20sys/6340real ms.



I am running:


* CentOS 5.2
* uname -rvmpi: 2.6.18-92.1.22.el5 #1 SMP Tue Dec 16 11:57:43 EST 2008 x86_64 x86_64 x86_64
* stap -V: SystemTap translator/driver (version 0.7.2/0.137 non-git sources)


Any comments are welcome!

Regards,
  Christian

--
Christian Kaiser, Software Engineer, Dolphin Interconnect Solutions
http://www.dolphinics.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]