From: Jérémie Galarneau Date: Wed, 27 Mar 2019 18:12:47 +0000 (-0400) Subject: Docs: clarify the meaning of the snapshot_mode flag in ltt_session X-Git-Tag: v2.11.0-rc2~56 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5268a79bb6d83bf5ca707dab5ed93333b7396f1f;p=lttng-tools.git Docs: clarify the meaning of the snapshot_mode flag in ltt_session 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 --- 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; /*