轉自 http://blog.csdn.net/zklth/article/details/6248558git
文章 http://blog.csdn.net/zklth/archive/2010/09/28/5912785.aspx 介紹的是使用CentOS默認的SystemTap,這裏介紹使用SystemTap源碼獨立安裝SystemTap.vim
源碼下載地址bash
SystemTap: ftp://sources.redhat.com/pub/systemtap/
SystemTap: ftp://sources.redhat.com/pub/systemtap/releases/
elfutils: https://fedorahosted.org/releases/e/l/elfutils/spa
SystemTap須要elfutils的支持,而且相應的 elfutils 版本還不能太老,不然執行SystemTap的 ./configure 時會出現以下錯誤:.net
error: elfutils, libdw too old, need 0.126+blog
可是安裝SystemTap以前並非要首先安裝 elfutils ,而是在配置 SystemTap 時指定與 elfutils 相關的參數,使得在編譯安裝SystemTap時自動編譯get
--------------------------------------------------源碼
cd /local/zkl/systemtap-1.1
./configure --with-elfutils=/local/zkl/elfutils-0.137 --prefix=/local/zkl/SystemTap
( 配置systemtap安裝參數,指定 elfutils 的源碼目錄以及SystemTap的安裝路徑 )
make
make installit
執行完畢,SystemTap安裝在 /local/zkl/SystemTap 下io
--------------------------------------------------
[root@hdfs05 SystemTap]# ls
bin etc include lib libexec share
[root@hdfs05 SystemTap]# bin/stap -V
SystemTap translator/driver (version 1.1/0.137 non-git sources)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
系統默認安裝的SystemTap能夠不用卸載,由於卸載時可能會卸載一些其它相關的包,如下是查看系統默認安裝的 systemtap,
[root@hdfs05 SystemTap]# rpm -q systemtap
systemtap-0.6.2-1.el5
咱們只須要經過配置環境變量就能使執行命令時首先在咱們安裝的SystemTap中查找命令:
vim ~/.bashrc
export PATH=/local/zkl/SystemTap/bin:$PATH
source ~/.bashrc
[root@hdfs05 SystemTap]# stap -V
SystemTap translator/driver (version 1.1/0.137 non-git sources)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
========================