From 92fe5ca1528abfa90cc26f767d274dbff61ffc61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 27 Mar 2019 14:12:47 -0400 Subject: [PATCH] Docs: clarify the meaning of the snapshot_mode flag in ltt_session MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The snapshot_mode flag of an ltt_session only affects the default channel creation attributes. It is not used to prevent the modification of snapshot outputs. Since a snapshot session is necessarily in "no-output" mode, it is redundant to check for this flag in rotation-related commands. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/cmd.c | 6 ++---- src/bin/lttng-sessiond/session.h | 8 +++++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index d91869fae..033018620 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -4499,8 +4499,7 @@ int cmd_rotate_session(struct ltt_session *session, goto end; } - if (session->live_timer || session->snapshot_mode || - !session->output_traces) { + if (session->live_timer || !session->output_traces) { cmd_ret = LTTNG_ERR_ROTATION_NOT_AVAILABLE; goto end; } @@ -4849,8 +4848,7 @@ int cmd_rotation_set_schedule(struct ltt_session *session, DBG("Cmd rotate set schedule session %s", session->name); - if (session->live_timer || session->snapshot_mode || - !session->output_traces) { + if (session->live_timer || !session->output_traces) { DBG("Failing ROTATION_SET_SCHEDULE command as the rotation feature is not available for this session"); ret = LTTNG_ERR_ROTATION_NOT_AVAILABLE; goto end; diff --git a/src/bin/lttng-sessiond/session.h b/src/bin/lttng-sessiond/session.h index 6a0da6c16..82e409521 100644 --- a/src/bin/lttng-sessiond/session.h +++ b/src/bin/lttng-sessiond/session.h @@ -114,9 +114,11 @@ struct ltt_session { /* Indicate if the session has to output the traces or not. */ unsigned int output_traces; /* - * This session is in snapshot mode. This means that every channel enabled - * will be set in overwrite mode and mmap. It is considered exclusively for - * snapshot purposes. + * This session is in snapshot mode. This means that channels enabled + * will be set in overwrite mode by default and must be in mmap + * output mode. Note that snapshots can be taken on a session that + * is not in "snapshot_mode". This parameter only affects channel + * creation defaults. */ unsigned int snapshot_mode; /* -- 2.34.1