Remove unused session current_archive_location accessor
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 18:51:52 +0000 (14:51 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 30 Aug 2018 18:55:51 +0000 (14:55 -0400)
This function was replaced by
lttng_rotation_handle_get_archive_location() which requires
an lttng_rotation_handle to be used, making its use less
error-prone.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/lttng/rotate-internal.h
include/lttng/session.h
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/cmd.h
src/bin/lttng-sessiond/main.c
src/common/sessiond-comm/sessiond-comm.h
src/lib/lttng-ctl/lttng-ctl.c

index 966f9f969fe5c8bcbf895d02ad7374a65aa80987..c441780791b7f74907b643d7854e16749188953a 100644 (file)
@@ -111,11 +111,6 @@ struct lttng_rotation_get_info_return {
        } location;
 } LTTNG_PACKED;
 
        } location;
 } LTTNG_PACKED;
 
-/* For the LTTNG_SESSION_GET_CURRENT_OUTPUT command. */
-struct lttng_session_get_current_output_return {
-       char path[LTTNG_PATH_MAX];
-} LTTNG_PACKED;
-
 /* For the LTTNG_SESSION_LIST_SCHEDULES command. */
 struct lttng_session_list_schedules_return {
        struct {
 /* For the LTTNG_SESSION_LIST_SCHEDULES command. */
 struct lttng_session_list_schedules_return {
        struct {
index 7211eeec1ca11b7a3e4062148c00a9f7a46b92ad..599892d13508d7470f829f6c89da84b18aea6b9c 100644 (file)
@@ -162,23 +162,6 @@ extern int lttng_untrack_pid(struct lttng_handle *handle, int pid);
 extern int lttng_list_tracker_pids(struct lttng_handle *handle,
                int *enabled, int32_t **pids, size_t *nr_pids);
 
 extern int lttng_list_tracker_pids(struct lttng_handle *handle,
                int *enabled, int32_t **pids, size_t *nr_pids);
 
-/*
- * Ask the session daemon where the data for this session is currently being
- * written to. If rotations occured during a session, this call is useful to
- * know the location of the last chunk.
- *
- * Return 0 and allocate chunk_path if rotations occured for this session, the
- * caller needs to free chunk_path.
- * Return 1 if no rotation occured during the session, chunk_path is left
- * unallocated.
- *
- * Return a negative LTTng error code on error (readable with lttng_strerror).
- *
- * FIXME: Return an lttng_location object rather than a path.
- */
-extern int lttng_session_get_current_archive_location(const char *session_name,
-               char **chunk_path);
-
 #ifdef __cplusplus
 }
 #endif
 #ifdef __cplusplus
 }
 #endif
index 53a72d9b8d9129e04faac25ab84d81f214d2babd..e88ad0d0de4b3439f88d417ad58e82f58b9c99f3 100644 (file)
@@ -5047,58 +5047,6 @@ end:
        return ret;
 }
 
        return ret;
 }
 
