#endif
#define lttng_ust_tracepoint_enabled(provider, name) \
- caa_unlikely(CMM_LOAD_SHARED(__tracepoint_##provider##___##name.state))
+ caa_unlikely(CMM_LOAD_SHARED(lttng_ust_tracepoint_##provider##___##name.state))
#define lttng_ust_do_tracepoint(provider, name, ...) \
- __tracepoint_cb_##provider##___##name(__VA_ARGS__)
+ lttng_ust_tracepoint_cb_##provider##___##name(__VA_ARGS__)
#define lttng_ust_tracepoint(provider, name, ...) \
do { \
* address.
*/
#define LTTNG_UST__DECLARE_TRACEPOINT(_provider, _name, ...) \
-extern struct lttng_ust_tracepoint __tracepoint_##_provider##___##_name; \
+extern struct lttng_ust_tracepoint lttng_ust_tracepoint_##_provider##___##_name; \
static inline \
-void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \
+void lttng_ust_tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \
__attribute__((always_inline, unused)) lttng_ust_notrace; \
static \
-void __tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \
+void lttng_ust_tracepoint_cb_##_provider##___##_name(_TP_ARGS_PROTO(__VA_ARGS__)) \
{ \
struct lttng_ust_tracepoint_probe *__tp_probe; \
\
if (caa_unlikely(!TP_RCU_LINK_TEST())) \
return; \
tp_rcu_read_lock(); \
- __tp_probe = tp_rcu_dereference(__tracepoint_##_provider##___##_name.probes); \
+ __tp_probe = tp_rcu_dereference(lttng_ust_tracepoint_##_provider##___##_name.probes); \
if (caa_unlikely(!__tp_probe)) \
goto end; \
do { \
tp_rcu_read_unlock(); \
} \
static inline \
-void __tracepoint_register_##_provider##___##_name(char *provider_name, char *event_name, \
+void lttng_ust_tracepoint_register_##_provider##___##_name(char *provider_name, char *event_name, \
void (*func)(void), void *data) \
lttng_ust_notrace; \
static inline \
-void __tracepoint_register_##_provider##___##_name(char *provider_name, char *event_name, \
+void lttng_ust_tracepoint_register_##_provider##___##_name(char *provider_name, char *event_name, \
void (*func)(void), void *data) \
{ \
- __tracepoint_probe_register(provider_name, event_name, func, data, \
- __tracepoint_##_provider##___##_name.signature); \
+ lttng_ust_tracepoint_probe_register(provider_name, event_name, func, data, \
+ lttng_ust_tracepoint_##_provider##___##_name.signature); \
} \
static inline \
-void __tracepoint_unregister_##_provider##___##_name(char *provider_name, char *event_name, \
+void lttng_ust_tracepoint_unregister_##_provider##___##_name(char *provider_name, char *event_name, \
void (*func)(void), void *data) \
lttng_ust_notrace; \
static inline \
-void __tracepoint_unregister_##_provider##___##_name(char *provider_name, char *event_name, \
+void lttng_ust_tracepoint_unregister_##_provider##___##_name(char *provider_name, char *event_name, \
void (*func)(void), void *data) \
{ \
- __tracepoint_probe_unregister(provider_name, event_name, func, data); \
+ lttng_ust_tracepoint_probe_unregister(provider_name, event_name, func, data); \
}
-extern int __tracepoint_probe_register(const char *provider_name, const char *event_name,
+extern int lttng_ust_tracepoint_probe_register(const char *provider_name, const char *event_name,
void (*func)(void), void *data, const char *signature);
-extern int __tracepoint_probe_unregister(const char *provider_name, const char *event_name,
+extern int lttng_ust_tracepoint_probe_unregister(const char *provider_name, const char *event_name,
void (*func)(void), void *data);
/*
* registering only _one_ instance of the tracepoints per shared-ojbect
* (or for the whole main program).
*/
-int __tracepoint_registered
+int lttng_ust_tracepoint_registered
__attribute__((weak, visibility("hidden")));
-int __tracepoint_ptrs_registered
+int lttng_ust_tracepoint_ptrs_registered
__attribute__((weak, visibility("hidden")));
struct lttng_ust_tracepoint_dlopen lttng_ust_tracepoint_dlopen
__attribute__((weak, visibility("hidden"))) = {
#ifndef _LGPL_SOURCE
static inline void
-__tracepoint__init_urcu_sym(void)
+lttng_ust_tracepoint__init_urcu_sym(void)
lttng_ust_notrace;
static inline void
-__tracepoint__init_urcu_sym(void)
+lttng_ust_tracepoint__init_urcu_sym(void)
{
if (!lttng_ust_tracepoint_dlopen_ptr)
lttng_ust_tracepoint_dlopen_ptr = <tng_ust_tracepoint_dlopen;
}
#else
static inline void
-__tracepoint__init_urcu_sym(void)
+lttng_ust_tracepoint__init_urcu_sym(void)
lttng_ust_notrace;
static inline void
-__tracepoint__init_urcu_sym(void)
+lttng_ust_tracepoint__init_urcu_sym(void)
{
}
#endif
static void
__tracepoints__init(void)
{
- if (__tracepoint_registered++) {
+ if (lttng_ust_tracepoint_registered++) {
if (!lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle)
return;
- __tracepoint__init_urcu_sym();
+ lttng_ust_tracepoint__init_urcu_sym();
return;
}
dlopen(LTTNG_UST_TRACEPOINT_LIB_SONAME, RTLD_NOW | RTLD_GLOBAL);
if (!lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle)
return;
- __tracepoint__init_urcu_sym();
+ lttng_ust_tracepoint__init_urcu_sym();
}
static void
{
int ret;
- if (--__tracepoint_registered)
+ if (--lttng_ust_tracepoint_registered)
return;
if (!lttng_ust_tracepoint_dlopen_ptr)
lttng_ust_tracepoint_dlopen_ptr = <tng_ust_tracepoint_dlopen;
lttng_ust_tracepoint_destructors_syms_ptr = <tng_ust_tracepoint_destructors_syms;
if (!lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle)
return;
- if (__tracepoint_ptrs_registered)
+ if (lttng_ust_tracepoint_ptrs_registered)
return;
/*
* Lookup if destructors must be executed using the new method.
#ifdef TRACEPOINT_PROBE_DYNAMIC_LINKAGE
#define _TRACEPOINT_UNDEFINED_REF(provider) NULL
#else /* TRACEPOINT_PROBE_DYNAMIC_LINKAGE */
-#define _TRACEPOINT_UNDEFINED_REF(provider) &__tracepoint_provider_##provider
+#define _TRACEPOINT_UNDEFINED_REF(provider) <tng_ust_tracepoint_provider_##provider
#endif /* TRACEPOINT_PROBE_DYNAMIC_LINKAGE */
/*
#define LTTNG_UST__DEFINE_TRACEPOINT(_provider, _name, _args) \
lttng_ust_tracepoint_validate_name_len(_provider, _name); \
- extern int __tracepoint_provider_##_provider; \
+ extern int lttng_ust_tracepoint_provider_##_provider; \
static const char __tp_provider_strtab_##_provider##___##_name[] \
__attribute__((section("__tracepoints_strings"))) = \
#_provider; \
static const char __tp_name_strtab_##_provider##___##_name[] \
__attribute__((section("__tracepoints_strings"))) = \
#_name; \
- struct lttng_ust_tracepoint __tracepoint_##_provider##___##_name \
+ struct lttng_ust_tracepoint lttng_ust_tracepoint_##_provider##___##_name \
__attribute__((section("__tracepoints"))) = { \
sizeof(struct lttng_ust_tracepoint), \
__tp_provider_strtab_##_provider##___##_name, \
_TP_EXTRACT_STRING(_args), \
}; \
static struct lttng_ust_tracepoint * \
- __tracepoint_ptr_##_provider##___##_name \
+ lttng_ust_tracepoint_ptr_##_provider##___##_name \
__attribute__((section("__tracepoints_ptrs"), used)) \
__lttng_ust_variable_attribute_no_sanitize_address = \
- &__tracepoint_##_provider##___##_name;
+ <tng_ust_tracepoint_##_provider##___##_name;
static void
__tracepoints__ptrs_init(void)
static void
__tracepoints__ptrs_init(void)
{
- if (__tracepoint_ptrs_registered++)
+ if (lttng_ust_tracepoint_ptrs_registered++)
return;
if (!lttng_ust_tracepoint_dlopen_ptr)
lttng_ust_tracepoint_dlopen_ptr = <tng_ust_tracepoint_dlopen;
URCU_FORCE_CAST(int (*)(void),
dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
"tp_get_destructors_state"));
- __tracepoint__init_urcu_sym();
+ lttng_ust_tracepoint__init_urcu_sym();
if (lttng_ust_tracepoint_dlopen_ptr->tracepoint_register_lib) {
lttng_ust_tracepoint_dlopen_ptr->tracepoint_register_lib(__start___tracepoints_ptrs,
__stop___tracepoints_ptrs -
{
int ret;
- if (--__tracepoint_ptrs_registered)
+ if (--lttng_ust_tracepoint_ptrs_registered)
return;
if (!lttng_ust_tracepoint_dlopen_ptr)
lttng_ust_tracepoint_dlopen_ptr = <tng_ust_tracepoint_dlopen;
if (lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle
&& lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state
&& lttng_ust_tracepoint_destructors_syms_ptr->tracepoint_get_destructors_state()
- && !__tracepoint_ptrs_registered) {
+ && !lttng_ust_tracepoint_ptrs_registered) {
ret = dlclose(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle);
if (ret) {
fprintf(stderr, "Error (%d) in dlclose\n", ret);
#include <lttng/ust-tracepoint-event-reset.h>
static inline
-void _TP_COMBINE_TOKENS(__tracepoint_provider_mismatch_, TRACEPOINT_PROVIDER)(void)
+void _TP_COMBINE_TOKENS(lttng_ust_tracepoint_provider_mismatch_, TRACEPOINT_PROVIDER)(void)
lttng_ust_notrace;
static inline
-void _TP_COMBINE_TOKENS(__tracepoint_provider_mismatch_, TRACEPOINT_PROVIDER)(void)
+void _TP_COMBINE_TOKENS(lttng_ust_tracepoint_provider_mismatch_, TRACEPOINT_PROVIDER)(void)
{
}
#undef LTTNG_UST__TRACEPOINT_EVENT_CLASS
#define LTTNG_UST__TRACEPOINT_EVENT_CLASS(_provider, _name, _args, _fields) \
- __tracepoint_provider_mismatch_##_provider();
+ lttng_ust_tracepoint_provider_mismatch_##_provider();
#undef LTTNG_UST__TRACEPOINT_EVENT_INSTANCE
#define LTTNG_UST__TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
- __tracepoint_provider_mismatch_##_provider();
+ lttng_ust_tracepoint_provider_mismatch_##_provider();
static inline
-void _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void)
+void _TP_COMBINE_TOKENS(lttng_ust_tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void)
lttng_ust_notrace;
static inline
-void _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void)
+void _TP_COMBINE_TOKENS(lttng_ust_tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void)
{
#include TRACEPOINT_INCLUDE
}
return;
}
/*
- * __tracepoint_provider_check_ ## TRACEPOINT_PROVIDER() is a
+ * lttng_ust_tracepoint_provider_check_ ## TRACEPOINT_PROVIDER() is a
* static inline function that ensures every probe PROVIDER
* argument match the provider within which they appear. It
* calls empty static inline functions, and therefore has no
* runtime effect. However, if it detects an error, a linker
* error will appear.
*/
- _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)();
+ _TP_COMBINE_TOKENS(lttng_ust_tracepoint_provider_check_, TRACEPOINT_PROVIDER)();
assert(!_TP_COMBINE_TOKENS(__lttng_ust_probe_register_cookie___, TRACEPOINT_PROVIDER));
reg_probe = lttng_ust_probe_register(&_TP_COMBINE_TOKENS(__probe_desc___, TRACEPOINT_PROVIDER));
if (!reg_probe) {
_TP_COMBINE_TOKENS(__lttng_ust_probe_register_cookie___, TRACEPOINT_PROVIDER) = NULL;
}
-int _TP_COMBINE_TOKENS(__tracepoint_provider_, TRACEPOINT_PROVIDER)
+int _TP_COMBINE_TOKENS(lttng_ust_tracepoint_provider_, TRACEPOINT_PROVIDER)
__attribute__((visibility("default")));
#include "common/err-ptr.h"
/* Test compiler support for weak symbols with hidden visibility. */
-int __tracepoint_test_symbol1 __attribute__((weak, visibility("hidden")));
-void *__tracepoint_test_symbol2 __attribute__((weak, visibility("hidden")));
+int lttng_ust_tracepoint_test_symbol1 __attribute__((weak, visibility("hidden")));
+void *lttng_ust_tracepoint_test_symbol2 __attribute__((weak, visibility("hidden")));
struct {
char a[24];
-} __tracepoint_test_symbol3 __attribute__((weak, visibility("hidden")));
+} lttng_ust_tracepoint_test_symbol3 __attribute__((weak, visibility("hidden")));
/* Set to 1 to enable tracepoint debug output */
static const int tracepoint_debug;
}
/**
- * __tracepoint_probe_register - Connect a probe to a tracepoint
+ * lttng_ust_tracepoint_probe_register - Connect a probe to a tracepoint
* @name: tracepoint provider name
* @name: tracepoint event name
* @probe: probe handler
* The probe address must at least be aligned on the architecture pointer size.
* Called with the tracepoint mutex held.
*/
-int __tracepoint_probe_register(const char *provider_name, const char *event_name,
+int lttng_ust_tracepoint_probe_register(const char *provider_name, const char *event_name,
void (*probe)(void), void *data, const char *signature)
{
void *old;
}
/*
- * Caller needs to invoke __tracepoint_probe_release_queue() after
+ * Caller needs to invoke lttng_ust_tracepoint_probe_release_queue() after
* calling lttng_ust_tp_probe_register_queue_release() one or multiple
* times to ensure it does not leak memory.
*/
* @probe: probe function pointer
* @probe: probe data pointer
*/
-int __tracepoint_probe_unregister(const char *provider_name, const char *event_name,
+int lttng_ust_tracepoint_probe_unregister(const char *provider_name, const char *event_name,
void (*probe)(void), void *data)
{
void *old;
}
/*
- * Caller needs to invoke __tracepoint_probe_release_queue() after
+ * Caller needs to invoke lttng_ust_tracepoint_probe_release_queue() after
* calling lttng_ust_tp_probe_unregister_queue_release() one or multiple
* times to ensure it does not leak memory.
*/
static void check_weak_hidden(void)
{
DBG("Your compiler treats weak symbols with hidden visibility for integer objects as %s between compile units part of the same module.",
- &__tracepoint_test_symbol1 == lttng_ust_tp_check_weak_hidden1() ?
+ <tng_ust_tracepoint_test_symbol1 == lttng_ust_tp_check_weak_hidden1() ?
"SAME address" :
"DIFFERENT addresses");
DBG("Your compiler treats weak symbols with hidden visibility for pointer objects as %s between compile units part of the same module.",
- &__tracepoint_test_symbol2 == lttng_ust_tp_check_weak_hidden2() ?
+ <tng_ust_tracepoint_test_symbol2 == lttng_ust_tp_check_weak_hidden2() ?
"SAME address" :
"DIFFERENT addresses");
DBG("Your compiler treats weak symbols with hidden visibility for 24-byte structure objects as %s between compile units part of the same module.",
- &__tracepoint_test_symbol3 == lttng_ust_tp_check_weak_hidden3() ?
+ <tng_ust_tracepoint_test_symbol3 == lttng_ust_tp_check_weak_hidden3() ?
"SAME address" :
"DIFFERENT addresses");
}