diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-05-06 22:20:05 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-05-06 22:20:21 +0000 |
commit | f80c52cfe4e08fba39995830a3fcf5835d0bb846 (patch) | |
tree | 4ed83563f04c68492f79c3f7b9e1089356db01f7 /m4/systemtap.m4 | |
parent | b60e0eebc4e108f63372f9a0ffe318589599728f (diff) | |
download | cmogstored-f80c52cfe4e08fba39995830a3fcf5835d0bb846.tar.gz |
We will key most client events by pid() and file descriptors, as this is least ambiguous. There are some minor refactorings to pass "struct mog_fd *" around as much as possible instead of "struct mog_http *".
Diffstat (limited to 'm4/systemtap.m4')
-rw-r--r-- | m4/systemtap.m4 | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/m4/systemtap.m4 b/m4/systemtap.m4 new file mode 100644 index 0000000..dccb9b3 --- /dev/null +++ b/m4/systemtap.m4 @@ -0,0 +1,37 @@ +dnl systemtap support +dnl enable automatically if dtrace and sdt.h are available +AC_DEFUN([CM_SYSTEMTAP],[ +AC_CHECK_PROGS(DTRACE, dtrace) +AC_CHECK_HEADER([sys/sdt.h], [SDT_H_FOUND='yes'], [SDT_H_FOUND='no']) +AS_IF([test "x${DTRACE}" != x && test $SDT_H_FOUND = yes], + AC_CACHE_CHECK([for sys/sdt.h usability], + [cm_cv_sdt_h_usable], [ + AC_TRY_COMPILE([ + #include <sys/sdt.h> + void foo(void) { STAP_PROBE(foo, foo); } + ],[], + [cm_cv_sdt_h_usable=yes], + [cm_cv_sdt_h_usable=no])])) +AS_IF([test $cm_cv_sdt_h_usable = yes], + [ENABLE_SYSTEMTAP=yes], [ENABLE_SYSTEMTAP=no]) + +dnl support explicit --disable-systemtap or --enable-systemtap +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}"]) +AM_CONDITIONAL([ENABLE_SYSTEMTAP], [test x$ENABLE_SYSTEMTAP = xyes]) +AC_MSG_RESULT(${ENABLE_SYSTEMTAP}) + +dnl maybe somebody forced --enable-systemtap w/o dtrace or sdt.h +if test "x${ENABLE_SYSTEMTAP}" = xyes +then + AS_IF([test "x${DTRACE}" = x], [AC_MSG_ERROR([dtrace not found])]) + AS_IF([test $SDT_H_FOUND = no], + [ AC_MSG_ERROR([systemtap support needs sys/sdt.h header]) ]) + AS_IF([test $cm_cv_sdt_h_usable = no], + [ AC_MSG_ERROR([sys/sdt.h header is not usable (clang?)]) ]) + AC_DEFINE([HAVE_SYSTEMTAP], [1], [Define to 1 if using sdt probes.]) +fi +]) |