either directly or through a static library (`.a`):
1. Into exactly one unit (C/C++ source file) of your _application_,
- define `TRACEPOINT_DEFINE` and include the tracepoint provider
+ define `LTTNG_UST_TRACEPOINT_DEFINE` and include the tracepoint provider
header.
2. Include the tracepoint provider header into all C/C++ files using
the provider and insert tracepoints using the `tracepoint()` macro.
- 3. Use `-I.` when compiling the unit defining `TRACEPOINT_DEFINE`
+ 3. Use `-I.` when compiling the unit defining `LTTNG_UST_TRACEPOINT_DEFINE`
(e.g., `tp.c`).
4. Link the application with `-ldl` on Linux, or with `-lc` on BSD,
and with `-llttng-ust`.
making it dynamically loadable.
1. Into exactly one unit of your _application_, define
- `TRACEPOINT_DEFINE` _and_ `LTTNG_UST_TRACEPOINT_PROBE_DYNAMIC_LINKAGE`,
+ `LTTNG_UST_TRACEPOINT_DEFINE` _and_ `LTTNG_UST_TRACEPOINT_PROBE_DYNAMIC_LINKAGE`,
then include the tracepoint provider header.
2. Include the tracepoint provider header into all C/C++ files using
the provider and insert tracepoints using the `tracepoint()` macro.
* Copyright (C) 2016 Sebastien Boisvert <sboisvert@gydle.com>
*/
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "aligner-lib.h"
#include "tracepoint-provider.h"
* Copyright (C) 2016 Sebastien Boisvert <sboisvert@gydle.com>
*/
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "tester-lib.h"
#include "tracepoint-provider.h"
*/
#define TRACEPOINT_CREATE_PROBES
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "tracepoint-provider.h"
#include <arpa/inet.h>
#include <stdlib.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define LTTNG_UST_TRACEPOINT_PROBE_DYNAMIC_LINKAGE
#include "ust_tests_demo.h"
#include "ust_tests_demo2.h"
#include <unistd.h>
/*
- * We need to define TRACEPOINT_DEFINE in one C file in the program
+ * We need to define LTTNG_UST_TRACEPOINT_DEFINE in one C file in the program
* before including provider headers.
*/
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "sample_component_provider.h"
int main(void)
#include <arpa/inet.h>
#include <stdlib.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
static
memset(lttng_ust_tracepoint_dlopen_ptr, 0, sizeof(*lttng_ust_tracepoint_dlopen_ptr));
}
-#ifdef TRACEPOINT_DEFINE
+#if LTTNG_UST_COMPAT_API(0)
+# if defined(TRACEPOINT_DEFINE) && !defined(LTTNG_UST_TRACEPOINT_DEFINE)
+# define LTTNG_UST_TRACEPOINT_DEFINE
+# endif
+#endif /* #if LTTNG_UST_COMPAT_API(0) */
+
+#ifdef LTTNG_UST_TRACEPOINT_DEFINE
/*
* These weak symbols, the constructor, and destructor take care of
}
}
-#else /* TRACEPOINT_DEFINE */
+#else /* LTTNG_UST_TRACEPOINT_DEFINE */
#define LTTNG_UST__DEFINE_TRACEPOINT(_provider, _name, _args)
-#endif /* #else TRACEPOINT_DEFINE */
+#endif /* #else LTTNG_UST_TRACEPOINT_DEFINE */
#if LTTNG_UST_COMPAT_API(0)
#define tracepoint lttng_ust_tracepoint
#include <sys/types.h>
#include <stdio.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#define TP_IP_PARAM func_addr
#include "lttng-ust-cyg-profile-fast.h"
#include <sys/types.h>
#include <stdio.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#define TP_IP_PARAM func_addr
#include "lttng-ust-cyg-profile.h"
/* Include link.h last else it conflicts with ust-dlfcn. */
#include <link.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_dl.h"
static void *(*__lttng_ust_plibc_dlopen)(const char *filename, int flags);
#define _LGPL_SOURCE
#include "org_lttng_ust_agent_jul_LttngJulApi.h"
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#include "lttng_ust_jul.h"
#include "../common/lttng_ust_context.h"
#define _LGPL_SOURCE
#include "org_lttng_ust_agent_log4j_LttngLog4jApi.h"
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#include "lttng_ust_log4j.h"
#include "../common/lttng_ust_context.h"
#define _LGPL_SOURCE
#include "org_lttng_ust_LTTngUst.h"
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#include "lttng_ust_java.h"
#include "common/macros.h"
#include "common/align.h"
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#define TP_IP_PARAM ip
#include "ust_libc.h"
#include "common/macros.h"
#include <pthread.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#define TP_IP_PARAM ip
#include "ust_pthread.h"
*/
#define _LGPL_SOURCE
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#include "lttng_ust_python.h"
#include "common/getenv.h"
#include "lib/lttng-ust/events.h"
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_lib.h" /* Only define. */
#define TRACEPOINT_CREATE_PROBES
#include "common/macros.h"
#define TRACEPOINT_CREATE_PROBES
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "lttng-ust-tracef-provider.h"
static inline
#include "common/macros.h"
#define TRACEPOINT_CREATE_PROBES
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "lttng-ust-tracelog-provider.h"
#define TRACELOG_CB(level) \
#include <urcu/compiler.h>
#ifdef TRACING
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_tests_benchmark.h"
#endif
#include <unistd.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_tests_ctf_types.h"
int main(int argc, char **argv)
#include <string.h>
#include <stdlib.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_tests_hello_many.h"
int main(int argc, char **argv)
#include <arpa/inet.h>
#include <stdlib.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
static
#include <stdlib.h>
#include <stdbool.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
static
* Copyright (C) 2013 Jérémie Galarneau
*/
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#define TRACEPOINT_CREATE_PROBES
#include "ust_tests_sameline.h"
#include <stdlib.h>
#include <stdbool.h>
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "ust_tests_hello.h"
#include <lttng/ust-events.h>
/*
* The header containing our LTTNG_UST_TRACEPOINT_EVENTs.
*/
-#define TRACEPOINT_DEFINE
+#define LTTNG_UST_TRACEPOINT_DEFINE
#include "{headerFilename}"
"""