在Red Hat Enterprise Linux 5.8上安装systemtap
2013-02-18 20:32
225 查看
根据http://sourceware.org/systemtap/wiki/SystemTapOnRHEL5里面的内容了解到,由于systemtap有Red Hat Enterprise Linux 5的rpm包,所以我决定不使用源代码的方式,而是使用官方发布的rpm包进行安装。按照上面链接中的说明,安装需要利用rhn登陆redhat官方的repo,然后使用repo中的rpm包安装就行了。由于公司没有rhn,所以只好使用安装盘进行安装。如果有rhn的话,就可以不用看本文的后面部分了,直接按照链接中所示的方法进行安装就好了。
在需要安装systemtap的机器上mount Red Hat Enterprise Linux 5.8的安装盘,使用yum search systemtap后发现有如图所示的rpm包。
![](http://img.my.csdn.net/uploads/201302/18/1361190663_6534.jpg)
看来我们的运气不错,systemtap已经包含在Red Hat Enterprise Linux 5.8的安装盘中了。不过里面的systemtap的版本是1.6的,目前最新(2013-02-18)的版本为2.1。
使用yum install systemtap安装systemtap,安装完成后,根据官方的文档使用命令stap -ve 'probe begin { log("hello world") exit () }'进行测试,systemtap执行正确,输出的结果如图所示。
![](http://img.my.csdn.net/uploads/201302/18/1361190717_9181.jpg)
但使用另外一个命令stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'进行测试时却出现错误的提示,提示的大意是说需要安装内核的
debug-info(请注意这里的debug-info指的不是debug版的内核),按照SystemTap_Beginners_Guide中的指示,使用uname -r获得了内核的准确版本信息,如图所示。
![](http://img.my.csdn.net/uploads/201302/18/1361190780_8846.jpg)
根据得到的内核版本信息,我在ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/i386/Debuginfo/kernel-debuginfo-2.6.18-308.el5.i686.rpm以及ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/i386/Debuginfo/kernel-debuginfo-common-2.6.18-308.el5.i686.rpm下载了内核的调试信息。使用rpm -i安装上述rpm包后,再次测试stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
命令,这次systemtap执行正确,输出的结果如图4所示。这说明systemtap已经安装成功了。
如果用户想使用systemtap对用户程序进行probe的话,根据systemTap_Beginners_Guide中的描述,还需要在系统中安装utrace。由于我暂时还没有这样的使用需求,所以就没有进行这方面相关的测试。
在写本文时才发现,其实Red Hat Enterprise Linux 5.8的安装盘中就有内核的debug-info,大家可以试一下安装盘中的debug-info是否有效果。
systemtap tutorial以及systemTap_Beginners_Guide里面的内容对于systemtap入门非常有帮助。希望有兴趣的朋友可以花时间进行一些了解。大家还可以安装systemtap-testsuite,这个安装包里面有很多实用的脚本,大家可以通过这些脚本更加深入的对systemtap进行学习。
在需要安装systemtap的机器上mount Red Hat Enterprise Linux 5.8的安装盘,使用yum search systemtap后发现有如图所示的rpm包。
![](http://img.my.csdn.net/uploads/201302/18/1361190663_6534.jpg)
看来我们的运气不错,systemtap已经包含在Red Hat Enterprise Linux 5.8的安装盘中了。不过里面的systemtap的版本是1.6的,目前最新(2013-02-18)的版本为2.1。
使用yum install systemtap安装systemtap,安装完成后,根据官方的文档使用命令stap -ve 'probe begin { log("hello world") exit () }'进行测试,systemtap执行正确,输出的结果如图所示。
![](http://img.my.csdn.net/uploads/201302/18/1361190717_9181.jpg)
但使用另外一个命令stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'进行测试时却出现错误的提示,提示的大意是说需要安装内核的
debug-info(请注意这里的debug-info指的不是debug版的内核),按照SystemTap_Beginners_Guide中的指示,使用uname -r获得了内核的准确版本信息,如图所示。
![](http://img.my.csdn.net/uploads/201302/18/1361190780_8846.jpg)
根据得到的内核版本信息,我在ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/i386/Debuginfo/kernel-debuginfo-2.6.18-308.el5.i686.rpm以及ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/i386/Debuginfo/kernel-debuginfo-common-2.6.18-308.el5.i686.rpm下载了内核的调试信息。使用rpm -i安装上述rpm包后,再次测试stap -v -e 'probe vfs.read {printf("read performed\n"); exit()}'
命令,这次systemtap执行正确,输出的结果如图4所示。这说明systemtap已经安装成功了。
如果用户想使用systemtap对用户程序进行probe的话,根据systemTap_Beginners_Guide中的描述,还需要在系统中安装utrace。由于我暂时还没有这样的使用需求,所以就没有进行这方面相关的测试。
在写本文时才发现,其实Red Hat Enterprise Linux 5.8的安装盘中就有内核的debug-info,大家可以试一下安装盘中的debug-info是否有效果。
systemtap tutorial以及systemTap_Beginners_Guide里面的内容对于systemtap入门非常有帮助。希望有兴趣的朋友可以花时间进行一些了解。大家还可以安装systemtap-testsuite,这个安装包里面有很多实用的脚本,大家可以通过这些脚本更加深入的对systemtap进行学习。
相关文章推荐
- Red Hat Linux Enterprise Server 5.8 安装R语言 R-2.13.0
- Red Hat Enterprise Linux 5.2 YUM的完整安装
- Red Hat Enterprise Linux 5 安装 oracle10g
- Red Hat Enterprise Linux 7(RHEL7)卸载openjdk安装sun jdk
- Red Hat Enterprise Linux 7(RHEL7)安装
- Red Hat Enterprise Linux Server 7.4 安装方法
- 在CentOS 5 或Red Hat Enterprise Linux安装语言包
- Red Hat Enterprise Linux AS 5 下载地址及安装号码
- IBM x3650 M4服务器安装Red Hat Enterprise Linux问题
- Red Hat Enterprise Linux 6.6安装体验
- Red Hat Enterprise Linux 4图形界面安装过程
- Oracle 9i 在 Red Hat Enterprise Linux 4 AS u4 上的安装
- Red Hat Enterprise Linux 5 系统中安装Apache
- Red Hat Enterprise Linux Server(RHEL) yum安装软件时This system is not registered with RHN. RHN support wi
- Unix/Linux环境C编程入门教程(24) MySQL 5.7.4 for Red Hat Enterprise 7(RHEL7)的安装
- Red Hat Enterprise Linux 4的安装 推荐
- Red Hat Enterprise Linux 6安装samba服务
- 使用VM虚拟机安装配置Red Hat Enterprise Linux6.5 64位
- Red Hat Enterprise Linux 5 安装
- red hat enterprise linux server安装问题