X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.cpp;h=68f8c1f7e01916c51c7299e6e660832aba029391;hb=4878de5c7deb512bbdac4fdfc498907efa06fb7c;hp=c7fb313f90fb1eedfa0541b1014d8209473fd23e;hpb=b2d6883965b19c6b6cb47acac952a7ab3de88c11;p=lttng-tools.git diff --git a/src/lib/lttng-ctl/lttng-ctl.cpp b/src/lib/lttng-ctl/lttng-ctl.cpp index c7fb313f9..68f8c1f7e 100644 --- a/src/lib/lttng-ctl/lttng-ctl.cpp +++ b/src/lib/lttng-ctl/lttng-ctl.cpp @@ -911,11 +911,18 @@ int lttng_stop_tracing_no_wait(const char *session_name) * Returns the size of the returned payload data or a negative error code. */ int lttng_add_context(struct lttng_handle *handle, - struct lttng_event_context *ctx, const char *event_name, + struct lttng_event_context *ctx, + const char *event_name __attribute__((unused)), const char *channel_name) { int ret; - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_ADD_CONTEXT }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_ADD_CONTEXT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_payload payload; lttng_payload_init(&payload); @@ -1083,7 +1090,13 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle, const char *original_filter_expression, int exclusion_count, char **exclusion_list) { - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_ENABLE_EVENT }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_ENABLE_EVENT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_payload payload; int ret = 0; unsigned int free_filter_expression = 0; @@ -1262,7 +1275,13 @@ int lttng_disable_event_ext(struct lttng_handle *handle, struct lttng_event *ev, const char *channel_name, const char *original_filter_expression) { - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_DISABLE_EVENT }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_DISABLE_EVENT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_payload payload; int ret = 0; unsigned int free_filter_expression = 0; @@ -1649,7 +1668,13 @@ int lttng_list_tracepoints(struct lttng_handle *handle, enum lttng_error_code ret_code; int ret, total_payload_received; char *reception_buffer = NULL; - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_LIST_TRACEPOINTS }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_LIST_TRACEPOINTS, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttcomm_list_command_header *cmd_header = NULL; size_t cmd_header_len; unsigned int nb_events = 0; @@ -1874,6 +1899,10 @@ enum lttng_error_code lttng_create_session_ext( enum lttng_error_code ret_code; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_CREATE_SESSION_EXT, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; void *reply = NULL; struct lttng_buffer_view reply_view; @@ -2416,14 +2445,14 @@ int lttng_list_events(struct lttng_handle *handle, (const char *) &lsm, 0, sizeof(lsm)); unsigned int nb_events = 0; + lttng_payload_init(&reply); + /* Safety check. An handle and channel name are mandatory. */ if (handle == NULL || channel_name == NULL) { ret = -LTTNG_ERR_INVALID; goto end; } - lttng_payload_init(&reply); - /* Initialize command parameters. */ lsm.cmd_type = LTTNG_LIST_EVENTS; ret = lttng_strncpy(lsm.session.name, handle->session_name, @@ -2520,8 +2549,8 @@ end: return ret; } -int lttng_calibrate(struct lttng_handle *handle, - struct lttng_calibrate *calibrate) +int lttng_calibrate(struct lttng_handle *handle __attribute__((unused)), + struct lttng_calibrate *calibrate __attribute__((unused))) { /* * This command was removed in LTTng 2.9. @@ -2827,7 +2856,7 @@ error: */ extern "C" LTTNG_EXPORT int lttng_enable_consumer(struct lttng_handle *handle); -int lttng_enable_consumer(struct lttng_handle *handle) +int lttng_enable_consumer(struct lttng_handle *handle __attribute__((unused))) { return -ENOSYS; } @@ -2837,7 +2866,7 @@ int lttng_enable_consumer(struct lttng_handle *handle) */ extern "C" LTTNG_EXPORT int lttng_disable_consumer(struct lttng_handle *handle); -int lttng_disable_consumer(struct lttng_handle *handle) +int lttng_disable_consumer(struct lttng_handle *handle __attribute__((unused))) { return -ENOSYS; } @@ -2848,8 +2877,9 @@ int lttng_disable_consumer(struct lttng_handle *handle) extern "C" LTTNG_EXPORT int _lttng_create_session_ext(const char *name, const char *url, const char *datetime); -int _lttng_create_session_ext(const char *name, const char *url, - const char *datetime) +int _lttng_create_session_ext(const char *name __attribute__((unused)), + const char *url __attribute__((unused)), + const char *datetime __attribute__((unused))) { return -ENOSYS; } @@ -2981,6 +3011,10 @@ int _lttng_register_trigger(struct lttng_trigger *trigger, const char *name, int ret; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_REGISTER_TRIGGER, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; lsm.u.trigger.is_trigger_anonymous = !name && !generate_name; struct lttcomm_session_msg *message_lsm; @@ -3153,6 +3187,10 @@ enum lttng_error_code lttng_error_query_execute( enum lttng_error_code ret_code; struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_EXECUTE_ERROR_QUERY, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, }; struct lttng_payload message; struct lttng_payload reply; @@ -3337,7 +3375,13 @@ enum lttng_error_code lttng_list_triggers(struct lttng_triggers **triggers) { int ret; enum lttng_error_code ret_code = LTTNG_OK; - struct lttcomm_session_msg lsm = { .cmd_type = LTTNG_LIST_TRIGGERS }; + struct lttcomm_session_msg lsm = { + .cmd_type = LTTNG_LIST_TRIGGERS, + .session = {}, + .domain = {}, + .u = {}, + .fd_count = 0, + }; struct lttng_triggers *local_triggers = NULL; struct lttng_payload reply; struct lttng_payload_view lsm_view =