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]

Re: Evaluating SystemTap for Network Response Times


Hi Nathan,
      I'm also a newbie and finally got this to work. I see you are using
an SMP kernel. So am I. I ran into a problem compiling and loading the
kernel module. I followed the install instructions from the Sept 2005
"Instrumenting the Linux Kernel with SystemTap" and used yum to install the
kernel-devel package. This would have worked fine on the uniprocessor
kernel. To get things to work on my 2way SMP I had to install the smp
kernel stuff. You may have to do the same.  I brute forced the install "yum
install kernel-smp*". If you can't get this example to work you may want to
check the version of the kernel you are running against the develop lib you
have.

I was able to untar Hien's example and run it without any problem. Here is
the verbose output

[root@ibm systap]# stap -I tcp_tapset tcp_mon.stp -v
Created temporary directory "/tmp/stapMLX13C"
Searched '/usr/share/systemtap/tapset/2.6.15-1.1909_FC5smp/i686/*.stp',
match count 0
Searched '/usr/share/systemtap/tapset/2.6.15-1.1909_FC5smp/*.stp', match
count 0
Searched '/usr/share/systemtap/tapset/2.6.15/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6.15/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/2.6/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/i686/*.stp', match count 0
Searched '/usr/share/systemtap/tapset/*.stp', match count 8
Searched 'tcp_tapset/2.6.15-1.1909_FC5smp/i686/*.stp', match count 0
Searched 'tcp_tapset/2.6.15-1.1909_FC5smp/*.stp', match count 0
Searched 'tcp_tapset/2.6.15/i686/*.stp', match count 0
Searched 'tcp_tapset/2.6.15/*.stp', match count 0
Searched 'tcp_tapset/2.6/i686/*.stp', match count 0
Searched 'tcp_tapset/2.6/*.stp', match count 0
Searched 'tcp_tapset/i686/*.stp', match count 0
Searched 'tcp_tapset/*.stp', match count 1
Pass 1: parsed user script and 10 library script(s).
parsed 'tcp_sendmsg' -> func 'tcp_sendmsg'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel' = [c0100000-c04a2a9c, bias 0]
pattern 'tcp_sendmsg' matches function 'tcp_sendmsg'
selected function tcp_sendmsg
finding prologue for 'tcp_sendmsg' entrypc=0xc02c2d2e highpc=0xc02c36b1
finding location for local 'sk' near address c02c2d39, module bias 0
finding location for local 'sk' near address c02c2d39, module bias 0
finding location for local 'sk' near address c02c2d39, module bias 0
finding location for local 'sk' near address c02c2d39, module bias 0
pattern 'kernel' matches module 'kernel'
parsed 'tcp_sendmsg' -> func 'tcp_sendmsg'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel' = [c0100000-c04a2a9c, bias 0]
pattern 'tcp_sendmsg' matches function 'tcp_sendmsg'
selected function tcp_sendmsg
finding prologue for 'tcp_sendmsg' entrypc=0xc02c2d2e highpc=0xc02c36b1
pattern 'kernel' matches module 'kernel'
parsed 'tcp_recvmsg' -> func 'tcp_recvmsg'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel' = [c0100000-c04a2a9c, bias 0]
pattern 'tcp_recvmsg' matches function 'tcp_recvmsg'
selected function tcp_recvmsg
finding prologue for 'tcp_recvmsg' entrypc=0xc02c3819 highpc=0xc02c3f44
pattern 'kernel' matches module 'kernel'
parsed 'do_exit' -> func 'do_exit'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel' = [c0100000-c04a2a9c, bias 0]
pattern 'do_exit' matches function 'do_exit'
selected function do_exit
finding prologue for 'do_exit' entrypc=0xc0125f4a highpc=0xc0126646
pattern 'kernel' matches module 'kernel'
parsed 'tcp_close_state' -> func 'tcp_close_state'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel' = [c0100000-c04a2a9c, bias 0]
pattern 'tcp_close_state' matches function 'tcp_close_state'
selected function tcp_close_state
finding prologue for 'tcp_close_state' entrypc=0xc02c1fdc highpc=0xc02c20d8
pattern 'kernel' matches module 'kernel'
parsed 'tcp_disconnect' -> func 'tcp_disconnect'
pattern 'kernel' matches module 'kernel'
focused on module 'kernel' = [c0100000-c04a2a9c, bias 0]
pattern 'tcp_disconnect' matches function 'tcp_disconnect'
selected function tcp_disconnect
finding prologue for 'tcp_disconnect' entrypc=0xc02c3f44 highpc=0xc02c4316
pattern 'kernel' matches module 'kernel'
Pass 2: analyzed user script.  7 probe(s), 1f function(s), 6 global(s).
Running grep " [tT] " /proc/kallsyms | sort -k 1,8 -s -o
/tmp/stapMLX13C/symbols.sorted
Pass 3: translated to C into "/tmp/stapMLX13C/stap_3315.c"
Running make -C "/lib/modules/2.6.15-1.1909_FC5smp/build"
M="/tmp/stapMLX13C" modules
make: Entering directory `/usr/src/kernels/2.6.15-1.1909_FC5-smp-i686'
  CC [M]  /tmp/stapMLX13C/stap_3315.o
  Building modules, stage 2.
  MODPOST
  CC      /tmp/stapMLX13C/stap_3315.mod.o
  LD [M]  /tmp/stapMLX13C/stap_3315.ko
make: Leaving directory `/usr/src/kernels/2.6.15-1.1909_FC5-smp-i686'
Pass 4: compiled into "stap_3315.ko"
Running sudo /usr/libexec/systemtap/stpd -r -d 3315
/tmp/stapMLX13C/stap_3315.ko
UID   PID         SIZE  NAME  PORT  SOURCE IP
0     2749        106   smbd  445   192.168.1.121

