From: Mathieu Desnoyers Date: Thu, 12 Dec 2019 17:52:24 +0000 (-0500) Subject: relayd: set has rotated only for explicit rotations X-Git-Tag: v2.12.0-rc1~126 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=489ea154c81ca25ff01877546631803430b2a794 relayd: set has rotated only for explicit rotations Only set session has_rotated for explicit rotations on the trace chunk close. This ensures has_rotated can distinguish between clear and explicit rotate. Signed-off-by: Mathieu Desnoyers Change-Id: I97fac1ac2a6edc233bf1889d693f74f2d7936156 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index 749feb6f6..5e99befa7 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -2372,7 +2372,6 @@ static int relay_rotate_session_streams( } else { chunk_id_str = chunk_id_buf; } - session->has_rotated = true; } DBG("Rotate %" PRIu32 " streams of session \"%s\" to chunk \"%s\"", @@ -2803,6 +2802,10 @@ static int relay_close_trace_chunk(const struct lttcomm_relayd_hdr *recv_hdr, goto end_unlock_session; } } + if (close_command.is_set && + close_command.value == LTTNG_TRACE_CHUNK_COMMAND_TYPE_MOVE_TO_COMPLETED) { + session->has_rotated = true; + } DBG("Reply chunk path on close: %s", closed_trace_chunk_path); path_length = strlen(closed_trace_chunk_path) + 1; if (path_length > UINT32_MAX) {