summaryrefslogtreecommitdiffstats
path: root/Makefile.am
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 /Makefile.am
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 'Makefile.am')
-rw-r--r--Makefile.am43
1 files changed, 41 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index eb4ea65fa..a20f0a52c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,6 +12,8 @@ DISTCHECK_CONFIGURE_FLAGS = --with-ldb-lib-dir="$$dc_install_base"/lib/ldb \
--enable-all-experimental-features \
$(extra_distcheck_flags) \
$(AUX_DISTCHECK_CONFIGURE_FLAGS)
+CLEANFILES = $(NULL)
+BUILT_SOURCES = $(NULL)
SUBDIRS = po
@@ -403,6 +405,7 @@ dist_noinst_DATA = \
contrib/ci/sssd.supp \
src/tests/cmocka/p11_nssdb/cert9.db \
src/tests/cmocka/p11_nssdb/key4.db \
+ $(SYSTEMTAP_PROBES) \
$(NULL)
###############################
@@ -895,6 +898,9 @@ libsss_util_la_SOURCES += \
src/db/sysdb_ssh.c \
src/util/sss_ssh.c
endif
+if BUILD_SYSTEMTAP
+libsss_util_la_LIBADD += stap_generated_probes.lo
+endif
libsss_util_la_LDFLAGS = -avoid-version
pkglib_LTLIBRARIES += libsss_semanage.la
@@ -1067,6 +1073,39 @@ include_HEADERS += \
src/lib/sifp/sss_sifp_dbus.h
endif
+#########################
+# Systemtap tracing #
+#########################
+
+if BUILD_SYSTEMTAP
+SYSTEMTAP_PROBES = \
+ $(srcdir)/src/systemtap/sssd_probes.d \
+ $(NULL)
+
+stap_generated_probes.h: $(srcdir)/src/systemtap/sssd_probes.d
+ $(AM_V_GEN)$(DTRACE) -C -h -s $< -o $@
+
+stap_generated_probes.o: $(srcdir)/src/systemtap/sssd_probes.d stap_generated_probes.h
+ $(AM_V_GEN)$(DTRACE) -C -G -s $< -o $@
+
+stap_generated_probes.lo: stap_generated_probes.o
+ $(AM_V_GEN)printf %s\\n \
+ '# $@ - a libtool object file' \
+ '# Generated by libtool (GNU libtool) 2.4' \
+ '# Actually generated by Makefile.am, in order to shut up libtool' \
+ "pic_object='$<'" \
+ "non_pic_object='$<'" \
+ > $@
+
+BUILT_SOURCES += stap_generated_probes.h
+
+CLEANFILES += stap_generated_probes.h \
+ stap_generated_probes.o \
+ stap_generated_probes.lo \
+ $(NULL)
+
+endif
+
####################
# Sbus Codegen #
####################
@@ -1099,7 +1138,7 @@ CODEGEN_CODE = \
$(CODEGEN_CODE): $(SBUS_CODEGEN)
-BUILT_SOURCES = $(CODEGEN_CODE)
+BUILT_SOURCES += $(CODEGEN_CODE)
####################
# Program Binaries #
@@ -3782,7 +3821,7 @@ endif
rm -f $(builddir)/src/sysv/systemd/sssd.service
rm -f $(builddir)/src/sysv/systemd/journal.conf
-CLEANFILES = *.X */*.X */*/*.X
+CLEANFILES += *.X */*.X */*/*.X
tests: all $(check_PROGRAMS)
(cd src/tests/cwrap && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1;