quick fixes
[deliverable/lttng-tools.git] / src / bin / lttng-sessiond / rotate.c
index f1085e42e5708114c554fb09cef0306ad670f3c8..d99e2d9ff6a5beaab6dd483b8cb53670f7d2033b 100644 (file)
@@ -82,7 +82,7 @@ end:
 }
 
 int session_rename_chunk(struct ltt_session *session, char *current_path,
-               char *new_path, uint32_t create)
+               char *new_path)
 {
        int ret;
        struct consumer_socket *socket;
@@ -121,7 +121,7 @@ int session_rename_chunk(struct ltt_session *session, char *current_path,
        cds_lfht_for_each_entry(output->socks->ht, &iter.iter, socket, node.node) {
                pthread_mutex_lock(socket->lock);
                ret = consumer_rotate_rename(socket, session->id, output,
-                               current_path, new_path, create, uid, gid);
+                               current_path, new_path, uid, gid);
                pthread_mutex_unlock(socket->lock);
                if (ret) {
                        ERR("Consumer rename chunk");
@@ -158,8 +158,13 @@ int rename_first_chunk(struct ltt_session *session,
        }
 
        /* Current domain path: <session>/kernel */
-       snprintf(tmppath, PATH_MAX, "%s/%s",
-                       consumer->dst.session_root_path, consumer->subdir);
+       if (session->net_handle > 0) {
+               snprintf(tmppath, PATH_MAX, "%s/%s",
+                               consumer->dst.net.base_dir, consumer->subdir);
+       } else {
+               snprintf(tmppath, PATH_MAX, "%s/%s",
+                               consumer->dst.session_root_path, consumer->subdir);
+       }
        /* New domain path: <session>/<start-date>-<end-date>-<rotate-count>/kernel */
        snprintf(tmppath2, PATH_MAX, "%s/%s",
                        new_path, consumer->subdir);
@@ -167,7 +172,7 @@ int rename_first_chunk(struct ltt_session *session,
         * Move the per-domain folder inside the first rotation
         * folder.
         */
-       ret = session_rename_chunk(session, tmppath, tmppath2, 1);
+       ret = session_rename_chunk(session, tmppath, tmppath2);
        if (ret < 0) {
                ERR("Rename first trace directory");
                ret = -LTTNG_ERR_ROTATE_NO_DATA;
@@ -244,7 +249,7 @@ int rename_complete_chunk(struct ltt_session *session, time_t ts)
                        }
                }
                if (session->ust_session) {
-                       fprintf(stderr, "rename %s/kernel to %s\n",
+                       fprintf(stderr, "rename %s/ust to %s\n",
                                        session->rotation_chunk.current_rotate_path,
                                        new_path);
                        ret = rename_first_chunk(session,
@@ -271,7 +276,7 @@ int rename_complete_chunk(struct ltt_session *session, time_t ts)
 
                ret = session_rename_chunk(session,
                                session->rotation_chunk.current_rotate_path,
-                               new_path, 0);
+                               new_path);
                if (ret) {
                        ERR("Session rename");
                        ret = 0;
@@ -286,7 +291,6 @@ int rename_complete_chunk(struct ltt_session *session, time_t ts)
         */
        snprintf(session->rotation_chunk.current_rotate_path, PATH_MAX,
                        "%s", new_path);
-       session->rotate_pending = 0;
 
        goto end;
 
This page took 0.027328 seconds and 5 git commands to generate.