Running rm -rf /tmp/stapMLX13C


-Dave


                                                                           
             Hien Nguyen                                                   
             <hien@us.ibm.com>                                             
             Sent by:                                                   To 
             systemtap-owner@s         Nathan DeBardeleben                 
             ourceware.org             <ndebard@lanl.gov>                  
                                                                        cc 
                                       "systemtap@sources.redhat.com"      
             02/06/2006 07:17          <systemtap@sources.redhat.com>      
             PM                                                    Subject 
                                       Re: Evaluating SystemTap for        
                                       Network Response Times              
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi Nathan,

There are actually two seperate files
1. tcp_mon.stp
2. tcp_tapset/tapset.stp

I include in this mail a tar file for those file for your convenience.
Create a tmp directory,
cd tmp, untar the file and run
stap -I./tcp_tapset tcp_mon.stp (as root)

Thanks, Hien.

Nathan DeBardeleben wrote:

> Hien Nguyen wrote:
>
>> Hi Nathan,
>>
>> I think what you are trying to achieve could be done with systemtap.
>> I wrote a small script to monitor the tcp traffic a while back (see
>> URL below)
>> http://sourceware.org/ml/systemtap/2005-q4/msg00302.html
>>
> I'm a complete newbie to systemtap, so please explain why when I try
> and run the example on the link above that you sent me I get this:
>
>> [root@kraken1 systemtap]# stap -v tcp_mon.stp
>> Created temporary directory "/tmp/stapM6VSNS"
>> parse error: embedded code in unprivileged script
>>         saw: embedded-code at tcp_mon.stp:70:1
>> 1 parse error(s).
>> Searched
>> '/usr/share/systemtap/tapset/2.6.14-1.1656_FC4smp/x86_64/*.stp',
>> match count 0
>> Searched '/usr/share/systemtap/tapset/2.6.14-1.1656_FC4smp/*.stp',
>> match count 0
>> Searched '/usr/share/systemtap/tapset/2.6.14/x86_64/*.stp', match
>> count 0
>> Searched '/usr/share/systemtap/tapset/2.6.14/*.stp', match count 1
>> Searched '/usr/share/systemtap/tapset/2.6/x86_64/*.stp', match count 0
>> Searched '/usr/share/systemtap/tapset/2.6/*.stp', match count 0
>> Searched '/usr/share/systemtap/tapset/x86_64/*.stp', match count 0
>> Searched '/usr/share/systemtap/tapset/*.stp', match count 8
>> Pass 1: parsed user script and 9 library script(s).
>> Pass 1: parse failed.  Running rm -rf /tmp/stapM6VSNS
>> [root@kraken1 systemtap]#
>
> Also you say to copy tapset.stp to a directory you create in that post
> - where do I get tapset.stp?
>
> Sorry for the beginner question :)
>
> -- Nathan
> Correspondence
> ---------------------------------------------------------------------
> Nathan DeBardeleben, Ph.D.
> Los Alamos National Laboratory
> Parallel Tools Team
> High Performance Computing Environments
> phone: 505-667-3428
> email: ndebard@lanl.gov
> ---------------------------------------------------------------------
>
>

(See attached file: tcp_mon.tar.gz)

Attachment: tcp_mon.tar.gz
Description: Binary data


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