X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=include%2Flttng%2Ftracepoint.h;h=38cd86c0030e5012090869175fef93dd938351c9;hb=faa633435d42bafa036904265b14df506ddbd6e5;hp=b10c514e21c86fae23f8f91b37d14adbb66b1bf7;hpb=a24e542a16596ad69bfde5cd9844e65c41ffeb77;p=lttng-ust.git diff --git a/include/lttng/tracepoint.h b/include/lttng/tracepoint.h index b10c514e..38cd86c0 100644 --- a/include/lttng/tracepoint.h +++ b/include/lttng/tracepoint.h @@ -446,7 +446,7 @@ lttng_ust_tracepoints_print_disabled_message(void) static void lttng_ust__tracepoints__init(void) - lttng_ust_notrace __attribute__((constructor)); + lttng_ust_notrace __attribute__((constructor(LTTNG_UST_CONSTRUCTOR_PRIO))); static void lttng_ust__tracepoints__init(void) { @@ -471,7 +471,7 @@ lttng_ust__tracepoints__init(void) static void lttng_ust__tracepoints__destroy(void) - lttng_ust_notrace __attribute__((destructor)); + lttng_ust_notrace __attribute__((destructor(LTTNG_UST_CONSTRUCTOR_PRIO))); static void lttng_ust__tracepoints__destroy(void) { @@ -513,8 +513,30 @@ lttng_ust__tracepoints__destroy(void) # endif #endif /* #if LTTNG_UST_COMPAT_API(0) */ +#if LTTNG_UST_COMPAT_API(0) +#define tracepoint lttng_ust_tracepoint +#define do_tracepoint lttng_ust_do_tracepoint +#define tracepoint_enabled lttng_ust_tracepoint_enabled +#define TP_ARGS LTTNG_UST_TP_ARGS +#endif /* #if LTTNG_UST_COMPAT_API(0) */ + +#ifdef __cplusplus +} +#endif + +#endif /* _LTTNG_UST_TRACEPOINT_H */ + +/* The following declarations must be outside re-inclusion protection. */ + #ifdef LTTNG_UST_TRACEPOINT_DEFINE +#ifndef _LTTNG_UST_TRACEPOINT_DEFINE_ONCE +#define _LTTNG_UST_TRACEPOINT_DEFINE_ONCE + +#ifdef __cplusplus +extern "C" { +#endif + /* * These weak symbols, the constructor, and destructor take care of * registering only _one_ instance of the tracepoints per shared-ojbect @@ -554,6 +576,7 @@ extern struct lttng_ust_tracepoint * const __stop_lttng_ust_tracepoints_ptrs[] */ #define LTTNG_UST__TP_EXTRACT_STRING(...) #__VA_ARGS__ +#undef LTTNG_UST__DEFINE_TRACEPOINT #define LTTNG_UST__DEFINE_TRACEPOINT(_provider, _name, _args) \ lttng_ust_tracepoint_validate_name_len(_provider, _name); \ extern int lttng_ust_tracepoint_provider_##_provider \ @@ -583,7 +606,7 @@ extern struct lttng_ust_tracepoint * const __stop_lttng_ust_tracepoints_ptrs[] static void lttng_ust__tracepoints__ptrs_init(void) - lttng_ust_notrace __attribute__((constructor)); + lttng_ust_notrace __attribute__((constructor(LTTNG_UST_CONSTRUCTOR_PRIO))); static void lttng_ust__tracepoints__ptrs_init(void) { @@ -626,7 +649,7 @@ lttng_ust__tracepoints__ptrs_init(void) static void lttng_ust__tracepoints__ptrs_destroy(void) - lttng_ust_notrace __attribute__((destructor)); + lttng_ust_notrace __attribute__((destructor(LTTNG_UST_CONSTRUCTOR_PRIO))); static void lttng_ust__tracepoints__ptrs_destroy(void) { @@ -653,26 +676,18 @@ lttng_ust__tracepoints__ptrs_destroy(void) } } -#else /* LTTNG_UST_TRACEPOINT_DEFINE */ - -#define LTTNG_UST__DEFINE_TRACEPOINT(_provider, _name, _args) - -#endif /* #else LTTNG_UST_TRACEPOINT_DEFINE */ - -#if LTTNG_UST_COMPAT_API(0) -#define tracepoint lttng_ust_tracepoint -#define do_tracepoint lttng_ust_do_tracepoint -#define tracepoint_enabled lttng_ust_tracepoint_enabled -#define TP_ARGS LTTNG_UST_TP_ARGS -#endif /* #if LTTNG_UST_COMPAT_API(0) */ - #ifdef __cplusplus } #endif -#endif /* _LTTNG_UST_TRACEPOINT_H */ +#endif /* _LTTNG_UST_TRACEPOINT_DEFINE_ONCE */ -/* The following declarations must be outside re-inclusion protection. */ +#else /* LTTNG_UST_TRACEPOINT_DEFINE */ + +#undef LTTNG_UST__DEFINE_TRACEPOINT +#define LTTNG_UST__DEFINE_TRACEPOINT(_provider, _name, _args) + +#endif /* #else LTTNG_UST_TRACEPOINT_DEFINE */ /* * LTTNG_UST_TRACEPOINT_HIDDEN_DEFINITION: Define this before including