- /*
- * Here the muxing of message is done.
- *
- * We need to iterate over all the streams of all the traces of all the
- * viewer sessions in order to get the message with the smallest
- * timestamp. In this case, a session is a viewer session and there is
- * one viewer session per consumer daemon. (UST 32bit, UST 64bit and/or
- * kernel). Each viewer session can have multiple traces, for example,
- * 64bit UST viewer sessions could have multiple per-pid traces.
- *
- * We iterate over the streams of each traces to update and see what is
- * their next message's timestamp. From those timestamps, we select the
- * message with the smallest timestamp as the best candidate message
- * for that trace and do the same thing across all the sessions.
- *
- * We then compare the timestamp of best candidate message of all the
- * sessions to pick the message with the smallest timestamp and we
- * return it.
- */
- while (*count < capacity) {
- struct lttng_live_stream_iterator *youngest_stream_iter = NULL,
- *candidate_stream_iter = NULL;
- int64_t youngest_msg_ts_ns = INT64_MAX;
-
- BT_ASSERT_DBG(lttng_live_msg_iter->sessions);
- session_idx = 0;
- while (session_idx < lttng_live_msg_iter->sessions->len) {
- struct lttng_live_session *session = (lttng_live_session *) g_ptr_array_index(
- lttng_live_msg_iter->sessions, session_idx);
-
- /* Find the best candidate message to send downstream. */
- stream_iter_status = next_stream_iterator_for_session(lttng_live_msg_iter, session,
- &candidate_stream_iter);
-
- /* If we receive an END status, it means that either:
- * - Those traces never had active streams (UST with no
- * data produced yet),
- * - All live stream iterators have ENDed.*/
- if (stream_iter_status == LTTNG_LIVE_ITERATOR_STATUS_END) {
- if (session->closed && session->traces->len == 0) {
- /*
- * Remove the session from the list.
- * session_idx is not modified since
- * g_ptr_array_remove_index_fast
- * replaces the the removed element with
- * the array's last element.
- */
- g_ptr_array_remove_index_fast(lttng_live_msg_iter->sessions, session_idx);
- } else {
- session_idx++;
+ /*
+ * Here the muxing of message is done.
+ *
+ * We need to iterate over all the streams of all the traces of all the
+ * viewer sessions in order to get the message with the smallest
+ * timestamp. In this case, a session is a viewer session and there is
+ * one viewer session per consumer daemon. (UST 32bit, UST 64bit and/or
+ * kernel). Each viewer session can have multiple traces, for example,
+ * 64bit UST viewer sessions could have multiple per-pid traces.
+ *
+ * We iterate over the streams of each traces to update and see what is
+ * their next message's timestamp. From those timestamps, we select the
+ * message with the smallest timestamp as the best candidate message
+ * for that trace and do the same thing across all the sessions.
+ *
+ * We then compare the timestamp of best candidate message of all the
+ * sessions to pick the message with the smallest timestamp and we
+ * return it.
+ */
+ while (*count < capacity) {
+ struct lttng_live_stream_iterator *youngest_stream_iter = NULL,
+ *candidate_stream_iter = NULL;
+ int64_t youngest_msg_ts_ns = INT64_MAX;
+
+ BT_ASSERT_DBG(lttng_live_msg_iter->sessions);
+ session_idx = 0;
+ while (session_idx < lttng_live_msg_iter->sessions->len) {
+ struct lttng_live_session *session = (lttng_live_session *) g_ptr_array_index(
+ lttng_live_msg_iter->sessions, session_idx);
+
+ /* Find the best candidate message to send downstream. */
+ stream_iter_status = next_stream_iterator_for_session(lttng_live_msg_iter, session,
+ &candidate_stream_iter);
+
+ /* If we receive an END status, it means that either:
+ * - Those traces never had active streams (UST with no
+ * data produced yet),
+ * - All live stream iterators have ENDed.
+ */
+ if (stream_iter_status == LTTNG_LIVE_ITERATOR_STATUS_END) {
+ if (session->closed && session->traces->len == 0) {
+ /*
+ * Remove the session from the list.
+ * session_idx is not modified since
+ * g_ptr_array_remove_index_fast
+ * replaces the the removed element with
+ * the array's last element.
+ */
+ g_ptr_array_remove_index_fast(lttng_live_msg_iter->sessions, session_idx);
+ } else {
+ session_idx++;
+ }
+ continue;