From: Jérémie Galarneau Date: Tue, 21 Aug 2018 19:48:36 +0000 (-0400) Subject: Implement rotation ongoing/completed commands X-Git-Tag: v2.11.0-rc1~117 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=0ca52944daa81aea35eb372ccdb118c42a002d13;hp=1eee26c5877ee16e13aa7106f479dd352b1554e1;p=lttng-tools.git Implement rotation ongoing/completed commands Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 626275086..1041b9f1a 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4560,6 +4560,13 @@ int cmd_rotate_session(struct ltt_session *session, session->current_archive_id++; session->rotate_pending = true; session->rotation_state = LTTNG_ROTATION_STATE_ONGOING; + ret = notification_thread_command_session_rotation_ongoing( + notification_thread_handle, + session->name, session->current_archive_id); + if (ret) { + ret = LTTNG_ERR_UNK; + goto end; + } /* * Create the path name for the next chunk. diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index c80d977da..f84a08d38 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -1527,6 +1527,27 @@ end: return 0; } +static +int handle_notification_thread_command_session_rotation_ongoing( + struct notification_thread_state *state, + const char *session_name, uint64_t trace_archive_chunk_id, + enum lttng_error_code *cmd_result) +{ + *cmd_result = LTTNG_OK; + return 0; +} + +static +int handle_notification_thread_command_session_rotation_completed( + struct notification_thread_state *state, + const char *session_name, uint64_t trace_archive_chunk_id, + const struct lttng_trace_archive_location *location, + enum lttng_error_code *cmd_result) +{ + *cmd_result = LTTNG_OK; + return 0; +} + static int condition_is_supported(struct lttng_condition *condition) { @@ -2018,6 +2039,23 @@ int handle_notification_thread_command( cmd->parameters.remove_channel.domain, &cmd->reply_code); break; + case NOTIFICATION_COMMAND_TYPE_SESSION_ROTATION_ONGOING: + DBG("[notification-thread] Received session rotation ongoing command"); + ret = handle_notification_thread_command_session_rotation_ongoing( + state, + cmd->parameters.session_rotation_ongoing.session_name, + cmd->parameters.session_rotation_ongoing.trace_archive_chunk_id, + &cmd->reply_code); + break; + case NOTIFICATION_COMMAND_TYPE_SESSION_ROTATION_COMPLETED: + DBG("[notification-thread] Received session rotation completed command"); + ret = handle_notification_thread_command_session_rotation_completed( + state, + cmd->parameters.session_rotation_completed.session_name, + cmd->parameters.session_rotation_completed.trace_archive_chunk_id, + cmd->parameters.session_rotation_completed.location, + &cmd->reply_code); + break; case NOTIFICATION_COMMAND_TYPE_QUIT: DBG("[notification-thread] Received quit command"); cmd->reply_code = LTTNG_OK;