Centos 6.4下SystemTap安装

安装

首先内核配置文件中已经启动以下选项:

CONFIG_DEBUG_INFO 
CONFIG_KPROBES 
CONFIG_DEBUG_FS 
CONFIG_RELAY

 

安装systemtap

#debuginfo-install kernel
#wget ftp://sources.redhat.com/pub/systemtap/releases/systemtap-2.4.tar.gz
#wget https://fedorahosted.org/releases/e/l/elfutils/elfutils-0.148.tar.bz2
#tar –zxvf systemtap-2.4.tar.gz
#bzip2 –d elfutils-0.148.tar.bz2
#tar –xvf elfutils-0.148.tar
#cd systemtap-2.4.tar
#./configure –with-elfutils=/root/ elfutils-0.148
#make
#make install

 

安装完成后,通过下述方法确认systemtap安装完成

[root@db systemtap-2.4]# stap -ve 'probe begin{ log("hello systemtap!") exit() }'                                                                                                
Pass 1: parsed user script and 96 library script(s) using 145536virt/25196res/2092shr/24152data kb, in 220usr/10sys/343real ms.
Pass 2: analyzed script: 1 probe(s), 2 function(s), 0 embed(s), 0 global(s) using 146064virt/25988res/2184shr/24680data kb, in 0usr/0sys/5real ms.
Pass 3: translated to C into "/tmp/stapcaqE7w/stap_dc0ade70209d4a5bffbaa0dfcefab41c_935_src.c" using 146056virt/26296res/2444shr/24672data kb, in 0usr/0sys/0real ms.
Pass 4: compiled C into "stap_dc0ade70209d4a5bffbaa0dfcefab41c_935.ko" in 6650usr/780sys/14477real ms.
Pass 5: starting run.
hello systemtap!
Pass 5: run completed in 10usr/40sys/381real ms.

使用

           目前个人对于Systemtap的时候主要依赖于其默认的示例文件,示例文件存放于/usr/local/share/doc/systemtap/examples/中,主要包含generalinterruptiolocksmemorynetworkprocessprofilingstapgamesvirtualization这些内容。


你可能感兴趣的:(Centos 6.4下SystemTap安装)