#include <urcu/compiler.h>
#include <lttng/urcu/pointer.h>
+#include <lttng/ust-api-compat.h>
#ifdef _LGPL_SOURCE
#include <lttng/urcu/urcu-ust.h>
-#define tp_rcu_read_lock lttng_ust_urcu_read_lock
-#define tp_rcu_read_unlock lttng_ust_urcu_read_unlock
-#define tp_rcu_dereference lttng_ust_rcu_dereference
-#define TP_RCU_LINK_TEST() 1
+#define lttng_ust_tp_rcu_read_lock lttng_ust_urcu_read_lock
+#define lttng_ust_tp_rcu_read_unlock lttng_ust_urcu_read_unlock
+#define lttng_ust_tp_rcu_dereference lttng_ust_rcu_dereference
+#define LTTNG_UST_TP_RCU_LINK_TEST() 1
#else /* _LGPL_SOURCE */
-#define tp_rcu_read_lock lttng_ust_tracepoint_dlopen_ptr->rcu_read_lock_sym
-#define tp_rcu_read_unlock lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym
+#define lttng_ust_tp_rcu_read_lock lttng_ust_tracepoint_dlopen_ptr->rcu_read_lock_sym
+#define lttng_ust_tp_rcu_read_unlock lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym
-#define tp_rcu_dereference(p) \
+#define lttng_ust_tp_rcu_dereference(p) \
URCU_FORCE_CAST(__typeof__(p), \
lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym(URCU_FORCE_CAST(void *, p)))
-#define TP_RCU_LINK_TEST() (lttng_ust_tracepoint_dlopen_ptr && tp_rcu_read_lock)
+#define LTTNG_UST_TP_RCU_LINK_TEST() (lttng_ust_tracepoint_dlopen_ptr && tp_rcu_read_lock)
#endif /* _LGPL_SOURCE */
+#if LTTNG_UST_COMPAT_API(0)
+#define tp_rcu_read_lock lttng_ust_tp_rcu_read_lock
+#define tp_rcu_read_unlock lttng_ust_tp_rcu_read_unlock
+#define tp_rcu_dereference lttng_ust_tp_rcu_dereference
+#define TP_RCU_LINK_TEST LTTNG_UST_TP_RCU_LINK_TEST
+#endif
+
#endif /* _LTTNG_TRACEPOINT_RCU_H */
{ \
struct lttng_ust_tracepoint_probe *__tp_probe; \
\
- if (caa_unlikely(!TP_RCU_LINK_TEST())) \
+ if (caa_unlikely(!LTTNG_UST_TP_RCU_LINK_TEST())) \
return; \
- tp_rcu_read_lock(); \
- __tp_probe = tp_rcu_dereference(lttng_ust_tracepoint_##_provider##___##_name.probes); \
+ lttng_ust_tp_rcu_read_lock(); \
+ __tp_probe = lttng_ust_tp_rcu_dereference(lttng_ust_tracepoint_##_provider##___##_name.probes); \
if (caa_unlikely(!__tp_probe)) \
goto end; \
do { \
(LTTNG_UST__TP_ARGS_DATA_VAR(__VA_ARGS__)); \
} while ((++__tp_probe)->func); \
end: \
- tp_rcu_read_unlock(); \
+ lttng_ust_tp_rcu_read_unlock(); \
} \
static inline \
void lttng_ust_tracepoint_register_##_provider##___##_name(char *provider_name, char *event_name, \
lttng_ust_tracepoint_dlopen_ptr->rcu_read_lock_sym =
URCU_FORCE_CAST(void (*)(void),
dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
- "tp_rcu_read_lock"));
+ "lttng_ust_tp_rcu_read_lock"));
if (!lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym)
lttng_ust_tracepoint_dlopen_ptr->rcu_read_unlock_sym =
URCU_FORCE_CAST(void (*)(void),
dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
- "tp_rcu_read_unlock"));
+ "lttng_ust_tp_rcu_read_unlock"));
if (!lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym)
lttng_ust_tracepoint_dlopen_ptr->rcu_dereference_sym =
URCU_FORCE_CAST(void *(*)(void *p),
dlsym(lttng_ust_tracepoint_dlopen_ptr->liblttngust_handle,
- "tp_rcu_dereference_sym"));
+ "lttng_ust_tp_rcu_dereference_sym"));
}
#else
static inline void
#undef tp_list_for_each_entry_rcu
#define tp_list_for_each_entry_rcu(pos, head, member) \
- for (pos = cds_list_entry(tp_rcu_dereference((head)->next), __typeof__(*pos), member); \
+ for (pos = cds_list_entry(lttng_ust_tp_rcu_dereference((head)->next), __typeof__(*pos), member); \
&pos->member != (head); \
- pos = cds_list_entry(tp_rcu_dereference(pos->member.next), __typeof__(*pos), member))
+ pos = cds_list_entry(lttng_ust_tp_rcu_dereference(pos->member.next), __typeof__(*pos), member))
/*
* LTTNG_UST_TRACEPOINT_EVENT_CLASS declares a class of tracepoints receiving the
} \
if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \
return; \
- if (caa_unlikely(!TP_RCU_LINK_TEST())) \
+ if (caa_unlikely(!LTTNG_UST_TP_RCU_LINK_TEST())) \
return; \
if (caa_unlikely(CMM_ACCESS_ONCE(__event->eval_filter))) { \
lttng_ust__event_prepare_interpreter_stack__##_provider##___##_name(__stackvar.__interpreter_stack_data, \
/*
* Create the wrapper symbols.
*/
-#undef tp_rcu_read_lock
-#undef tp_rcu_read_unlock
-#undef tp_rcu_dereference
+#undef lttng_ust_tp_rcu_read_lock
+#undef lttng_ust_tp_rcu_read_unlock
+#undef lttng_ust_tp_rcu_dereference
-void tp_rcu_read_lock(void);
-void tp_rcu_read_lock(void)
+void lttng_ust_tp_rcu_read_lock(void);
+void lttng_ust_tp_rcu_read_lock(void)
{
lttng_ust_urcu_read_lock();
}
-void tp_rcu_read_unlock(void);
-void tp_rcu_read_unlock(void)
+void lttng_ust_tp_rcu_read_unlock(void);
+void lttng_ust_tp_rcu_read_unlock(void)
{
lttng_ust_urcu_read_unlock();
}
-void *tp_rcu_dereference_sym(void *p);
-void *tp_rcu_dereference_sym(void *p)
+void *lttng_ust_tp_rcu_dereference_sym(void *p);
+void *lttng_ust_tp_rcu_dereference_sym(void *p)
{
return lttng_ust_rcu_dereference(p);
}