OpenResty® Scalable Web Platform by Extending NGINX with Lua

New! OpenResty is now released!
New! OpenResty is now released!
New! New blog post Official OpenResty Fedora 34 & Alpine 3.13 pkg repo is published.
New! New blog post Real-Time Purge HTTP Cache in OpenResty Edge is published.

Build Systemtap

Yichun Zhang , 27 Jan 2015 (created 04 Mar 2014)

WARNING Building and using open source systemtap can be a daunting and painful process. It is strongly recommended to use our OpenResty XRay product intead. It is much more powerful and also much easier to use.

  1. Install the prerequisites on your Linux distribution, for example:
  • Fedora:
sudo yum install gcc gcc-c++ elfutils-devel
  • Ubuntu:
sudo apt-get install build-essential zlib1g-dev elfutils libdw-dev gettext
  1. Compile and install systemtap from source:
tar -xvf systemtap-2.6.tar.gz
cd systemtap-2.6/
./configure --prefix=/opt/stap --disable-docs \
            --disable-publican --disable-refdocs CFLAGS="-g -O2"
make -j8   # the -j8 option assumes you have about 8 logical CPU cores available
sudo make install

If you'd like to build with the latest elfutils from the official source too:

cd /tmp
tar -xvf elfutils-0.161.tar.bz2

Pass the following option to ./configure when building systemtap (above):


Generally it's recommended to use the elfutils that comes with your package manager if it is up to date, because it's usually compiled with the necessary other libraries such as zlib to decompress headers.

And then invoke stap like this:

$ /opt/stap/bin/stap -V
Systemtap translator/driver (version 2.6/0.161, non-git sources)
Copyright (C) 2005-2014 Red Hat, Inc. and others
This is free software; see the source for copying conditions.

Or you can just add the /opt/stap/bin path to your PATH environment.