Update UST ABI and add UST some error message
[lttng-tools.git] / include / lttng-sessiond-comm.h
index be903a6ce3f9f66c909864f1cfbaf2a75743e2a7..f8308505c712c915f3a2e17119ec2dea5c3c15c6 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <limits.h>
 #include <lttng/lttng.h>
+#include <lttng-ust.h>
 
 #define LTTNG_RUNDIR                        "/var/run/lttng"
 
 #define DEFAULT_HOME_CLIENT_UNIX_SOCK       "%s/.client-ltt-sessiond"
 
 /* Queue size of listen(2) */
-#define MAX_LISTEN 10
+#define MAX_LISTEN 64
 
-/* Get the error code index from 0 since
- * LTTCOMM_OK start at 1000
+/*
+ * Get the error code index from 0 since LTTCOMM_OK start at 1000
  */
 #define LTTCOMM_ERR_INDEX(code) (code - LTTCOMM_OK)
 
@@ -63,6 +64,7 @@ enum lttcomm_sessiond_command {
        LTTNG_LIST_EVENTS,
        LTTNG_LIST_SESSIONS,
        LTTNG_LIST_TRACEPOINTS,
+       LTTNG_REGISTER_CONSUMER,
        LTTNG_START_TRACE,
        LTTNG_STOP_TRACE,
 };
@@ -91,6 +93,8 @@ enum lttcomm_return_code {
        LTTCOMM_SELECT_SESS,                    /* Must select a session */
        LTTCOMM_EXIST_SESS,                             /* Session name already exist */
        LTTCOMM_NO_EVENT,                               /* No event found */
+       LTTCOMM_CONNECT_FAIL,           /* Unable to connect to unix socket */
+       LTTCOMM_APP_NOT_FOUND,          /* App not found in traceable app list */
        LTTCOMM_KERN_NA,                                /* Kernel tracer unavalable */
        LTTCOMM_KERN_EVENT_EXIST,       /* Kernel event already exists */
        LTTCOMM_KERN_SESS_FAIL,                 /* Kernel create session failed */
@@ -110,6 +114,9 @@ enum lttcomm_return_code {
        LTTCOMM_KERN_DIR_EXIST,                 /* Kernel trace directory exist */
        LTTCOMM_KERN_NO_SESSION,                /* No kernel session found */
        LTTCOMM_KERN_LIST_FAIL,                 /* Kernel listing events failed */
+       LTTCOMM_UST_SESS_FAIL,                  /* UST create session failed */
+       LTTCOMM_UST_CHAN_NOT_FOUND,     /* UST channel not found */
+       LTTCOMM_UST_CHAN_FAIL,          /* UST create channel failed */
        KCONSUMERD_COMMAND_SOCK_READY,  /* when kconsumerd command socket ready */
        KCONSUMERD_SUCCESS_RECV_FD,             /* success on receiving fds */
        KCONSUMERD_ERROR_RECV_FD,               /* error on receiving fds */
@@ -154,6 +161,10 @@ struct lttcomm_session_msg {
                        char event_name[NAME_MAX];
                        struct lttng_event_context ctx;
                } context;
+               /* Use by register_consumer */
+               struct {
+                       char path[PATH_MAX];
+               } reg;
                /* List */
                struct {
                        char channel_name[NAME_MAX];
@@ -193,6 +204,40 @@ struct lttcomm_kconsumerd_msg {
        int fd;
        uint32_t state;    /* enum lttcomm_kconsumerd_fd_state */
        unsigned long max_sb_size; /* the subbuffer size for this channel */
+       enum lttng_event_output output; /* use splice or mmap to consume this fd */
+};
+
+/*
+ * Data structure for the commands sent from sessiond to UST.
+ */
+struct lttcomm_ust_msg {
+       uint32_t handle;
+       uint32_t cmd;
+       union {
+               struct lttng_ust_tracer_version version;
+               struct lttng_ust_channel channel;
+               struct lttng_ust_event event;
+               struct lttng_ust_context context;
+       } u;
+};
+
+/*
+ * Data structure for the response from UST to the session daemon.
+ * cmd_type is sent back in the reply for validation.
+ */
+struct lttcomm_ust_reply {
+       uint32_t handle;
+       uint32_t cmd;
+       uint32_t ret_code;      /* enum lttcomm_return_code */
+       uint32_t ret_val;       /* return value */
+       union {
+               struct {
+                       uint64_t memory_map_size;
+               } channel;
+               struct {
+                       uint64_t memory_map_size;
+               } stream;
+       } u;
 };
 
 extern int lttcomm_create_unix_sock(const char *pathname);
This page took 0.023823 seconds and 4 git commands to generate.