diff options
author | David Goulet <dgoulet@torproject.org> | 2020-11-03 08:59:29 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2020-11-03 09:05:53 -0500 |
commit | 486ddde2c4946d3e7da2c9b217e28c08b36931f5 (patch) | |
tree | 66ee58c070b96b563a22cbe57b57c9911d53e3b9 | |
parent | 4f5a116618fdb1707905c2fc602a216f7da22e6e (diff) | |
download | tor-486ddde2c4946d3e7da2c9b217e28c08b36931f5.tar.gz tor-486ddde2c4946d3e7da2c9b217e28c08b36931f5.zip |
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>
-rw-r--r-- | changes/ticket40174 | 4 | ||||
-rw-r--r-- | configure.ac | 24 |
2 files changed, 23 insertions, 5 deletions
diff --git a/changes/ticket40174 b/changes/ticket40174 new file mode 100644 index 0000000000..869a2756f4 --- /dev/null +++ b/changes/ticket40174 @@ -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. diff --git a/configure.ac b/configure.ac index 165b337a21..8bb6e6bbde 100644 --- a/configure.ac +++ b/configure.ac @@ -292,11 +292,25 @@ if test "x$enable_tracing_instrumentation_usdt" = "xyes"; then AC_CHECK_HEADERS([sys/sdt.h], [], [AC_MSG_ERROR([USDT instrumentation requires sys/sdt.h header. On Debian, apt install systemtap-sdt-dev])], []) - 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_CHECKING([STAP_PROBEV()]) + AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ + #define SDT_USE_VARIADIC + #include <sys/sdt.h> + 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 dnl Tracepoints event to debug logs. |