-/*
- * Command ROTATE_GET_CURRENT_PATH from the lttng-ctl library.
- *
- * Configure the automatic rotation parameters.
- * Set to -1ULL to disable them.
- *
- * Return LTTNG_OK on success or else a LTTNG_ERR code.
- */
-int cmd_session_get_current_output(struct ltt_session *session,
-               struct lttng_session_get_current_output_return *output_return)
-{
-       int ret;
-       const char *path;
-
-       if (!session->snapshot_mode) {
-               if (session->current_archive_id == 0) {
-                       if (session->kernel_session) {
-                               path = session_get_base_path(session);
-                       } else if (session->ust_session) {
-                               path = session_get_base_path(session);
-                       } else {
-                               abort();
-                       }
-                       assert(path);
-               } else {
-                       path = session->rotation_chunk.active_tracing_path;
-               }
-       } else {
-               /*
-                * A snapshot session does not have a "current" trace archive
-                * location.
-                */
-               path = "";
-       }
-
-       DBG("Cmd get current output for session %s, returning %s",
-                       session->name, path);
-
-       ret = lttng_strncpy(output_return->path,
-                       path,
-                       sizeof(output_return->path));
-       if (ret) {
-               ERR("Failed to copy trace output path to session get current output command reply");
-               ret = -LTTNG_ERR_UNK;
-               goto end;
-       }
-
-       ret = LTTNG_OK;
-end:
-       return ret;
-}
-
 /* Wait for a given path to be removed before continuing. */
 static enum lttng_error_code wait_on_path(void *path_data)
 {
 /* Wait for a given path to be removed before continuing. */
 static enum lttng_error_code wait_on_path(void *path_data)
 {
index 16c07f78e66d78e25491e8e033c5c0c52c6c628d..c0fbee8f0ee2e220f0fb713309297aa7ef7665a5 100644 (file)
@@ -138,8 +138,6 @@ int cmd_rotate_session(struct ltt_session *session,
 int cmd_rotate_get_info(struct ltt_session *session,
                struct lttng_rotation_get_info_return *info_return,
                uint64_t rotate_id);
 int cmd_rotate_get_info(struct ltt_session *session,
                struct lttng_rotation_get_info_return *info_return,
                uint64_t rotate_id);
-int cmd_session_get_current_output(struct ltt_session *session,
-               struct lttng_session_get_current_output_return *output_return);
 int cmd_rotation_set_schedule(struct ltt_session *session,
                bool activate, enum lttng_rotation_schedule_type schedule_type,
                uint64_t value,
 int cmd_rotation_set_schedule(struct ltt_session *session,
                bool activate, enum lttng_rotation_schedule_type schedule_type,
                uint64_t value,
index 2c571c4a8dc38d379f8b675c7dc0c5a2636ec2c1..947c35db7cda8c92bd44bbe55fcc40513ed26698 100644 (file)
@@ -3102,7 +3102,6 @@ static int process_client_msg(struct command_ctx *cmd_ctx, int sock,
        case LTTNG_UNREGISTER_TRIGGER:
        case LTTNG_ROTATE_SESSION:
        case LTTNG_ROTATION_GET_INFO:
        case LTTNG_UNREGISTER_TRIGGER:
        case LTTNG_ROTATE_SESSION:
        case LTTNG_ROTATION_GET_INFO:
-       case LTTNG_SESSION_GET_CURRENT_OUTPUT:
        case LTTNG_ROTATION_SET_SCHEDULE:
        case LTTNG_SESSION_LIST_ROTATION_SCHEDULES:
                need_domain = 0;
        case LTTNG_ROTATION_SET_SCHEDULE:
        case LTTNG_SESSION_LIST_ROTATION_SCHEDULES:
                need_domain = 0;
@@ -4324,28 +4323,6 @@ error_add_context:
                ret = LTTNG_OK;
                break;
        }
                ret = LTTNG_OK;
                break;
        }
-       case LTTNG_SESSION_GET_CURRENT_OUTPUT:
-       {
-               struct lttng_session_get_current_output_return output_return;
-
-               memset(&output_return, 0, sizeof(output_return));
-               ret = cmd_session_get_current_output(cmd_ctx->session,
-                               &output_return);
-               if (ret < 0) {
-                       ret = -ret;
-                       goto error;
-               }
-
-               ret = setup_lttng_msg_no_cmd_header(cmd_ctx, &output_return,
-                               sizeof(output_return));
-               if (ret < 0) {
-                       ret = -ret;
-                       goto error;
-               }
-
-               ret = LTTNG_OK;
-               break;
-       }
        case LTTNG_ROTATION_SET_SCHEDULE:
        {
                bool set_schedule;
        case LTTNG_ROTATION_SET_SCHEDULE:
        {
                bool set_schedule;
index 56c925973038f51ea571a7ee177071e20ce5cb2a..3a2dd4946423aabb2a4299306eebae5ae5ab403b 100644 (file)
@@ -104,8 +104,7 @@ enum lttcomm_sessiond_command {
        LTTNG_ROTATE_SESSION                  = 45,
        LTTNG_ROTATION_GET_INFO               = 46,
        LTTNG_ROTATION_SET_SCHEDULE           = 47,
        LTTNG_ROTATE_SESSION                  = 45,
        LTTNG_ROTATION_GET_INFO               = 46,
        LTTNG_ROTATION_SET_SCHEDULE           = 47,
-       LTTNG_SESSION_GET_CURRENT_OUTPUT      = 48,
-       LTTNG_SESSION_LIST_ROTATION_SCHEDULES = 49,
+       LTTNG_SESSION_LIST_ROTATION_SCHEDULES = 48,
 };
 
 enum lttcomm_relayd_command {
 };
 
 enum lttcomm_relayd_command {
index d8e2f1428df7fc27560b532c5b3c41ca478c60f8..b57be223a73afce55723c858c66a5aedfa245b24 100644 (file)
@@ -2893,50 +2893,6 @@ end:
        return ret;
 }
 
        return ret;
 }
 
-int lttng_session_get_current_archive_location(const char *session_name,
-               char **chunk_path)
-{
-       struct lttcomm_session_msg lsm;
-       struct lttng_session_get_current_output_return *output_return = NULL;
-       int ret;
-       size_t path_len;
-
-       memset(&lsm, 0, sizeof(lsm));
-       lsm.cmd_type = LTTNG_SESSION_GET_CURRENT_OUTPUT;
-       ret = lttng_strncpy(lsm.session.name, session_name,
-                       sizeof(lsm.session.name));
-       if (ret) {
-               ret = -LTTNG_ERR_INVALID;
-               goto end;
-       }
-
-       ret = lttng_ctl_ask_sessiond(&lsm, (void **) &output_return);
-       if (ret < 0) {
-               ret = -1;
-               goto end;
-       }
-
-       path_len = lttng_strnlen(output_return->path,
-                       sizeof(output_return->path));
-       if (path_len == 0 || path_len == sizeof(output_return->path)) {
-               ret = -LTTNG_ERR_NO_SESSION_OUTPUT;
-               goto end;
-       }
-
-       *chunk_path = zmalloc(path_len + 1);
-       if (!*chunk_path) {
-               ret = -1;
-               goto end;
-       }
-       memcpy(*chunk_path, output_return->path, path_len);
-
-       ret = 0;
-
-end:
-       free(output_return);
-       return ret;
-}
-
 /*
  * lib constructor.
  */
 /*
  * lib constructor.
  */
This page took 0.030989 seconds and 4 git commands to generate.