2017-09-04 199 views
0

當我使用stap時,它將圖像告訴我這個錯誤,我該如何解決它。如何在docker for mac的centos容器中使用systemtap(stap)

screenshot from error

+0

你可以試着遵循https://github.com/draios/sysdig/issues/637 步驟有一些有趣的觀點是也許可以幫助你。 – Naremy

+0

對不起,如果這是顯而易見的,但即使你得到systemtap來建立一個模塊(完成第4遍),mac osx內核也能夠運行它。 – fche

回答

0

真的不知道爲什麼這個問題已經downvotted一次。當我得到關注時,downvotter是我總是毫不猶豫地要求stackoverflow上的東西的原因之一...

因此,得到了與Ubuntu下的容器相同的問題,這是我如何解決它:嘗試啓動一個Ubuntu在泊塢窗的bash(不CentOS的,但步驟應該是相似的)

docker run -it --cap-add sys_admin ubuntu bash 

然後安裝一些圖書館和SystemTap的

apt-get update 
apt-get --yes install build-essential cmake bc curl diffutils git kmod libcurl4-openssl-dev wget 
apt-get --yes install systemtap systemtap-sdt-dev 

現在安裝內核頭文件(需要時間)

export KERNELVER=$(uname -r | cut -d '-' -f 1) 
export KERNELDIR=/linux-$KERNELVER 
cd/
curl -o linux-${KERNELVER}.tar.gz https://www.kernel.org/pub/linux/kernel/v4.x/linux-${KERNELVER}.tar.gz 
tar zxf linux-${KERNELVER}.tar.gz 
cd linux-${KERNELVER} 
zcat /proc/1/root/proc/config.gz > .config 
make all 
make modules_prepare 
make headers_install 
make modules_install 

現在運行stap -l 'syscall.*'。它應該工作,並顯示:

... 
syscall.waitpid 
syscall.write 
syscall.writev 

這是摘自:https://github.com/fdebonneval/mobydig/blob/master/resources/build

相關問題