转自 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.
========================