Fix: only create trace chunk if the output of a session supports it
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 1 Aug 2019 20:35:27 +0000 (16:35 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Aug 2019 15:28:43 +0000 (11:28 -0400)
A trace chunk should only be created on the session daemon end when
the trace's output supports this notion (2.11+).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/cmd.c
src/bin/lttng-sessiond/session.c
src/bin/lttng-sessiond/session.h

index 3bb3aced586edbb2f07da3c117ae5428942a2356..10a6de39168c73d68766f92f0b8a3003707b564c 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(
index 20edd47e4c707a109b350795c0eb1d725406b7bf..c4692504b5cd589d370e2ce917117b0b00d71eb1 100644 (file)
@@ -564,9 +564,12 @@ error:
        goto end_no_move;
 }
 
-static
-bool output_supports_trace_chunks(const struct consumer_output *output)
+bool session_output_supports_trace_chunks(const struct ltt_session *session)
 {
+       const struct consumer_output *output = session->kernel_session ?
+                       session->kernel_session->consumer :
+                       session->ust_session->consumer;
+
        if (output->type == CONSUMER_DST_LOCAL) {
                return true;
        } else {
@@ -619,9 +622,6 @@ struct lttng_trace_chunk *session_create_new_trace_chunk(
                goto error;
        }
 
-       if (!output_supports_trace_chunks(output)) {
-               goto end;
-       }
        next_chunk_id = session->most_recent_chunk_id.is_set ?
                        session->most_recent_chunk_id.value + 1 : 0;
 
index 03d90c2c5ae8041b58572eb8329321bdfe303a74..d524df1cc225caa60c0089227c5d77856ece0525 100644 (file)
@@ -249,4 +249,6 @@ int session_close_trace_chunk(const struct ltt_session *session,
                struct lttng_trace_chunk *trace_chunk,
                const enum lttng_trace_chunk_command_type *close_command);
 
+bool session_output_supports_trace_chunks(const struct ltt_session *session);
+
 #endif /* _LTT_SESSION_H */
This page took 0.028171 seconds and 4 git commands to generate.