summaryrefslogtreecommitdiffstats
path: root/Tests/FindLTTngUST/Test/main.c
blob: 1f313c1a9bc20346cf5cb048e8de7c50d1e8b02e (plain)
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
#include <assert.h>
#include <lttng/ust-version.h>
#include <stdio.h>
#include <string.h>

#ifdef CMAKE_LTTNGUST_HAS_TRACEF
#include <lttng/tracef.h>
#endif

#ifdef CMAKE_LTTNGUST_HAS_TRACELOG
#include <lttng/tracelog.h>
#endif

int main(void)
{
  char lttng_version_string[16];

  snprintf(lttng_version_string, 16, "%u.%u.%u", LTTNG_UST_MAJOR_VERSION,
           LTTNG_UST_MINOR_VERSION, LTTNG_UST_PATCHLEVEL_VERSION);
  assert(!strcmp(lttng_version_string, CMAKE_EXPECTED_LTTNGUST_VERSION));

#ifdef CMAKE_LTTNGUST_HAS_TRACEF
  tracef("calling tracef()! %d %s", -23, CMAKE_EXPECTED_LTTNGUST_VERSION);
#endif

#ifdef CMAKE_LTTNGUST_HAS_TRACELOG
  tracelog(TRACE_WARNING, "calling tracelog()! %d", 17);
#endif

  return 0;
}