Fix: don't perform an automatic session rotation in snapshot mode
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 3bb3aced586edbb2f07da3c117ae5428942a2356..f6c44d3be16e63096e856874344dd39e11b4d348 100644 (file)
@@ -2579,7 +2579,8 @@ int cmd_start_trace(struct ltt_session *session)
                goto error;
        }
 
-       if (session->output_traces && !session->current_trace_chunk) {
+       if (session->output_traces && !session->current_trace_chunk &&
+                       session_output_supports_trace_chunks(session)) {
                struct lttng_trace_chunk *trace_chunk;
 
                trace_chunk = session_create_new_trace_chunk(
@@ -3170,7 +3171,11 @@ int cmd_destroy_session(struct ltt_session *session,
 
        if (session->most_recent_chunk_id.is_set &&
                        session->most_recent_chunk_id.value != 0 &&
-                       session->current_trace_chunk) {
+                       session->current_trace_chunk && session->output_traces) {
+               /*
+                * Perform a last rotation on destruction if rotations have
+                * occurred during the session's lifetime.
+                */
                ret = cmd_rotate_session(session, NULL);
                if (ret != LTTNG_OK) {
                        ERR("Failed to perform an implicit rotation as part of the destruction of session \"%s\": %s",
This page took 0.024403 seconds and 4 git commands to generate.