From: Mathieu Desnoyers Date: Wed, 28 Nov 2018 21:56:59 +0000 (-0500) Subject: Adapt lttng-ust to use multiflavor symbols from liburcu 0.11 X-Git-Tag: v2.12.0-rc1~66 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=d6ddec3f8a747381dfb2af999731b83379713960;p=lttng-ust.git Adapt lttng-ust to use multiflavor symbols from liburcu 0.11 Signed-off-by: Mathieu Desnoyers --- diff --git a/configure.ac b/configure.ac index a3e1e238..5f27f999 100644 --- a/configure.ac +++ b/configure.ac @@ -275,10 +275,10 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ ]) # urcu - check that URCU lib is available to compilation -AC_CHECK_LIB([urcu-bp], [synchronize_rcu_bp], [], [AC_MSG_ERROR([Cannot find liburcu-bp lib. Use [LDFLAGS]=-Ldir to specify its location.])]) +AC_CHECK_LIB([urcu-bp], [urcu_bp_synchronize_rcu], [], [AC_MSG_ERROR([Cannot find liburcu-bp 0.11 or newer. Use [LDFLAGS]=-Ldir to specify its location.])]) -# urcu - check that URCU lib is at least version 0.6 -AC_CHECK_LIB([urcu-bp], [call_rcu_bp], [], [AC_MSG_ERROR([liburcu 0.6 or newer is needed, please update your version or use [LDFLAGS]=-Ldir to specify the right location.])]) +# urcu - check that URCU lib is at least version 0.11 +AC_CHECK_LIB([urcu-bp], [urcu_bp_call_rcu], [], [AC_MSG_ERROR([liburcu 0.11 or newer is needed, please update your version or use [LDFLAGS]=-Ldir to specify the right location.])]) # numa.h integration AS_IF([test "x$NO_NUMA" = "x1"],[ diff --git a/include/lttng/tracepoint-rcu.h b/include/lttng/tracepoint-rcu.h index 0e084853..95d60493 100644 --- a/include/lttng/tracepoint-rcu.h +++ b/include/lttng/tracepoint-rcu.h @@ -27,10 +27,10 @@ #ifdef _LGPL_SOURCE -#include +#include -#define tp_rcu_read_lock_bp rcu_read_lock_bp -#define tp_rcu_read_unlock_bp rcu_read_unlock_bp +#define tp_rcu_read_lock_bp urcu_bp_read_lock +#define tp_rcu_read_unlock_bp urcu_bp_read_unlock #define tp_rcu_dereference_bp rcu_dereference #define TP_RCU_LINK_TEST() 1 diff --git a/liblttng-ust/lttng-ust-comm.c b/liblttng-ust/lttng-ust-comm.c index b6183315..a09f676a 100644 --- a/liblttng-ust/lttng-ust-comm.c +++ b/liblttng-ust/lttng-ust-comm.c @@ -1969,7 +1969,7 @@ void ust_before_fork(sigset_t *save_sigset) pthread_mutex_lock(&ust_fork_mutex); ust_lock_nocheck(); - rcu_bp_before_fork(); + urcu_bp_before_fork(); } static void ust_after_fork_common(sigset_t *restore_sigset) @@ -1993,7 +1993,7 @@ void ust_after_fork_parent(sigset_t *restore_sigset) if (URCU_TLS(lttng_ust_nest_count)) return; DBG("process %d", getpid()); - rcu_bp_after_fork_parent(); + urcu_bp_after_fork_parent(); /* Release mutexes and reenable signals */ ust_after_fork_common(restore_sigset); } @@ -2016,7 +2016,7 @@ void ust_after_fork_child(sigset_t *restore_sigset) lttng_context_procname_reset(); DBG("process %d", getpid()); /* Release urcu mutexes */ - rcu_bp_after_fork_child(); + urcu_bp_after_fork_child(); lttng_ust_cleanup(0); /* Release mutexes and reenable signals */ ust_after_fork_common(restore_sigset); diff --git a/liblttng-ust/tracepoint-internal.h b/liblttng-ust/tracepoint-internal.h index 298f78e7..1e6f92b6 100644 --- a/liblttng-ust/tracepoint-internal.h +++ b/liblttng-ust/tracepoint-internal.h @@ -50,7 +50,7 @@ extern void __tracepoint_probe_prune_release_queue(void); */ static inline void tracepoint_synchronize_unregister(void) { - synchronize_rcu_bp(); + urcu_bp_synchronize_rcu(); } extern void init_tracepoint(void); diff --git a/liblttng-ust/tracepoint.c b/liblttng-ust/tracepoint.c index efd95bc1..b109fe30 100644 --- a/liblttng-ust/tracepoint.c +++ b/liblttng-ust/tracepoint.c @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include #include @@ -166,7 +166,7 @@ static void release_probes(void *old) if (old) { struct tp_probes *tp_probes = caa_container_of(old, struct tp_probes, probes[0]); - synchronize_rcu(); + urcu_bp_synchronize_rcu(); free(tp_probes); } } @@ -750,7 +750,7 @@ void __tracepoint_probe_prune_release_queue(void) release_queue_need_update = 0; /* Wait for grace period between all sync_callsites and free. */ - synchronize_rcu(); + urcu_bp_synchronize_rcu(); cds_list_for_each_entry_safe(pos, next, &release_probes, u.list) { cds_list_del(&pos->u.list); @@ -841,7 +841,7 @@ void tracepoint_probe_update_all(void) tracepoint_update_probes(); /* Wait for grace period between update_probes and free. */ - synchronize_rcu(); + urcu_bp_synchronize_rcu(); cds_list_for_each_entry_safe(pos, next, &release_probes, u.list) { cds_list_del(&pos->u.list); free(pos); @@ -987,17 +987,17 @@ void exit_tracepoint(void) void tp_rcu_read_lock_bp(void) { - rcu_read_lock_bp(); + urcu_bp_read_lock(); } void tp_rcu_read_unlock_bp(void) { - rcu_read_unlock_bp(); + urcu_bp_read_unlock(); } void *tp_rcu_dereference_sym_bp(void *p) { - return rcu_dereference_bp(p); + return urcu_bp_dereference(p); } /*