Fix tracepoint.h multiple .o within module/core exec linkage bug
[lttng-ust.git] / include / lttng / tracepoint-rcu.h
1 #ifndef _LTTNG_TRACEPOINT_RCU_H
2 #define _LTTNG_TRACEPOINT_RCU_H
3
4 /*
5 * Copyright (c) 2011 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
6 *
7 * THIS MATERIAL IS PROVIDED AS IS, WITH ABSOLUTELY NO WARRANTY EXPRESSED
8 * OR IMPLIED. ANY USE IS AT YOUR OWN RISK.
9 *
10 * Permission is hereby granted to use or copy this program
11 * for any purpose, provided the above notices are retained on all copies.
12 * Permission to modify the code and to distribute modified code is granted,
13 * provided the above notices are retained, and a notice that the code was
14 * modified is included with the above copyright notice.
15 *
16 * This file allows weak linking on tracepoint RCU symbols for non-LGPL
17 * code.
18 */
19
20 #include <urcu/compiler.h>
21
22 #ifdef _LGPL_SOURCE
23
24 #include <urcu-bp.h>
25
26 #define tp_rcu_read_lock_bp rcu_read_lock_bp
27 #define tp_rcu_read_unlock_bp rcu_read_unlock_bp
28 #define tp_rcu_dereference_bp rcu_dereference_bp
29 #define TP_RCU_LINK_TEST() 1
30
31 #else /* _LGPL_SOURCE */
32
33 #define tp_rcu_read_lock_bp tracepoint_dlopen.rcu_read_lock_sym_bp
34 #define tp_rcu_read_unlock_bp tracepoint_dlopen.rcu_read_unlock_sym_bp
35
36 #define tp_rcu_dereference_bp(p) \
37 ({ \
38 typeof(p) _________p1 = URCU_FORCE_CAST(typeof(p), \
39 tracepoint_dlopen.rcu_dereference_sym_bp(URCU_FORCE_CAST(void *, p))); \
40 (_________p1); \
41 })
42
43 #define TP_RCU_LINK_TEST() tp_rcu_read_lock_bp
44
45 #endif /* _LGPL_SOURCE */
46
47 #endif /* _LTTNG_TRACEPOINT_RCU_H */
This page took 0.032116 seconds and 5 git commands to generate.