Change wfq usages for wfcq
authorSimon Marchi <simon.marchi@polymtl.ca>
Sat, 26 Jul 2014 05:26:56 +0000 (01:26 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Mon, 28 Jul 2014 19:31:01 +0000 (15:31 -0400)
This removes the deprecated warnings when building lttng-tools. We can
now build with -Werror, woohoo!

This makes lttng-tools depends on userspace-rcu version 0.8.0 and above.
The configure.ac and README files have been updated for this.

Verified by running make check.

Signed-off-by: David Goulet <dgoulet@efficios.com>
README
configure.ac
src/bin/lttng-relayd/connection.h
src/bin/lttng-relayd/live.c
src/bin/lttng-relayd/lttng-relayd.h
src/bin/lttng-relayd/main.c
src/bin/lttng-sessiond/lttng-sessiond.h
src/bin/lttng-sessiond/main.c

diff --git a/README b/README
index c98444991b1a81b176cc273bdf5a03c2906ebcf2..43fd0c5cba33be283d85cb020fb4d271a6873511 100644 (file)
--- a/README
+++ b/README
@@ -17,10 +17,10 @@ REQUIREMENTS:
       kernel version can probably be older but we can't provide any guarantee.
       Please let us know if you are able to go lower without any problems.
 
       kernel version can probably be older but we can't provide any guarantee.
       Please let us know if you are able to go lower without any problems.
 
-    - liburcu
+    - liburcu >= 0.8.0
       Userspace RCU library, by Mathieu Desnoyers and Paul E. McKenney
 
       Userspace RCU library, by Mathieu Desnoyers and Paul E. McKenney
 
-      -> Tested with liburcu 0.7.x stable.
+      -> Tested with liburcu 0.8.x stable.
 
       * Debian/Ubuntu package: liburcu-dev
       * Git : git://git.lttng.org/userspace-rcu.git
 
       * Debian/Ubuntu package: liburcu-dev
       * Git : git://git.lttng.org/userspace-rcu.git
index 7d8839543eb03f42b3d3061472b17b4e0c7314a7..21cfab070411d22ea1c4a79e957594c6df1c61a2 100644 (file)
@@ -171,17 +171,17 @@ AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBUUID], [test "x$have_libuuid" = "xyes"])
 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
 
 # URCU library version needed or newer
 AM_CONDITIONAL([LTTNG_BUILD_WITH_LIBC_UUID], [test "x$have_libc_uuid" = "xyes"])
 
 # URCU library version needed or newer
-liburcu_version=">= 0.7.2"
+liburcu_version=">= 0.8.0"
 
 # Check liburcu needed function calls
 AC_CHECK_DECL([cds_list_add], [],
        [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
 )
 
 # Check liburcu needed function calls
 AC_CHECK_DECL([cds_list_add], [],
        [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/list.h>]]
 )
-AC_CHECK_DECL([cds_wfq_init], [],
-       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
+AC_CHECK_DECL([cds_wfcq_init], [],
+       [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfcqueue.h>]]
 )
 )
