summaryrefslogtreecommitdiffstats
path: root/src/external
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-02-29 13:05:59 +0100
committerLukas Slebodnik <lslebodn@redhat.com>2016-06-10 18:15:27 +0200
commit29c5542feb4c45865ea61be97e0e84a1d1f04918 (patch)
tree347a2de33b813417be6818fea77cc9ac38556fc6 /src/external
parent53f1b03f4e61ebe21df0c2fd05e09e0504fd8881 (diff)
downloadsssd-29c5542feb4c45865ea61be97e0e84a1d1f04918.tar.gz
sssd-29c5542feb4c45865ea61be97e0e84a1d1f04918.tar.xz
sssd-29c5542feb4c45865ea61be97e0e84a1d1f04918.zip
BUILD: Add build infrastructure for systemtap scripts
Adds infrastructure that generatest the probes.h and probes.o from the dtrace probes.d file. The probes.d file is empty except for the provider name in this commit, its content will be added with later commits that actually add some content. The probes.d file is always distributed in the tarball so that distributions can optionally enable systemtap support. The generation is done using the "dtrace" command because the probes.d file is compatible with the Solaris dtrace format. Please see "man 1 dtrace" for more information on the dtrace format and the command line tool. In order to make libtool happy, a fake libtool object is generated. This hunk was taken from the libvirt code. The AM_V_GEN macro is used to make the build compatible with the silent build configuration. To enable systemtap probing, configure sssd with: --enable-systemtap In order to do so, the 'dtrace' command-line utility must be installed. On Fedora and RHEL, this package is installed as part of the "systemtap-sdt-devel" package. You'll also want the 'systemtap' package installed as well as the matching versions of kernel-devel and kernel-debuginfo on your machine. Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/external')
-rw-r--r--src/external/systemtap.m435
1 files changed, 35 insertions, 0 deletions
diff --git a/src/external/systemtap.m4 b/src/external/systemtap.m4
new file mode 100644
index 000000000..d1caa2017
--- /dev/null
+++ b/src/external/systemtap.m4
@@ -0,0 +1,35 @@
+dnl A macro to check the availability of systemtap user-space probes
+AC_DEFUN([AM_CHECK_SYSTEMTAP],
+[
+ AC_ARG_ENABLE([systemtap],
+ [AS_HELP_STRING([--enable-systemtap],
+ [Enable inclusion of systemtap trace support])],
+ [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no'])
+
+ if test "x${ENABLE_SYSTEMTAP}" = xyes; then
+ AC_CHECK_PROGS(DTRACE, dtrace)
+ if test -z "$DTRACE"; then
+ AC_MSG_ERROR([dtrace not found])
+ fi
+
+ AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'],
+ [SDT_H_FOUND='no';
+ AC_MSG_ERROR([systemtap support needs sys/sdt.h header])])
+
+ AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if systemtap is enabled])
+ HAVE_SYSTEMTAP=1
+
+ AC_ARG_WITH([tapset-install-dir],
+ [AS_HELP_STRING([--with-tapset-install-dir],
+ [The absolute path where the tapset dir will be installed])],
+ [if test "x${withval}" = x; then
+ tapset_dir="\$(datadir)/systemtap/tapset"
+ else
+ tapset_dir="${withval}"
+ fi],
+ [tapset_dir="\$(datadir)/systemtap/tapset"])
+ AC_SUBST(tapset_dir)
+ fi
+
+ AM_CONDITIONAL([BUILD_SYSTEMTAP], [test x$HAVE_SYSTEMTAP = x1])
+])