about summary refs log tree commit diff
path: root/configure.in
diff options
context:
space:
mode:
authorRoland McGrath <roland@hack.frob.com>2012-05-25 13:40:20 -0700
committerRoland McGrath <roland@hack.frob.com>2012-05-25 13:40:20 -0700
commit3a097cc7a18309c864186c1b864b90889d2a45e9 (patch)
tree90867caf9bc281dee470b566c7a3188ce86d20c1 /configure.in
parent21708942c9b115a91dc03318a5f9e14328c5a71e (diff)
downloadglibc-3a097cc7a18309c864186c1b864b90889d2a45e9.tar.gz
glibc-3a097cc7a18309c864186c1b864b90889d2a45e9.tar.xz
glibc-3a097cc7a18309c864186c1b864b90889d2a45e9.zip
Add --enable-systemtap configuration to define static probe points.
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in24
1 files changed, 24 insertions, 0 deletions
diff --git a/configure.in b/configure.in
index 38b55a6784..1ae9ca48fb 100644
--- a/configure.in
+++ b/configure.in
@@ -252,6 +252,7 @@ else
 fi
 AC_SUBST(libc_cv_nss_crypt)
 
+
 AC_ARG_ENABLE([obsolete-rpc],
               AC_HELP_STRING([--enable-obsolete-rpc],
                              [build and install the obsolete RPC code for link-time usage]),
@@ -263,6 +264,29 @@ if test "$link_obsolete_rpc" = yes; then
   AC_DEFINE(LINK_OBSOLETE_RPC)
 fi
 
+AC_ARG_ENABLE([systemtap],
+              [AS_HELP_STRING([--enable-systemtap],
+	       [enable systemtap static probe points @<:@default=no@:>@])],
+              [systemtap=$enableval],
+	      [systemtap=no])
+if test "x$systemtap" != xno; then
+  AC_CACHE_CHECK([for systemtap static probe support], libc_cv_sdt, [dnl
+  old_CFLAGS="$CFLAGS"
+  CFLAGS="-std=gnu99 $CFLAGS"
+  AC_COMPILE_IFELSE([#include <sys/sdt.h>
+void foo (int i, void *p)
+{
+  asm ("" STAP_PROBE_ASM (foo, bar, STAP_PROBE_ASM_TEMPLATE (2)) ""
+       :: STAP_PROBE_ASM_OPERANDS (2, i, p));
+}], [libc_cv_sdt=yes], [libc_cv_sdt=no])
+  CFLAGS="$old_CFLAGS"])
+  if test $libc_cv_sdt = yes; then
+    AC_DEFINE([USE_STAP_PROBE])
+  elif test "x$systemtap" != xauto; then
+    AC_MSG_FAILURE([systemtap support needs sys/sdt.h with asm support])
+  fi
+fi
+
 # The way shlib-versions is used to generate soversions.mk uses a
 # fairly simplistic model for name recognition that can't distinguish
 # i486-pc-linux-gnu fully from i486-pc-gnu.  So we mutate a $host_os