-AC_CHECK_DECL([cds_wfq_dequeue_blocking], [],
-    [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfqueue.h>]]
+AC_CHECK_DECL([cds_wfcq_dequeue_blocking], [],
+    [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/wfcqueue.h>]]
 )
 AC_CHECK_DECL([futex_async], [],
        [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
 )
 AC_CHECK_DECL([futex_async], [],
        [AC_MSG_ERROR([liburcu $liburcu_version or newer is needed])], [[#include <urcu/futex.h>]]
index fc4a59075f3dabd4a88eab06f8eef06b58af53d2..70fe4ba3da19c9a5f534911ac70b95abe610cd76 100644 (file)
@@ -23,7 +23,7 @@
 #include <inttypes.h>
 #include <pthread.h>
 #include <urcu.h>
 #include <inttypes.h>
 #include <pthread.h>
 #include <urcu.h>
-#include <urcu/wfqueue.h>
+#include <urcu/wfcqueue.h>
 #include <urcu/list.h>
 
 #include <common/hashtable/hashtable.h>
 #include <urcu/list.h>
 
 #include <common/hashtable/hashtable.h>
@@ -46,7 +46,7 @@ struct relay_connection {
        struct lttcomm_sock *sock;
        struct relay_session *session;
        struct relay_viewer_session *viewer_session;
        struct lttcomm_sock *sock;
        struct relay_session *session;
        struct relay_viewer_session *viewer_session;
-       struct cds_wfq_node qnode;
+       struct cds_wfcq_node qnode;
        struct lttng_ht_node_ulong sock_n;
        struct rcu_head rcu_node;
        enum connection_type type;
        struct lttng_ht_node_ulong sock_n;
        struct rcu_head rcu_node;
        enum connection_type type;
index 8c716dbde9852e1de1b9a04261fb59c22035e767..5684608eacc6b72a86550dd0c70e007381922b12 100644 (file)
@@ -558,11 +558,12 @@ restart:
                                new_conn->sock = newsock;
 
                                /* Enqueue request for the dispatcher thread. */
                                new_conn->sock = newsock;
 
                                /* Enqueue request for the dispatcher thread. */
-                               cds_wfq_enqueue(&viewer_conn_queue.queue, &new_conn->qnode);
+                               cds_wfcq_enqueue(&viewer_conn_queue.head, &viewer_conn_queue.tail,
+                                                &new_conn->qnode);
 
                                /*
                                 * Wake the dispatch queue futex. Implicit memory barrier with
 
                                /*
                                 * Wake the dispatch queue futex. Implicit memory barrier with
-                                * the exchange in cds_wfq_enqueue.
+                                * the exchange in cds_wfcq_enqueue.
                                 */
                                futex_nto1_wake(&viewer_conn_queue.futex);
                        }
                                 */
                                futex_nto1_wake(&viewer_conn_queue.futex);
                        }
@@ -601,7 +602,7 @@ void *thread_dispatcher(void *data)
 {
        int err = -1;
        ssize_t ret;
 {
        int err = -1;
        ssize_t ret;
-       struct cds_wfq_node *node;
+       struct cds_wfcq_node *node;
        struct relay_connection *conn = NULL;
 
        DBG("[thread] Live viewer relay dispatcher started");
        struct relay_connection *conn = NULL;
 
        DBG("[thread] Live viewer relay dispatcher started");
@@ -624,7 +625,8 @@ void *thread_dispatcher(void *data)
                        health_code_update();
 
                        /* Dequeue commands */
                        health_code_update();
 
                        /* Dequeue commands */
-                       node = cds_wfq_dequeue_blocking(&viewer_conn_queue.queue);
+                       node = cds_wfcq_dequeue_blocking(&viewer_conn_queue.head,
+                                                        &viewer_conn_queue.tail);
                        if (node == NULL) {
                                DBG("Woken up but nothing in the live-viewer "
                                                "relay command queue");
                        if (node == NULL) {
                                DBG("Woken up but nothing in the live-viewer "
                                                "relay command queue");
@@ -2113,7 +2115,7 @@ int live_start_threads(struct lttng_uri *uri,
        }
 
        /* Init relay command queue. */
        }
 
        /* Init relay command queue. */
-       cds_wfq_init(&viewer_conn_queue.queue);
+       cds_wfcq_init(&viewer_conn_queue.head, &viewer_conn_queue.tail);
 
        /* Set up max poll set size */
        lttng_poll_set_max_size();
 
        /* Set up max poll set size */
        lttng_poll_set_max_size();
index 55ce25ea6ff162871f2deb711e04ab26b587f07b..896925f9e16be3e10655d00e5253051b3098107c 100644 (file)
@@ -22,7 +22,7 @@
 #define _LGPL_SOURCE
 #include <limits.h>
 #include <urcu.h>
 #define _LGPL_SOURCE
 #include <limits.h>
 #include <urcu.h>
-#include <urcu/wfqueue.h>
+#include <urcu/wfcqueue.h>
 
 #include <common/hashtable/hashtable.h>
 
 
 #include <common/hashtable/hashtable.h>
 
@@ -30,7 +30,8 @@
  * Queue used to enqueue relay requests
  */
 struct relay_conn_queue {
  * Queue used to enqueue relay requests
  */
 struct relay_conn_queue {
-       struct cds_wfq_queue queue;
+       struct cds_wfcq_head head;
+       struct cds_wfcq_tail tail;
        int32_t futex;
 };
 
        int32_t futex;
 };
 
index 3a6bebaf7d6d3dc1ab5f7cf4fe76522d6f5c56fd..a3b8016db46d157dc44f478553011f489b60c591 100644 (file)
@@ -882,11 +882,12 @@ restart:
                                new_conn->sock = newsock;
 
                                /* Enqueue request for the dispatcher thread. */
                                new_conn->sock = newsock;
 
                                /* Enqueue request for the dispatcher thread. */
-                               cds_wfq_enqueue(&relay_conn_queue.queue, &new_conn->qnode);
+                               cds_wfcq_enqueue(&relay_conn_queue.head, &relay_conn_queue.tail,
+                                                &new_conn->qnode);
 
                                /*
                                 * Wake the dispatch queue futex. Implicit memory barrier with
 
                                /*
                                 * Wake the dispatch queue futex. Implicit memory barrier with
-                                * the exchange in cds_wfq_enqueue.
+                                * the exchange in cds_wfcq_enqueue.
                                 */
                                futex_nto1_wake(&relay_conn_queue.futex);
                        }
                                 */
                                futex_nto1_wake(&relay_conn_queue.futex);
                        }
@@ -933,7 +934,7 @@ void *relay_thread_dispatcher(void *data)
 {
        int err = -1;
        ssize_t ret;
 {
        int err = -1;
        ssize_t ret;
-       struct cds_wfq_node *node;
+       struct cds_wfcq_node *node;
        struct relay_connection *new_conn = NULL;
 
        DBG("[thread] Relay dispatcher started");
        struct relay_connection *new_conn = NULL;
 
        DBG("[thread] Relay dispatcher started");
@@ -956,7 +957,8 @@ void *relay_thread_dispatcher(void *data)
                        health_code_update();
 
                        /* Dequeue commands */
                        health_code_update();
 
                        /* Dequeue commands */
-                       node = cds_wfq_dequeue_blocking(&relay_conn_queue.queue);
+                       node = cds_wfcq_dequeue_blocking(&relay_conn_queue.head,
+                                                        &relay_conn_queue.tail);
                        if (node == NULL) {
                                DBG("Woken up but nothing in the relay command queue");
                                /* Continue thread execution */
                        if (node == NULL) {
                                DBG("Woken up but nothing in the relay command queue");
                                /* Continue thread execution */
@@ -2762,7 +2764,7 @@ int main(int argc, char **argv)
        }
 
        /* Init relay command queue. */
        }
 
        /* Init relay command queue. */
-       cds_wfq_init(&relay_conn_queue.queue);
+       cds_wfcq_init(&relay_conn_queue.head, &relay_conn_queue.tail);
 
        /* Set up max poll set size */
        lttng_poll_set_max_size();
 
        /* Set up max poll set size */
        lttng_poll_set_max_size();
index 0f4c6687892792a338d5a455ad6be574cf07486b..f3fb750a93e517899f9ee451c9f2f3d8c1421643 100644 (file)
@@ -21,7 +21,7 @@
 
 #define _LGPL_SOURCE
 #include <urcu.h>
 
 #define _LGPL_SOURCE
 #include <urcu.h>
-#include <urcu/wfqueue.h>
+#include <urcu/wfcqueue.h>
 
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/compat/poll.h>
 
 #include <common/sessiond-comm/sessiond-comm.h>
 #include <common/compat/poll.h>
@@ -55,7 +55,7 @@ struct command_ctx {
 struct ust_command {
        int sock;
        struct ust_register_msg reg_msg;
 struct ust_command {
        int sock;
        struct ust_register_msg reg_msg;
-       struct cds_wfq_node node;
+       struct cds_wfcq_node node;
 };
 
 /*
 };
 
 /*
@@ -64,7 +64,8 @@ struct ust_command {
  */
 struct ust_cmd_queue {
        int32_t futex;
  */
 struct ust_cmd_queue {
        int32_t futex;
-       struct cds_wfq_queue queue;
+       struct cds_wfcq_head head;
+       struct cds_wfcq_tail tail;
 };
 
 /*
 };
 
 /*
index 1ee6f4a9f658f4cc547860ce5ac9f91a85c6e878..fdc53760330d6d12766dc9ed370b1a1b641f5290 100644 (file)
@@ -1685,7 +1685,7 @@ error_create:
 static void *thread_dispatch_ust_registration(void *data)
 {
        int ret, err = -1;
 static void *thread_dispatch_ust_registration(void *data)
 {
        int ret, err = -1;
-       struct cds_wfq_node *node;
+       struct cds_wfcq_node *node;
        struct ust_command *ust_cmd = NULL;
        struct ust_reg_wait_node *wait_node = NULL, *tmp_wait_node;
        struct ust_reg_wait_queue wait_queue = {
        struct ust_command *ust_cmd = NULL;
        struct ust_reg_wait_node *wait_node = NULL, *tmp_wait_node;
        struct ust_reg_wait_queue wait_queue = {
@@ -1723,7 +1723,7 @@ static void *thread_dispatch_ust_registration(void *data)
 
                        health_code_update();
                        /* Dequeue command for registration */
 
                        health_code_update();
                        /* Dequeue command for registration */
-                       node = cds_wfq_dequeue_blocking(&ust_cmd_queue.queue);
+                       node = cds_wfcq_dequeue_blocking(&ust_cmd_queue.head, &ust_cmd_queue.tail);
                        if (node == NULL) {
                                DBG("Woken up but nothing in the UST command queue");
                                /* Continue thread execution */
                        if (node == NULL) {
                                DBG("Woken up but nothing in the UST command queue");
                                /* Continue thread execution */
@@ -2077,11 +2077,11 @@ static void *thread_registration_apps(void *data)
                                         * Lock free enqueue the registration request. The red pill
                                         * has been taken! This apps will be part of the *system*.
                                         */
                                         * Lock free enqueue the registration request. The red pill
                                         * has been taken! This apps will be part of the *system*.
                                         */
-                                       cds_wfq_enqueue(&ust_cmd_queue.queue, &ust_cmd->node);
+                                       cds_wfcq_enqueue(&ust_cmd_queue.head, &ust_cmd_queue.tail, &ust_cmd->node);
 
                                        /*
                                         * Wake the registration queue futex. Implicit memory
 
                                        /*
                                         * Wake the registration queue futex. Implicit memory
-                                        * barrier with the exchange in cds_wfq_enqueue.
+                                        * barrier with the exchange in cds_wfcq_enqueue.
                                         */
                                        futex_nto1_wake(&ust_cmd_queue.futex);
                                }
                                         */
                                        futex_nto1_wake(&ust_cmd_queue.futex);
                                }
@@ -5257,7 +5257,7 @@ int main(int argc, char **argv)
        buffer_reg_init_pid_registry();
 
        /* Init UST command queue. */
        buffer_reg_init_pid_registry();
 
        /* Init UST command queue. */
-       cds_wfq_init(&ust_cmd_queue.queue);
+       cds_wfcq_init(&ust_cmd_queue.head, &ust_cmd_queue.tail);
 
        /*
         * Get session list pointer. This pointer MUST NOT be free(). This list is
 
        /*
         * Get session list pointer. This pointer MUST NOT be free(). This list is
This page took 0.031807 seconds and 4 git commands to generate.