File: lttng_check_sdt_works.m4

package info (click to toggle)
ltt-control 2.13.15-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 17,656 kB
  • sloc: ansic: 167,287; sh: 27,018; makefile: 2,828; python: 1,380; yacc: 692; lex: 129; java: 109; perl: 99; cpp: 35; xml: 23
file content (46 lines) | stat: -rw-r--r-- 1,156 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# SYNOPSIS
#
#   LTTNG_CHECK_SDT_WORKS([ACTION-SUCCESS], [ACTION-FAILURE])
#
# DESCRIPTION
#
#   Check whether it's possible to build a binary with Systemtap SDT probes.
#
#   ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on
#   success/failure.
#
# LICENSE
#
#   Copyright (c) 2018 Francis Deslauriers <francis.deslauriers@efficios.com>
#   Copyright (c) 2019 Michael Jeanson <mjeanson@efficios.com>
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved.  This file is offered as-is, without any
#   warranty.

#serial 1

AC_DEFUN([LTTNG_CHECK_SDT_WORKS], [
  AC_CACHE_CHECK([whether SDT probes compile], [lttng_cv_sdt_works], [
    AC_COMPILE_IFELSE([
      AC_LANG_SOURCE([[
	#define SDT_USE_VARIADIC
	#include <sys/sdt.h>
	void fct(void)
	{
		STAP_PROBEV(provider,name,1,2,3,4,5,6,7,8,9,10);
	}
      ]])
    ], [
      lttng_cv_sdt_works=yes
    ], [
      lttng_cv_sdt_works=no
    ])
  ])
  AS_IF([test "x$lttng_cv_sdt_works" = "xyes"], [
    m4_default([$1], :)
  ], [
    m4_default([$2], :)
  ])
])