I’ll continue part 2 of this article on how I built Systemtap from source and installed it.
After I fetched theÂ source with:
git clone git://sources.redhat.com/git/systemtap.git
A “systemtap” directory with source was created in my pwd. I like to build out-of-tree to keep the source pristine, so I created a new build directory:
mkdir systemtap_obj cd systemtap_obj
and ran the configure step
On a Fedora 9 LiveCD install, with a few extra custom rpm’s added, I found I had to install some libraries. The steps to install them are all a bit similar, but here is an example of a missing library error I encountered:
checking sys/capability.h usability... no checking sys/capability.h presence... no checking for sys/capability.h... no configure: error: cannot find required libcap header (libcap-devel may need to be installed)
And here is how I installed the library to fix for this error:
sudo yum install libcap-devel
I had to rerun the configure script several times to catch all the missing libraries.Â In the end I had to install both libcap-devel, and elfutils-devel. Your experience may vary depending on your install.
And finally,Â I built Systemtap with:
The build took a few minutes. I installed Systemtap with:
sudo make install
The whole process from fetching source, to building it, to installing it took less than five minutes, which was a pleasant surprise.
Tommorrow I’ll take a look at example scripts, but here is a neat example I ran:
sudo stap ~/systemtap/testsuite/systemtap.examples/syscalls_by_proc.stp
Collecting data... Type Ctrl-C to exit and display results #SysCallsÂ Process Name 917Â Â Â Â Â Â Â thunderbird-bin 807Â Â Â Â Â Â Â firefox 489Â Â Â Â Â Â Â hal-system-kill 390Â Â Â Â Â Â Â tpb 206Â Â Â Â Â Â Â dbus-daemon