歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Linux下安裝使用SystemTap源碼安裝SystemTap

Linux下安裝使用SystemTap源碼安裝SystemTap

日期:2017/2/28 16:20:01   编辑:Linux教程

文章 http://www.linuxidc.com/Linux/2011-03/33415.htm 介紹的是使用CentOS默認的SystemTap,這裡介紹使用SystemTap源碼獨立安裝SystemTap.


源碼下載地址

SystemTap: ftp://sources.redhat.com/pub/systemtap/
SystemTap: ftp://sources.redhat.com/pub/systemtap/releases/
elfutils: https://fedorahosted.org/releases/e/l/elfutils/


SystemTap需要elfutils的支持,並且相應的 elfutils 版本還不能太老,否則執行SystemTap的 ./configure 時會出現如下錯誤:

error: elfutils, libdw too old, need 0.126+

但是安裝SystemTap之前並不是要首先安裝 elfutils ,而是在配置 SystemTap 時指定與 elfutils 相關的參數,使得在編譯安裝SystemTap時自動編譯

--------------------------------------------------

cd /local/zkl/systemtap-1.1
./configure --with-elfutils=/local/zkl/elfutils-0.137 --prefix=/local/zkl/SystemTap
( 配置systemtap安裝參數,指定 elfutils 的源碼目錄以及SystemTap的安裝路徑 )
make
make install

執行完畢,SystemTap安裝在 /local/zkl/SystemTap 下

--------------------------------------------------

[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.

Copyright © Linux教程網 All Rights Reserved