Move lttng/config.h to lttng/ust-config.h, and use LTTNG_UST_ namespace
[lttng-ust.git] / include / lttng / tracepoint-rcu.h
CommitLineData
40b2b5a4
MD
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
40b2b5a4
MD
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
51920067 29#define TP_RCU_LINK_TEST() 1
40b2b5a4
MD
30
31#else /* _LGPL_SOURCE */
32
51920067
MD
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
40b2b5a4
MD
35
36#define tp_rcu_dereference_bp(p) \
37 ({ \
38 typeof(p) _________p1 = URCU_FORCE_CAST(typeof(p), \
51920067 39 tracepoint_dlopen.rcu_dereference_sym_bp(URCU_FORCE_CAST(void *, p))); \
40b2b5a4
MD
40 (_________p1); \
41 })
42
51920067
MD
43#define TP_RCU_LINK_TEST() tp_rcu_read_lock_bp
44
40b2b5a4
MD
45#endif /* _LGPL_SOURCE */
46
47#endif /* _LTTNG_TRACEPOINT_RCU_H */
This page took 0.026441 seconds and 4 git commands to generate.