Skip to content

Instantly share code, notes, and snippets.

@alexandrnikitin
Created August 11, 2017 14:06
Show Gist options
  • Save alexandrnikitin/7fd095371e8c105f6cb9ab7f87664547 to your computer and use it in GitHub Desktop.
Save alexandrnikitin/7fd095371e8c105f6cb9ab7f87664547 to your computer and use it in GitHub Desktop.
Install systemtap on Centos 7
sudo yum install -y systemtap systemtap-runtime
sudo yum install kernel-debuginfo kernel-debuginfo-common
sudo yum install yum-utils
debuginfo-install kernel-3.10.0-514.21.2.el7.x86_64
sudo yum install -y kernel-devel-$(uname -r)
sudo yum install -y kernel-debuginfo-$(uname -r)
sudo yum install -y kernel-debuginfo-common-$(uname -m)-$(uname -r)
@yarilc
Copy link

yarilc commented Aug 12, 2017

it requires --enablerepo=base-debuginfo that is disabled by default on CentOS systems.

@nextkitt
Copy link

Good job

@CharmingYang0
Copy link

Tried to install it in CentOS 7.5, it seems systemtap-devel is requried as well.
Or

runtime_defines.h: No such file or directory

will occurred if execute
stap -ve 'probe begin { log("hello world") exit() }'

@cheng0214
Copy link

In CentOS 7.4, it seems systemtap-devel is also required

@VladExDiego
Copy link

VladExDiego commented Apr 30, 2020

The names of the packages have changed as of 29 April 2020. This ran fine on Centos 7 build 2003

sudo yum install -y systemtap systemtap-devel systemtap-runtime
sudo yum install -y yum-utils
sudo yum install -y wget

uname -r
3.10.0-1127.el7.x86_64

browse http://debuginfo.centos.org/7/x86_64/

In the case of kernel build 1127 there are 7 packages, and debuginfo-common needs to come first

http://debuginfo.centos.org/7/x86_64/kernel-debuginfo-common-x86_64-3.10.0-1127.el7.x86_64.rpm
http://debuginfo.centos.org/7/x86_64/kernel-debug-debuginfo-3.10.0-1127.el7.x86_64.rpm
http://debuginfo.centos.org/7/x86_64/kernel-debuginfo-3.10.0-1127.el7.x86_64.rpm
http://debuginfo.centos.org/7/x86_64/kernel-plus-debuginfo-3.10.0-1127.el7.centos.plus.x86_64.rpm
http://debuginfo.centos.org/7/x86_64/kernel-plus-debuginfo-common-x86_64-3.10.0-1127.el7.centos.plus.x86_64.rpm
http://debuginfo.centos.org/7/x86_64/kernel-plus-tools-debuginfo-3.10.0-1127.el7.centos.plus.x86_64.rpm

this one conflicts with the previous one, don't know if that is good, bad, or ...

http://debuginfo.centos.org/7/x86_64/kernel-tools-debuginfo-3.10.0-1127.el7.x86_64.rpm

(a)
wget http://debuginfo.centos.org/7/x86_64/kernel-plus-debuginfo-common-x86_64-3.10.0-1127.el7.centos.plus.x86_64.rpm
sudo yum --enablerepo=base-debuginfo localinstall -y kernel-plus-debuginfo-common-x86_64-3.10.0-1127.el7.centos.plus.x86_64.rpm

(b)
sudo yum --enablerepo=base-debuginfo localinstall -y http://debuginfo.centos.org/7/x86_64/kernel-plus-debuginfo-common-x86_64-3.10.0-1127.el7.centos.plus.x86_64.rpm

(and do systemtap)
sudo stap -ve 'probe begin { log("hello world") exit() }'

this is slightly more demanding of the symbols

sudo stap -ve 'probe vfs.read {printf("read performed\n"); exit()}'

@beppe9000
Copy link

any particular quirk for cpanel hosts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment