From 489ea154c81ca25ff01877546631803430b2a794 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 12 Dec 2019 12:52:24 -0500 Subject: [PATCH] relayd: set has rotated only for explicit rotations MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng-relayd/main.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 2.34.1