Implement rotation ongoing/completed commands
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 21 Aug 2018 19:48:36 +0000 (15:48 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 24 Aug 2018 01:15:04 +0000 (21:15 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/notification-thread-events.c

index 6262750866db73d16f193ebe00e7c34475a1e3c7..1041b9f1a106d4090fff9d7422f2ea96d0b8333f 100644 (file)
@@ -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.
index c80d977da8a11fb553c1a4296f16ab9df1587dee..f84a08d38f1d20c94c62d47d9391ecd7aa2e217e 100644 (file)
@@ -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;
This page took 0.030731 seconds and 5 git commands to generate.