X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=include%2Flttng-sessiond-comm.h;h=4deec5fc8d4fd00163fb1ee110a41e26ef523997;hp=f57b0cd5f51bad2de8701b506b013dbe3d791406;hb=099e26bda04bd3e02eee5b0a17fc0d7f47e3f8ea;hpb=8b270bdb4dccf5571180a9906084126e90eec949 diff --git a/include/lttng-sessiond-comm.h b/include/lttng-sessiond-comm.h index f57b0cd5f..4deec5fc8 100644 --- a/include/lttng-sessiond-comm.h +++ b/include/lttng-sessiond-comm.h @@ -28,6 +28,7 @@ #include #include +#include #define LTTNG_RUNDIR "/var/run/lttng" @@ -40,8 +41,8 @@ /* Queue size of listen(2) */ #define MAX_LISTEN 10 -/* 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,7 @@ 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_KERN_NA, /* Kernel tracer unavalable */ LTTCOMM_KERN_EVENT_EXIST, /* Kernel event already exists */ LTTCOMM_KERN_SESS_FAIL, /* Kernel create session failed */ @@ -154,6 +157,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]; @@ -196,6 +203,33 @@ struct lttcomm_kconsumerd_msg { 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 { + } u; +}; + extern int lttcomm_create_unix_sock(const char *pathname); extern int lttcomm_connect_unix_sock(const char *pathname); extern int lttcomm_accept_unix_sock(int sock);