Use UST comm lib
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 23 Oct 2011 13:23:12 +0000 (09:23 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Sun, 23 Oct 2011 13:23:12 +0000 (09:23 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
include/lttng-sessiond-comm.h
liblttng-sessiond-comm/lttng-sessiond-comm.c
ltt-sessiond/Makefile.am
ltt-sessiond/ust-comm.c
ltt-sessiond/ust-ctl.c

index 60005ac5e7d0552f350a1a978ef19c99534647f9..68d8b910914c053dcaf90f345b25e575ce749dc9 100644 (file)
@@ -38,7 +38,7 @@
 #define DEFAULT_HOME_CLIENT_UNIX_SOCK       "%s/.client-ltt-sessiond"
 
 /* Queue size of listen(2) */
-#define MAX_LISTEN 64
+#define LTTNG_SESSIOND_COMM_MAX_LISTEN 64
 
 /*
  * Get the error code index from 0 since LTTCOMM_OK start at 1000
index 4bb6ed5783488cf2293d833339cd13de9eafda1f..5ba609e5aa098545d44035a47d7a84aca422d638 100644 (file)
@@ -206,13 +206,13 @@ error:
 }
 
 /*
- * Make the socket listen using MAX_LISTEN.
+ * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN.
  */
 int lttcomm_listen_unix_sock(int sock)
 {
        int ret;
 
-       ret = listen(sock, MAX_LISTEN);
+       ret = listen(sock, LTTNG_SESSIOND_COMM_MAX_LISTEN);
        if (ret < 0) {
                perror("listen");
        }
index 0d284efb1ee4cc27f6155a24cdf29a7c8d3ca9d4..ecc977ab1b8f95090544779e5ece676bb0c99fd9 100644 (file)
@@ -39,3 +39,7 @@ ltt_sessiond_LDADD = -lrt \
                 $(top_builddir)/liblttng-sessiond-comm/liblttng-sessiond-comm.la \
                 $(top_builddir)/libkernelctl/libkernelctl.la \
                 $(top_builddir)/liblttngctl/liblttngctl.la
+
+if LTTNG_TOOLS_HAVE_UST
+ltt_sessiond_LDADD += -llttng-ust-comm
+endif
index 724260511e621660669e1fc3de28d1762279bc9a..4a54bf78429e0172a1c7ddfbaa385c0aa98f1a74 100644 (file)
@@ -19,6 +19,7 @@
 #include <config.h>
 #include <stdlib.h>
 #include <lttngerr.h>
+#include <ust/lttng-ust-comm.h>
 #include "ust-comm.h"
 
 /*
@@ -41,7 +42,7 @@ struct lttcomm_ust_reply *ustcomm_send_command(int sock,
        DBG2("Sending UST command %d to sock %d", msg->cmd, sock);
 
        /* Send UST msg */
-       len = lttcomm_send_unix_sock(sock, msg, sizeof(*msg));
+       len = ustcomm_send_unix_sock(sock, msg, sizeof(*msg));
        if (len < 0) {
                goto error;
        }
@@ -55,7 +56,7 @@ struct lttcomm_ust_reply *ustcomm_send_command(int sock,
        DBG2("Receiving UST reply on sock %d", sock);
 
        /* Get UST reply */
-       len = lttcomm_recv_unix_sock(sock, reply, sizeof(*reply));
+       len = ustcomm_recv_unix_sock(sock, reply, sizeof(*reply));
        if (len < 0 || len < sizeof(*reply)) {
                goto error;
        }
index 2f43b1e60316435e8bfcdcb6989c90fb1095d370..7f70b8975b5d963dfd890b22d14c13c9817e9ef0 100644 (file)
@@ -23,7 +23,7 @@
 #include <string.h>
 #include <unistd.h>
 
-#include <lttng-sessiond-comm.h>
+#include <ust/lttng-ust-comm.h>
 #include <lttngerr.h>
 
 #include "ust-comm.h"
@@ -47,8 +47,8 @@ int ustctl_register_done(int sock)
                goto error;
        }
 
-       if (reply->ret_code != LTTCOMM_OK) {
-               DBG("Return code: %s", lttcomm_get_readable_code(reply->ret_code));
+       if (reply->ret_code != USTCOMM_OK) {
+               DBG("Return code: %s", ustcomm_get_readable_code(reply->ret_code));
                goto error;
        }
 
@@ -74,8 +74,8 @@ int ustctl_create_session(int sock, struct ltt_ust_session *session)
                goto error;
        }
 
-       if (reply->ret_code != LTTCOMM_OK) {
-               DBG("Return code: %s", lttcomm_get_readable_code(reply->ret_code));
+       if (reply->ret_code != USTCOMM_OK) {
+               DBG("Return code: %s", ustcomm_get_readable_code(reply->ret_code));
                goto error;
        }
 
@@ -119,9 +119,9 @@ int ustctl_create_channel(int sock, struct ltt_ust_session *session,
                goto error;
        }
 
-       if (reply->ret_code != LTTCOMM_OK) {
+       if (reply->ret_code != USTCOMM_OK) {
                DBG("Return code (%d): %s", reply->ret_code,
-                               lttcomm_get_readable_code(reply->ret_code));
+                               ustcomm_get_readable_code(reply->ret_code));
                goto error;
        }
 
@@ -159,9 +159,9 @@ int ustctl_enable_channel(int sock, struct ltt_ust_session *session,
                goto error;
        }
 
-       if (reply->ret_code != LTTCOMM_OK) {
+       if (reply->ret_code != USTCOMM_OK) {
                DBG("Return code (%d): %s", reply->ret_code,
-                               lttcomm_get_readable_code(reply->ret_code));
+                               ustcomm_get_readable_code(reply->ret_code));
                goto error;
        } else if (reply->handle != chan->handle) {
                ERR("Receive wrong handle from UST reply on enable channel");
@@ -198,9 +198,9 @@ int ustctl_disable_channel(int sock, struct ltt_ust_session *session,
                goto error;
        }
 
-       if (reply->ret_code != LTTCOMM_OK) {
+       if (reply->ret_code != USTCOMM_OK) {
                DBG("Return code (%d): %s", reply->ret_code,
-                               lttcomm_get_readable_code(reply->ret_code));
+                               ustcomm_get_readable_code(reply->ret_code));
                goto error;
        } else if (reply->handle != chan->handle) {
                ERR("Receive wrong handle from UST reply on enable channel");
This page took 0.030047 seconds and 5 git commands to generate.