correct path sent to the consumer even with a relay
authorJulien Desfossez <jdesfossez@efficios.com>
Wed, 30 Aug 2017 20:22:19 +0000 (16:22 -0400)
committerJulien Desfossez <jdesfossez@efficios.com>
Wed, 6 Sep 2017 17:59:58 +0000 (13:59 -0400)
Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/consumer.c
src/common/consumer/consumer.c

index 6c815eff15a701e4a563f10e677dfcdb5c60170f..82f88adcb6fd0491a8a902f097219d9c640391a7 100644 (file)
@@ -4215,7 +4215,7 @@ int cmd_rotate_session(struct ltt_session *session,
                                datetime);
                /* The sub-directory for the consumer. */
                snprintf(session->kernel_session->consumer->chunk_path,
-                               PATH_MAX, "/%s-/%s/", datetime,
+                               PATH_MAX, "/%s-%s", datetime,
                                session->kernel_session->consumer->subdir);
                ret = kernel_rotate_session(session);
                if (ret != LTTNG_OK) {
@@ -4228,7 +4228,7 @@ int cmd_rotate_session(struct ltt_session *session,
                                session->ust_session->consumer->dst.session_root_path,
                                datetime);
                snprintf(session->ust_session->consumer->chunk_path,
-                               PATH_MAX, "/%s-/", datetime);
+                               PATH_MAX, "/%s-", datetime);
                ret = ust_app_rotate_session(session);
                if (ret != LTTNG_OK) {
                        goto error;
index fc5d0fc95c841463c5bd1f03c2fbdafa3d906ac9..085c8cbcf19e008aa8e974a652188070eb2177f2 100644 (file)
@@ -1613,21 +1613,20 @@ int consumer_rotate_channel(struct consumer_socket *socket, uint64_t key,
        msg.u.rotate_channel.metadata = metadata;
 
        if (output->type == CONSUMER_DST_NET) {
-               fprintf(stderr, "SUBDIR: %s\n", output->subdir);
+               fprintf(stderr, "BASE: %s\n", output->dst.net.base_dir);
                fprintf(stderr, "CHUNK: %s\n", output->chunk_path);
                msg.u.rotate_channel.relayd_id = output->net_seq_index;
-               snprintf(msg.u.rotate_channel.pathname, PATH_MAX, "%s/%s/%s",
-                               output->subdir,
+               snprintf(msg.u.rotate_channel.pathname, PATH_MAX, "%s%s%s",
+                               output->dst.net.base_dir,
                                output->chunk_path, app_pathname);
                fprintf(stderr, "SENDING: %s\n", msg.u.rotate_channel.pathname);
        } else {
                msg.u.rotate_channel.relayd_id = (uint64_t) -1ULL;
-               snprintf(msg.u.rotate_channel.pathname, PATH_MAX, "%s/%s/%s",
+               snprintf(msg.u.rotate_channel.pathname, PATH_MAX, "%s%s%s",
                                output->dst.session_root_path,
                                output->chunk_path, app_pathname);
                fprintf(stderr, "rotate to %s\n",
                                msg.u.rotate_channel.pathname);
-
        }
 
        health_code_update();
index b99068925946e6e692148043eccbd4baa70a40fc..0289566d10f0c4e9b1b6afd207573195f938f650 100644 (file)
@@ -4096,7 +4096,7 @@ void lttng_consumer_reset_stream_rotate_state(struct lttng_consumer_stream *stre
 
 /*
  * Performs the stream rotation for the rotate session feature if needed.
- * It must be called with the stream and channel locks held.
+ * It must be called with the stream lock held.
  *
  * Return 0 on success, a negative number of error.
  */
This page took 0.032975 seconds and 5 git commands to generate.