From: Jonathan Rajotte Date: Mon, 6 Jan 2020 18:26:54 +0000 (-0500) Subject: Fix: keep active session state on redundant start command X-Git-Tag: v2.12.0-rc1~84 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7a24ece351f5be3d915e5c93201a4b9fcf1d486b;p=lttng-tools.git Fix: keep active session state on redundant start command Steps to reproduce problem: lttng create lttng enable-event -u -a lttng start lttng start lttng stop Yield: Session auto-20200106-134455 created. Traces will be output to /home/joraj/lttng-traces/auto-20200106-134455 All UST events are enabled in channel channel0 Tracing started for session auto-20200106-134455 Warning: Tracing already started for session auto-20200106-134455 Warning: Tracing already stopped for session auto-20200106-134455 The "warning" on the "lttng stop" command is invalid. This was introduced by commit 1f4962443 Fix: sessiond: no rotation performed from null chunk to new chunk For cases where the session is already active, simply skip all the way to the end without passing via the error handling path. Signed-off-by: Jonathan Rajotte Change-Id: Iaf26090191d3eb940fa419848df8911758e0a6e3 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 4ce2d43fa..2c2ce285a 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -2651,7 +2651,8 @@ int cmd_start_trace(struct ltt_session *session) /* Is the session already started? */ if (session->active) { ret = LTTNG_ERR_TRACE_ALREADY_STARTED; - goto error; + /* Perform nothing */ + goto end; } if (session->rotation_state == LTTNG_ROTATION_STATE_ONGOING && @@ -2779,6 +2780,7 @@ error: session->cleared_after_last_stop = session_cleared_after_last_stop; } +end: return ret; }