diff options
author | Harald Welte <laforge@osmocom.org> | 2020-09-26 11:51:32 +0200 |
---|---|---|
committer | laforge <laforge@osmocom.org> | 2021-02-03 13:55:40 +0000 |
commit | 433005c87c88912358bfd02d4b0d997b52b04013 (patch) | |
tree | d5f71f3faff20b53daf14a4975b33b3284babe1d /configure.ac | |
parent | dc43f7d3c73dc4cbe4e94668c635f056756f6d8a (diff) |
initial support for static userspace probes via systemtap
This adds a --enable-systemtap configure option, which will then
add static tracepoints to the generated libosmocore binary.
At this point, only two tracepoints are supported: log_start
and log_done. They can be used to trace the amount of time
a libosmocore-using application spends in potentiall blocking calls to
log to stderr or to files.
Related: OS#4311
Change-Id: I7e1ab664241deb524c9582cbd1bec31af46c747e
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 2077570f..2a6a1807 100644 --- a/configure.ac +++ b/configure.ac @@ -433,6 +433,38 @@ AC_MSG_CHECKING([whether to enable ARM NEON instructions support]) AC_MSG_RESULT([$neon]) AM_CONDITIONAL(HAVE_NEON, [test "x$neon" != "xno"]) +# +# SystemTap support +# +AC_MSG_CHECKING([whether to include systemtap tracing support]) +AC_ARG_ENABLE([systemtap], + [AS_HELP_STRING([--enable-systemtap], + [Enable inclusion of systemtap trace support])], + [ENABLE_SYSTEMTAP="${enableval}"], [ENABLE_SYSTEMTAP='no']) +AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes]) +AC_MSG_RESULT(${ENABLE_SYSTEMTAP}) + +if test "x${ENABLE_SYSTEMTAP}" = xyes; then + # Additional configuration for --enable-systemtap is HERE + 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 using SystemTap probes.]) + 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 + ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset" + else + ABS_TAPSET_DIR="${withval}" + fi], [ABS_TAPSET_DIR="\$(datadir)/systemtap/tapset"]) + AC_SUBST(ABS_TAPSET_DIR) +fi + OSMO_AC_CODE_COVERAGE @@ -487,6 +519,7 @@ AC_OUTPUT( src/gb/Makefile src/ctrl/Makefile src/pseudotalloc/Makefile + tapset/Makefile tests/Makefile tests/atlocal utils/Makefile |