Namespace RING_BUFFER_ALIGN macros
[lttng-ust.git] / include / lttng / tracepoint-rcu.h
1 /*
2 * SPDX-License-Identifier: MIT
3 *
4 * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
5 */
6
7 #ifndef _LTTNG_TRACEPOINT_RCU_H
8 #define _LTTNG_TRACEPOINT_RCU_H
9
10 #include <urcu/compiler.h>
11 #include <lttng/urcu/pointer.h>
12
13 #ifdef _LGPL_SOURCE
14
15 #include <lttng/urcu/urcu-ust.h>
16
17 #define tp_rcu_read_lock lttng_ust_urcu_read_lock
18 #define tp_rcu_read_unlock lttng_ust_urcu_read_unlock
19 #define tp_rcu_dereference lttng_ust_rcu_dereference
20 #define TP_RCU_LINK_TEST() 1
21
22 #else /* _LGPL_SOURCE */
23
24 #define tp_rcu_read_lock tracepoint_dlopen_ptr->rcu_read_lock_sym
25 #define tp_rcu_read_unlock tracepoint_dlopen_ptr->rcu_read_unlock_sym
26
27 #define tp_rcu_dereference(p) \
28 URCU_FORCE_CAST(__typeof__(p), \
29 tracepoint_dlopen_ptr->rcu_dereference_sym(URCU_FORCE_CAST(void *, p)))
30
31 #define TP_RCU_LINK_TEST() (tracepoint_dlopen_ptr && tp_rcu_read_lock)
32
33 #endif /* _LGPL_SOURCE */
34
35 #endif /* _LTTNG_TRACEPOINT_RCU_H */
This page took 0.050578 seconds and 4 git commands to generate.