mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-23 20:03:31 +01:00
configure: Check STAP_PROBEV macro when building with USDT tracing
It turns out that STAP_PROBEV() is not available on FreeBSD thus having sdt/sdt.h is not enough. Look for it now at configure time. Closes #40174 Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
parent
4f5a116618
commit
486ddde2c4
4
changes/ticket40174
Normal file
4
changes/ticket40174
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
o Minor bugfixes (configure, build):
|
||||||
|
- With USDT tracing enabled, if STAP_PROBEV() is missing, don't attempt to
|
||||||
|
build. Linux supports that macro but not the BSDs. Fixes bug 40174; bugfix
|
||||||
|
on 0.4.5.1-alpha.
|
24
configure.ac
24
configure.ac
@ -292,11 +292,25 @@ if test "x$enable_tracing_instrumentation_usdt" = "xyes"; then
|
|||||||
AC_CHECK_HEADERS([sys/sdt.h], [],
|
AC_CHECK_HEADERS([sys/sdt.h], [],
|
||||||
[AC_MSG_ERROR([USDT instrumentation requires sys/sdt.h header.
|
[AC_MSG_ERROR([USDT instrumentation requires sys/sdt.h header.
|
||||||
On Debian, apt install systemtap-sdt-dev])], [])
|
On Debian, apt install systemtap-sdt-dev])], [])
|
||||||
dnl LTTng generates USDT probes if the UST library was built with
|
AC_MSG_CHECKING([STAP_PROBEV()])
|
||||||
dnl --with-sdt. There is unfortunately no way to check that so we always
|
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||||
dnl build the USDT probes even though LTTng instrumentation was requested.
|
#define SDT_USE_VARIADIC
|
||||||
AC_DEFINE([USE_TRACING_INSTRUMENTATION_USDT], [1], [Using USDT instrumentation])
|
#include <sys/sdt.h>
|
||||||
have_tracing=1
|
void test(void)
|
||||||
|
{
|
||||||
|
STAP_PROBEV(p, n, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
|
||||||
|
}
|
||||||
|
]])], [
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
dnl LTTng generates USDT probes if the UST library was built with
|
||||||
|
dnl --with-sdt. There is unfortunately no way to check that so we always
|
||||||
|
dnl build the USDT probes even though LTTng instrumentation was requested.
|
||||||
|
AC_DEFINE([USE_TRACING_INSTRUMENTATION_USDT], [1], [Using USDT instrumentation])
|
||||||
|
have_tracing=1
|
||||||
|
], [
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_ERROR([USDT tracing support requires STAP_PROBEV()])
|
||||||
|
])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl Tracepoints event to debug logs.
|
dnl Tracepoints event to debug logs.
|
||||||
|
Loading…
Reference in New Issue
Block a user