X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng-sessiond-comm.h;h=71a1dd642185ffb678c027003d8d0a37f9b4864e;hb=204d45df751cfc84133317c88bc6c46e0de12b52;hp=be903a6ce3f9f66c909864f1cfbaf2a75743e2a7;hpb=67c5b804ac870bdc3b262c0cf6cbf117f3e6bc1e;p=lttng-ust.git diff --git a/include/lttng-sessiond-comm.h b/include/lttng-sessiond-comm.h index be903a6c..71a1dd64 100644 --- a/include/lttng-sessiond-comm.h +++ b/include/lttng-sessiond-comm.h @@ -40,31 +40,42 @@ /* Queue size of listen(2) */ #define MAX_LISTEN 10 +#define LTTNG_UST_COMM_VERSION_MAJOR 0 +#define LTTNG_UST_COMM_VERSION_MINOR 1 + /* Get the error code index from 0 since * LTTCOMM_OK start at 1000 */ #define LTTCOMM_ERR_INDEX(code) (code - LTTCOMM_OK) -enum lttcomm_sessiond_command { - /* Tracer command */ - LTTNG_ADD_CONTEXT, - LTTNG_CALIBRATE, - LTTNG_DISABLE_CHANNEL, - LTTNG_DISABLE_EVENT, - LTTNG_DISABLE_ALL_EVENT, - LTTNG_ENABLE_CHANNEL, - LTTNG_ENABLE_EVENT, - LTTNG_ENABLE_ALL_EVENT, - /* Session daemon command */ - LTTNG_CREATE_SESSION, - LTTNG_DESTROY_SESSION, - LTTNG_LIST_CHANNELS, - LTTNG_LIST_DOMAINS, - LTTNG_LIST_EVENTS, - LTTNG_LIST_SESSIONS, - LTTNG_LIST_TRACEPOINTS, - LTTNG_START_TRACE, - LTTNG_STOP_TRACE, +enum lttcomm_ust_command { + LTTNG_UST_CREATE_SESSION, + LTTNG_UST_RELEASE_SESSION, + LTTNG_UST_VERSION, + LTTNG_UST_LIST_TRACEPOINTS, + LTTNG_UST_WAIT_QUIESCENT, + LTTNG_UST_CALIBRATE, + + /* Apply on session handle */ + LTTNG_UST_METADATA, /* release with LTTNG_UST_RELEASE_CHANNEL */ + LTTNG_UST_CHANNEL, + LTTNG_UST_RELEASE_CHANNEL, + LTTNG_UST_SESSION_START, + LTTNG_UST_SESSION_STOP, + + /* Apply on channel handle */ + LTTNG_UST_STREAM, + LTTNG_UST_RELEASE_STREAM, + LTTNG_UST_EVENT, + LTTNG_UST_RELEASE_EVENT, + + /* Apply on event and channel handle */ + LTTNG_UST_CONTEXT, + LTTNG_UST_RELEASE_CONTEXT, + + /* Apply on event, channel and session handle */ + LTTNG_UST_ENABLE, + LTTNG_UST_DISABLE, }; /* @@ -127,72 +138,75 @@ enum lttcomm_return_code { LTTCOMM_NR, /* Last element */ }; -/* - * Data structure received from lttng client to session daemon. - */ -struct lttcomm_session_msg { - uint32_t cmd_type; /* enum lttcomm_sessiond_command */ - struct lttng_session session; - struct lttng_domain domain; +#define LTTNG_SYM_NAME_LEN 128 + +enum lttng_ust_instrumentation { + LTTNG_UST_TRACEPOINT = 0, + LTTNG_UST_PROBE = 1, + LTTNG_UST_FUNCTION = 2, +}; + +enum lttng_ust_output { + LTTNG_UST_MMAP = 0, +}; + +struct lttng_ust_tracer_version { + uint32_t version; + uint32_t patchlevel; + uint32_t sublevel; +}; + +struct lttng_ust_channel { + int overwrite; /* 1: overwrite, 0: discard */ + uint64_t subbuf_size; /* in bytes */ + uint64_t num_subbuf; + unsigned int switch_timer_interval; /* usecs */ + unsigned int read_timer_interval; /* usecs */ + enum lttng_ust_output output; /* output mode */ +}; + +struct lttng_ust_event { + char name[LTTNG_SYM_NAME_LEN]; /* event name */ + enum lttng_ust_instrumentation instrumentation; + /* Per instrumentation type configuration */ union { - struct { - char channel_name[NAME_MAX]; - char name[NAME_MAX]; - } disable; - /* Event data */ - struct { - char channel_name[NAME_MAX]; - struct lttng_event event; - } enable; - /* Create channel */ - struct { - struct lttng_channel chan; - } channel; - /* Context */ - struct { - char channel_name[NAME_MAX]; - char event_name[NAME_MAX]; - struct lttng_event_context ctx; - } context; - /* List */ - struct { - char channel_name[NAME_MAX]; - } list; - struct lttng_calibrate calibrate; } u; }; -/* - * Data structure for the response from sessiond to the lttng client. - */ -struct lttcomm_lttng_msg { - uint32_t cmd_type; /* enum lttcomm_sessiond_command */ - uint32_t ret_code; /* enum lttcomm_return_code */ - uint32_t pid; /* pid_t */ - uint32_t data_size; - /* Contains: trace_name + data */ - char payload[]; +enum lttng_ust_context_type { + LTTNG_KERNEL_CONTEXT_VTID = 0, +}; + +struct lttng_ust_context { + enum lttng_ust_context_type ctx; + union { + } u; }; /* - * Data structures for the kconsumerd communications - * - * The header structure is sent to the kconsumerd daemon to inform - * how many lttcomm_kconsumerd_msg it is about to receive + * Data structure for the commands sent from sessiond to UST. */ -struct lttcomm_kconsumerd_header { - uint32_t payload_size; - uint32_t cmd_type; /* enum kconsumerd_command */ +struct lttcomm_ust_msg { + uint32_t cmd_type; /* enum lttcomm_ust_command */ + uint32_t handle; + union { + struct lttng_ust_tracer_version version; + struct lttng_ust_channel channel; + struct lttng_ust_event event; + struct lttng_ust_context context; + } u; }; -/* lttcomm_kconsumerd_msg represents a file descriptor to consume the - * data and a path name to write it +/* + * Data structure for the response from UST to the session daemon. + * cmd_type is sent back in the reply for validation. */ -struct lttcomm_kconsumerd_msg { - char path_name[PATH_MAX]; - int fd; - uint32_t state; /* enum lttcomm_kconsumerd_fd_state */ - unsigned long max_sb_size; /* the subbuffer size for this channel */ +struct lttcomm_ust_reply { + uint32_t cmd_type; /* enum lttcomm_sessiond_command */ + uint32_t ret_code; /* enum enum lttcomm_return_code */ + uint32_t ret_val; /* return value */ + union { + } u; }; extern int lttcomm_create_unix_sock(const char *pathname);