| 1 | # SYNOPSIS |
| 2 | # |
| 3 | # LTTNG_CHECK_SDT_WORKS([ACTION-SUCCESS], [ACTION-FAILURE]) |
| 4 | # |
| 5 | # DESCRIPTION |
| 6 | # |
| 7 | # Check whether it's possible to build a binary with Systemtap SDT probes. |
| 8 | # |
| 9 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on |
| 10 | # success/failure. |
| 11 | # |
| 12 | # LICENSE |
| 13 | # |
| 14 | # Copyright (c) 2018 Francis Deslauriers <francis.deslauriers@efficios.com> |
| 15 | # Copyright (c) 2019 Michael Jeanson <mjeanson@efficios.com> |
| 16 | # |
| 17 | # Copying and distribution of this file, with or without modification, are |
| 18 | # permitted in any medium without royalty provided the copyright notice |
| 19 | # and this notice are preserved. This file is offered as-is, without any |
| 20 | # warranty. |
| 21 | |
| 22 | #serial 1 |
| 23 | |
| 24 | AC_DEFUN([LTTNG_CHECK_SDT_WORKS], [ |
| 25 | AC_CACHE_CHECK([whether SDT probes compile], [lttng_cv_sdt_works], [ |
| 26 | AC_COMPILE_IFELSE([ |
| 27 | AC_LANG_SOURCE([[ |
| 28 | #define SDT_USE_VARIADIC |
| 29 | #include <sys/sdt.h> |
| 30 | void fct(void) |
| 31 | { |
| 32 | STAP_PROBEV(provider,name,1,2,3,4,5,6,7,8,9,10); |
| 33 | } |
| 34 | ]]) |
| 35 | ], [ |
| 36 | lttng_cv_sdt_works=yes |
| 37 | ], [ |
| 38 | lttng_cv_sdt_works=no |
| 39 | ]) |
| 40 | ]) |
| 41 | AS_IF([test "x$lttng_cv_sdt_works" = "xyes"], [ |
| 42 | m4_default([$1], :) |
| 43 | ], [ |
| 44 | m4_default([$2], :) |
| 45 | ]) |
| 46 | ]) |