From 0ca52944daa81aea35eb372ccdb118c42a002d13 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Tue, 21 Aug 2018 15:48:36 -0400 Subject: [PATCH] Implement rotation ongoing/completed commands MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 7 ++++ .../notification-thread-events.c | 38 +++++++++++++++++++ 2 files changed, 45 insertions(+) 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; -- 2.34.1